From c760a22cfa9fff4c4b7f31d7a692638e1940e37e Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Wed, 15 Jan 2025 23:38:34 +0100 Subject: [PATCH 1/4] Bump version to 2.7 Alpha 1 --- novelwriter/__init__.py | 6 +++--- sample/nwProject.nwx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/novelwriter/__init__.py b/novelwriter/__init__.py index ab5b3c7a..ae1da61d 100644 --- a/novelwriter/__init__.py +++ b/novelwriter/__init__.py @@ -47,9 +47,9 @@ __license__ = "GPLv3" __author__ = "Veronica Berglyd Olsen" __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net" -__version__ = "2.7a0" -__hexversion__ = "0x020700a0" -__date__ = "2025-01-10" +__version__ = "2.7a1" +__hexversion__ = "0x020700a1" +__date__ = "2025-01-15" __status__ = "Stable" __domain__ = "novelwriter.io" diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 499c3d9d..c7374651 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,6 +1,6 @@ - - + + Sample Project Jane Smith From 4b30ce0f3906da38c1e4bd483f49714ac8c882d5 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Wed, 15 Jan 2025 23:51:27 +0100 Subject: [PATCH 2/4] Set package requirements to Qt 6.4 --- novelwriter/__init__.py | 8 ++++---- pyproject.toml | 2 +- setup/debian/control | 4 ++-- setup/debian/py3dist-overrides | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/novelwriter/__init__.py b/novelwriter/__init__.py index ae1da61d..9590241d 100644 --- a/novelwriter/__init__.py +++ b/novelwriter/__init__.py @@ -202,14 +202,14 @@ def main(sysArgs: list | None = None) -> GuiMain | None: "At least Python 3.10 is required, found %s" % CONFIG.verPyString ) errorCode |= 0x04 - if CONFIG.verQtValue < 0x060000: + if CONFIG.verQtValue < 0x060400: errorData.append( - "At least Qt6 version 6.0 is required, found %s" % CONFIG.verQtString + "At least Qt6 version 6.4 is required, found %s" % CONFIG.verQtString ) errorCode |= 0x08 - if CONFIG.verPyQtValue < 0x060000: + if CONFIG.verPyQtValue < 0x060400: errorData.append( - "At least PyQt6 version 6.0 is required, found %s" % CONFIG.verPyQtString + "At least PyQt6 version 6.4 is required, found %s" % CONFIG.verPyQtString ) errorCode |= 0x10 diff --git a/pyproject.toml b/pyproject.toml index 79ecd45b..e7170be1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ ] requires-python = ">=3.10" dependencies = [ - "pyqt5>=5.15", + "pyqt6>=6.4", "pyenchant>=3.0.0", ] dynamic = ["version"] diff --git a/setup/debian/control b/setup/debian/control index 9f9e5756..9877bae0 100644 --- a/setup/debian/control +++ b/setup/debian/control @@ -2,14 +2,14 @@ Source: novelwriter Maintainer: Veronica Berglyd Olsen Section: text Priority: optional -Build-Depends: dh-python, python3-setuptools, python3-all, debhelper (>= 9), python3 (>=3.10), python3-pyqt5 (>= 5.15), python3-enchant (>= 2.0) +Build-Depends: dh-python, python3-setuptools, python3-all, debhelper (>= 9), python3 (>=3.10), python3-pyqt6 (>= 6.4), python3-pyqt6.qtsvg (>= 6.4), python3-enchant (>= 2.0) Standards-Version: 4.5.1 Homepage: https://novelwriter.io X-Python3-Version: >= 3.10 Package: novelwriter Architecture: all -Depends: ${misc:Depends}, ${python3:Depends}, python3 (>=3.10), python3-pyqt5 (>= 5.15), python3-enchant (>= 2.0) +Depends: ${misc:Depends}, ${python3:Depends}, python3 (>=3.10), python3-pyqt6 (>= 6.4), python3-pyqt6.qtsvg (>= 6.4), python3-enchant (>= 2.0) Description: A markdown-like text editor for planning and writing novels novelWriter is a plain text editor designed for writing novels assembled from many smaller text documents. It uses a minimal formatting syntax inspired by diff --git a/setup/debian/py3dist-overrides b/setup/debian/py3dist-overrides index 2c65b5a4..2544de40 100644 --- a/setup/debian/py3dist-overrides +++ b/setup/debian/py3dist-overrides @@ -1 +1 @@ -pyqt5 python3-pyqt5 +pyqt6 python3-pyqt6 From 9388ea12f9e45fa5bd989c8ed4a46d529fe84d0f Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:23:14 +0100 Subject: [PATCH 3/4] Update Launchpad build --- pkgutils.py | 49 +++++++++++++-------------------------- requirements.txt | 2 +- setup/launchpad_setup.cfg | 47 ------------------------------------- setup/make_release.sh | 2 +- 4 files changed, 18 insertions(+), 82 deletions(-) delete mode 100644 setup/launchpad_setup.cfg diff --git a/pkgutils.py b/pkgutils.py index 100db556..36433327 100755 --- a/pkgutils.py +++ b/pkgutils.py @@ -633,7 +633,7 @@ def copySourceCode(dst: Path) -> None: # Copy Package Files ## -def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) -> None: +def copyPackageFiles(dst: Path, setupPy: bool = False) -> None: """Copy files needed for packaging.""" copyFiles = ["LICENSE.md", "CREDITS.md", "pyproject.toml"] @@ -655,24 +655,10 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) -> )) print("Wrote: setup.py") - if useCfg: - # This is needed for Ubuntu up to 22.04 - text = readFile(SETUP_DIR / "launchpad_setup.cfg") - text = text.replace("setup/description_pypi.md", "data/description_short.txt") - writeFile(dst / "setup.cfg", text) - print("Wrote: setup.cfg") - - writeFile(dst / "pyproject.toml", ( - "[build-system]\n" - "requires = [\"setuptools\"]\n" - "build-backend = \"setuptools.build_meta\"\n" - )) - print("Wrote: pyproject.toml") - else: - text = readFile(CURR_DIR / "pyproject.toml") - text = text.replace("setup/description_pypi.md", "data/description_short.txt") - writeFile(dst / "pyproject.toml", text) - print("Wrote: pyproject.toml") + text = readFile(CURR_DIR / "pyproject.toml") + text = text.replace("setup/description_pypi.md", "data/description_short.txt") + writeFile(dst / "pyproject.toml", text) + print("Wrote: pyproject.toml") return @@ -683,7 +669,7 @@ def copyPackageFiles(dst: Path, setupPy: bool = False, useCfg: bool = False) -> def makeDebianPackage( signKey: str | None = None, sourceBuild: bool = False, distName: str = "unstable", - buildName: str = "", oldSetuptools: bool = False, forLaunchpad: bool = False + buildName: str = "", forLaunchpad: bool = False ) -> str: """Build a Debian package.""" print("") @@ -743,7 +729,7 @@ def makeDebianPackage( print("Copying or generating additional files ...") print("") - copyPackageFiles(outDir, setupPy=True, useCfg=oldSetuptools) + copyPackageFiles(outDir, setupPy=True) # Copy/Write Debian Files # ======================= @@ -830,22 +816,20 @@ def buildForLaunchpad(args: argparse.Namespace) -> None: print("==================") print("") - if args.first: - bldNum = "0" + if args.build: + bldNum = str(args.build) else: - bldNum = input("Build number [0]: ") - if bldNum == "": - bldNum = "0" + bldNum = "0" distLoop = [ - ("22.04", "jammy", True), - ("24.04", "noble", False), - ("24.10", "oracular", False), + ("24.04", "noble"), + ("24.10", "oracular"), + ("25.04", "plucky"), ] print("Building Ubuntu packages for:") print("") - for distNum, codeName, _ in distLoop: + for distNum, codeName in distLoop: print(f" * Ubuntu {distNum} {codeName.title()}") print("") @@ -855,14 +839,13 @@ def buildForLaunchpad(args: argparse.Namespace) -> None: print("") dputCmd = [] - for distNum, codeName, oldSetup in distLoop: + for distNum, codeName in distLoop: buildName = f"ubuntu{distNum}.{bldNum}" dCmd = makeDebianPackage( signKey=signKey, sourceBuild=True, distName=codeName, buildName=buildName, - oldSetuptools=oldSetup, forLaunchpad=True, ) dputCmd.append(dCmd) @@ -1579,7 +1562,7 @@ if __name__ == "__main__": ) ) cmdBuildUbuntu.add_argument("--sign", action="store_true", help="Sign the package.") - cmdBuildUbuntu.add_argument("--first", action="store_true", help="Set build number to 0.") + cmdBuildUbuntu.add_argument("--build", type=int, help="Set build number.") cmdBuildUbuntu.set_defaults(func=buildForLaunchpad) # Build AppImage diff --git a/requirements.txt b/requirements.txt index 7b7c4d39..fa1cf957 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -pyqt6>=6.0 +pyqt6>=6.4 pyenchant>=3.0.0 diff --git a/setup/launchpad_setup.cfg b/setup/launchpad_setup.cfg deleted file mode 100644 index 74b3360d..00000000 --- a/setup/launchpad_setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -[metadata] -name = novelWriter -version = attr: novelwriter.__version__ -author = Veronica Berglyd Olsen -author_email = code@vkbo.net -description = A markdown-like text editor for planning and writing novels -url = https://novelwriter.io -long_description = file: setup/description_pypi.md -long_description_content_type = text/markdown -license_files = LICENSE.md -license = GNU General Public License v3 -classifiers = - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 - Programming Language :: Python :: Implementation :: CPython - License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Development Status :: 5 - Production/Stable - Operating System :: OS Independent - Intended Audience :: End Users/Desktop - Natural Language :: English - Topic :: Text Editors -project_urls = - Bug Tracker = https://github.com/vkbo/novelWriter/issues - Documentation = https://docs.novelwriter.io - Source Code = https://github.com/vkbo/novelWriter - -[options] -zip_safe = False -python_requires = >=3.10 -include_package_data = True -packages = find_namespace: -install_requires = - pyqt5>=5.15 - pyenchant>=3.0.0 - -[options.packages.find] -include = novelwriter* - -[options.entry_points] -gui_scripts = - novelwriter = novelwriter:main - -[bdist_wheel] -universal = 0 diff --git a/setup/make_release.sh b/setup/make_release.sh index d88340a7..5dd543ee 100755 --- a/setup/make_release.sh +++ b/setup/make_release.sh @@ -25,4 +25,4 @@ echo " Building Linux Packages" echo "================================================================================" echo "" python3 pkgutils.py build-deb --sign -python3 pkgutils.py build-ubuntu --sign --first +python3 pkgutils.py build-ubuntu --sign From cd8da61977436f1ff483745e68e90b572edc8f1a Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:38:10 +0100 Subject: [PATCH 4/4] Update various Qt 5 references and links --- README.md | 2 +- docs/source/index.rst | 2 +- docs/source/more_customise.rst | 2 +- docs/source/tech_locations.rst | 2 +- docs/source/usage_writing.rst | 5 +---- i18n/README.md | 6 +++--- novelwriter/config.py | 2 +- 7 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4f3e65f9..6432fdb3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ documentation. ## Implementation -novelWriter is written with Python 3 (3.10+) using Qt6 and PyQt6 (6.0+), and is released on +novelWriter is written with Python 3 (3.10+) using Qt6 and PyQt6 (6.4+), and is released on Linux, Windows and macOS. It can in principle run on any Operating System that also supports Qt, PyQt and Python. diff --git a/docs/source/index.rst b/docs/source/index.rst index 7c8d75c3..c10ea5e9 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -20,7 +20,7 @@ The project storage is suitable for version control software, and also well suit synchronisation tools. All text is saved as plain text files, and your project data as standard data formats in XML and JSON. See :ref:`a_storage` for more details. -Any operating system that has Python 3 and the Qt 5 libraries should be able to run novelWriter. +Any operating system that has Python 3 and the Qt 6 libraries should be able to run novelWriter. It runs fine on Linux, Windows and MacOS, and users have tested it on other platforms as well. See :ref:`a_started` for more details. diff --git a/docs/source/more_customise.rst b/docs/source/more_customise.rst index 0cedb82c..924a0ef7 100644 --- a/docs/source/more_customise.rst +++ b/docs/source/more_customise.rst @@ -144,7 +144,7 @@ In the Main section you must at least define the ``name`` and ``icontheme`` sett setting must match the icon theme's folder name. The Palette values correspond to the Qt enum values for ``QPalette::ColorRole``, see the -`Qt documentation `_ for more details. The +`Qt documentation `_ for more details. The colour values are RGB numbers on the format ``r, g, b`` where each is an integer from ``0`` to ``255``. Omitted values are not loaded and will use default values. If the ``helptext`` colour is not defined, it is computed as a colour between the ``window`` and ``windowtext`` colour. diff --git a/docs/source/tech_locations.rst b/docs/source/tech_locations.rst index 3cd09e60..cc4b612e 100644 --- a/docs/source/tech_locations.rst +++ b/docs/source/tech_locations.rst @@ -4,7 +4,7 @@ File Locations ************** -.. _QStandardPaths: https://doc.qt.io/qt-5/qstandardpaths.html +.. _QStandardPaths: https://doc.qt.io/qt-6/qstandardpaths.html novelWriter will create a few files on your system outside of the application folder itself. These file locations are described in this chapter. diff --git a/docs/source/usage_writing.rst b/docs/source/usage_writing.rst index b59ff19f..a82bdd06 100644 --- a/docs/source/usage_writing.rst +++ b/docs/source/usage_writing.rst @@ -136,12 +136,9 @@ document when reaching the end. There is also a switch that will try to match th when the replacement is made. That is, it will try to keep the word upper, lower, or capitalised to match the word being replaced. -The regular expression search is somewhat dependant on which version of Qt your system has. If you -have Qt 5.13 or higher, there is better support for Unicode symbols in the search. - .. seealso:: For more information on the capabilities of the Regular Expression option, see the Qt - documentation for the `QRegularExpression `_ + documentation for the `QRegularExpression `_ class. diff --git a/i18n/README.md b/i18n/README.md index b45439dd..b2df46f0 100644 --- a/i18n/README.md +++ b/i18n/README.md @@ -45,7 +45,7 @@ instance `en_GB` for British English. ## Qt GUI Localisation -You will need the translation tool Qt 5 Linguist on your system. +You will need the translation tool Qt Linguist on your system. For Ubuntu/Debian, run: @@ -53,7 +53,7 @@ For Ubuntu/Debian, run: sudo apt install qttools5-dev-tools ``` -See also [Qt Linguist Manual: Translators](https://doc.qt.io/qt-5/linguist-translators.html). +See also [Qt Linguist Manual: Translators](https://doc.qt.io/qt-6/linguist-translators.html). ### Workflow @@ -94,7 +94,7 @@ TS file format. On Debian/Ubuntu it is provided by the package `pyqt6-dev-tools` ### Edit the Translation File in Qt Linguist -The `i18n/nw_XX.ts` file can be edited with the Qt Linguist application provided by Qt 5. This is +The `i18n/nw_XX.ts` file can be edited with the Qt Linguist application provided by Qt. This is by far easier than manually editing the `.ts` file. Please select "English" and "United Kingdom" as the _source_ language if prompted by Qt Linguist. diff --git a/novelwriter/config.py b/novelwriter/config.py index 4a9fe6a5..14123d8a 100644 --- a/novelwriter/config.py +++ b/novelwriter/config.py @@ -534,7 +534,7 @@ class Config: self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat) langList = [ - (self._qtLangPath, "qtbase"), # Qt 5.x + (self._qtLangPath, "qtbase"), # Qt (str(self._nwLangPath), "nw"), # novelWriter ] for lngPath, lngBase in langList: