From e766fa7dccecae12434e34f2da7f0133490321c6 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 31 Aug 2023 19:09:23 +0200 Subject: [PATCH] Remove official Python 3.7 support --- README.md | 2 +- docs/source/int_started.rst | 2 +- novelwriter/__init__.py | 4 ++-- novelwriter/core/document.py | 8 ++------ setup.cfg | 3 +-- setup/debian/control | 6 +++--- setup/description_pypi.md | 2 +- 7 files changed, 11 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 7112b684..f9ea4bed 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ documentation. ## Implementation -novelWriter is written with Python 3 (3.7+) using Qt5 and PyQt5 (5.10+), and is released on Linux, +novelWriter is written with Python 3 (3.8+) using Qt5 and PyQt5 (5.10+), 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/int_started.rst b/docs/source/int_started.rst index 002fdcae..2db89a96 100644 --- a/docs/source/int_started.rst +++ b/docs/source/int_started.rst @@ -174,7 +174,7 @@ Installing Python on Windows In order to run novelWriter from source, or install from PyPi, you need to have Python set up on your system. Unlike Linux and MacOS, Windows does not come with Python pre-installed. -You can download Python from `python.org`_. Python 3.7 or higher is required for running +You can download Python from `python.org`_. Python 3.8 or higher is required for running novelWriter, but it is recommended that you install the latest version. Make sure you select the "Add Python to PATH" option during installation, otherwise the ``python`` diff --git a/novelwriter/__init__.py b/novelwriter/__init__.py index eb80034d..26347b20 100644 --- a/novelwriter/__init__.py +++ b/novelwriter/__init__.py @@ -170,9 +170,9 @@ def main(sysArgs: list | None = None): # Check Packages and Versions errorData = [] errorCode = 0 - if sys.hexversion < 0x030700f0: + if sys.hexversion < 0x030800f0: errorData.append( - "At least Python 3.7 is required, found %s" % CONFIG.verPyString + "At least Python 3.8 is required, found %s" % CONFIG.verPyString ) errorCode |= 0x04 if CONFIG.verQtValue < 0x050a00: diff --git a/novelwriter/core/document.py b/novelwriter/core/document.py index 23bfbb19..b8512c24 100644 --- a/novelwriter/core/document.py +++ b/novelwriter/core/document.py @@ -268,12 +268,8 @@ class NWDocument: docTemp = docPath.with_suffix(".tmp") try: - # ToDo: When Python 3.7 is dropped, these can be changed to - # path.unlink(missing_ok=True) - if docPath.exists(): - docPath.unlink() - if docTemp.exists(): - docTemp.unlink() + docPath.unlink(missing_ok=True) + docTemp.unlink(missing_ok=True) except Exception as exc: self._docError = formatException(exc) return False diff --git a/setup.cfg b/setup.cfg index 497f444a..73fb6092 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,6 @@ license_files = LICENSE.md license = GNU General Public License v3 classifiers = Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 @@ -30,7 +29,7 @@ project_urls = [options] zip_safe = False -python_requires = >=3.7 +python_requires = >=3.8 include_package_data = True packages = find_namespace: install_requires = diff --git a/setup/debian/control b/setup/debian/control index 0fb2616b..556a5051 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.7), python3-pyqt5 (>= 5.10), python3-enchant (>= 2.0) +Build-Depends: dh-python, python3-setuptools, python3-all, debhelper (>= 9), python3 (>=3.8), python3-pyqt5 (>= 5.10), python3-enchant (>= 2.0) Standards-Version: 4.5.1 Homepage: https://novelwriter.io -X-Python3-Version: >= 3.7 +X-Python3-Version: >= 3.8 Package: novelwriter Architecture: all -Depends: ${misc:Depends}, ${python3:Depends}, python3 (>=3.7), python3-pyqt5 (>= 5.10), python3-enchant (>= 2.0) +Depends: ${misc:Depends}, ${python3:Depends}, python3 (>=3.8), python3-pyqt5 (>= 5.10), 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/description_pypi.md b/setup/description_pypi.md index 2a70f678..9ee924c8 100644 --- a/setup/description_pypi.md +++ b/setup/description_pypi.md @@ -10,7 +10,7 @@ synchronisation tools. All text is saved as plain text files with a meta data he project structure is stored in a single project XML file, and other meta data is primarily saved as JSON files. -The application is written with Python 3 (3.7+) using Qt5 and PyQt5 (5.3+). It is developed on +The application is written with Python 3 (3.8+) using Qt5 and PyQt5 (5.3+). It is developed on Linux, but should in principle work fine on other operating systems as well as long as dependencies are met. It is regularly tested on Debian and Ubuntu Linux, Windows, and macOS.