From 302424ac8120c5f5d85767393c30dbf209b99d95 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:27:52 +0200 Subject: [PATCH 1/9] Remove Python 3.7 from test matrix --- tox.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index a5e7e62de8..edd85b533d 100644 --- a/tox.ini +++ b/tox.ini @@ -7,11 +7,11 @@ # of the documentation in hacking.rst [tox] envlist = - {unit,integration,functional}-py{37,39,310}-django{32} + {unit,integration,functional}-py{39,310}-django{32} javascript docs skipsdist = True -basepython = python3.7 +basepython = python3.9 [pytest] addopts = --failed-first @@ -20,7 +20,6 @@ markers = [gh-actions] python = - 3.7: py37 3.9: py39 3.10: py310 From 7af37d87ebe7c56ef7589f8075b7aff5017b8c1f Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:28:13 +0200 Subject: [PATCH 2/9] Update Python version for readthedocs --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 308e970994..6112937024 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,4 +15,4 @@ python: build: os: ubuntu-22.04 tools: - python: "3.7" + python: "3.9" From 23a9bb292ce93e00fb9f4791b8cbf0a20160cad1 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:28:50 +0200 Subject: [PATCH 3/9] Update Python version for sonarcloud --- .sonarcloud.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.sonarcloud.properties b/.sonarcloud.properties index bbbf78c710..47db2b6d19 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -11,7 +11,7 @@ sonar.sources=bin, python # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 -sonar.python.version=3.7, 3.8, 3.9 +sonar.python.version=3.9,3.10 sonar.tests=tests sonar.exclusions=python/nav/smidumps/**, python/nav/enterprise/ids.py, python/nav/etc/geomap/config.py From b42885ac11bcf458950e73a5d9145e7fa7a8c333 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:30:01 +0200 Subject: [PATCH 4/9] Remove Python 3.7 from docker --- tests/docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/docker/Dockerfile b/tests/docker/Dockerfile index 6add9e6052..3a74b3104a 100644 --- a/tests/docker/Dockerfile +++ b/tests/docker/Dockerfile @@ -20,7 +20,6 @@ RUN add-apt-repository ppa:deadsnakes/ppa && \ apt-get update && \ apt-get -y install --no-install-recommends \ curl git build-essential \ - python3.7-dbg python3.7-dev python3.7-distutils \ python3.9-dbg python3.9-dev \ python3.10-dbg python3.10-dev \ python3-pip @@ -68,7 +67,7 @@ RUN cd /tmp && \ mv chromedriver /usr/local/bin/ # Install our primary test runner -RUN python3.7 -m pip install 'tox<4' snmpsim 'pyasn1<0.5.0' virtualenv +RUN python3.9 -m pip install 'tox<4' snmpsim 'pyasn1<0.5.0' virtualenv # Add a build user ENV USER build From 5c61e15874120eff030e67fba63613c26508ef0a Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:30:45 +0200 Subject: [PATCH 5/9] Update minimum Python version in pyproject.toml to 3.9 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bc0b9f5839..727574eb14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "nav" description = "Network Administration Visualized - A comprehensive, free Network Management System" authors = [{name="Sikt - Norwegian agency for shared services in education and research", email="nav-support@uninett.no"}] readme = "README.rst" -requires-python = ">=3.7" +requires-python = ">=3.9" license = {text = "GPLv3"} keywords = ["nms", "snmp"] classifiers = [ From 92cd32edabce8547caa68c4e29b806755116d3c6 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:31:38 +0200 Subject: [PATCH 6/9] Remove constraints/extra requirements due to Python 3.7/3.8 --- constraints.txt | 3 --- pyproject.toml | 4 ---- requirements/base.txt | 5 +---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/constraints.txt b/constraints.txt index 72f02291d4..e69de29bb2 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,3 +0,0 @@ -# ciscoconfparse 1.8 has a bug that prevents it from being imported on Python 3.7, -# even though it claims compatibility with 3.7. -ciscoconfparse<1.8.0 ; python_version < '3.8' diff --git a/pyproject.toml b/pyproject.toml index 727574eb14..8aed6e66bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,6 @@ classifiers = [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", ] dynamic = ["version"] -dependencies = [ - "importlib_metadata; python_version < '3.8'", - "importlib_resources; python_version < '3.9'", -] [project.urls] diff --git a/requirements/base.txt b/requirements/base.txt index 4af7fd589e..67fc74d56b 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,7 +6,7 @@ psycopg2==2.9.9 # requires libpq to build IPy==1.01 pyaml -twisted~=23.8.0 # last version that still supports Python 3.7 +twisted>=23.8.0 networkx==2.6.3 Pillow>3.3.2 @@ -35,7 +35,4 @@ libsass==0.15.1 napalm==3.4.1 -backports.zoneinfo ; python_version < '3.9' -importlib_metadata ; python_version < '3.8' -importlib_resources ; python_version < '3.9' git+https://github.com/Uninett/drf-oidc-auth@v4.0#egg=drf-oidc-auth From 77535650fd7c3aafa41444beaaf5e8e34c2b8ab7 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:32:17 +0200 Subject: [PATCH 7/9] Remove use of Python 3.7 from Github workflow --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index df4431b000..2fa77d1bdf 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.7", "3.9", "3.10"] + python-version: ["3.9", "3.10"] steps: - uses: actions/checkout@v3 From a711862409961a092bd6e5cec662bfacd8cfc170 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 7 May 2024 16:33:00 +0200 Subject: [PATCH 8/9] Update minimum Python requirement to 3.9 in docs --- doc/howto/generic-install-from-source.rst | 6 +++--- doc/howto/manual-install-on-debian.rst | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/howto/generic-install-from-source.rst b/doc/howto/generic-install-from-source.rst index 9ae9a62659..49714ded23 100644 --- a/doc/howto/generic-install-from-source.rst +++ b/doc/howto/generic-install-from-source.rst @@ -18,7 +18,7 @@ Build requirements To build NAV, you need at least the following: - * Python >= 3.7.0 + * Python >= 3.9.0 * Sphinx >= 1.0 (for building this documentation) Runtime requirements @@ -29,7 +29,7 @@ To run NAV, these software packages are required: * Apache2 + mod_wsgi (or, really, any web server that supports the WSGI interface) * PostgreSQL >= 11 (With the ``hstore`` extension available) * :xref:`Graphite` - * Python >= 3.7.0 + * Python >= 3.9.0 * nbtscan = 1.5.1 * dhcping (only needed if using DHCP service monitor) @@ -47,7 +47,7 @@ files:: *However*, some of the required modules are C extensions that will require the presence of some C libraries to be correctly built (unless PyPI provides binary wheels for your platform). These include the ``psycopg2`` driver and the -``python-ldap`` and ``Pillow`` modules). +``python-ldap`` and ``Pillow`` modules. The current Python requirements are as follows: diff --git a/doc/howto/manual-install-on-debian.rst b/doc/howto/manual-install-on-debian.rst index 121a6b1fc7..2e849434a7 100644 --- a/doc/howto/manual-install-on-debian.rst +++ b/doc/howto/manual-install-on-debian.rst @@ -160,7 +160,7 @@ Copy the file :file:`/etc/nav/apache/apache.conf.example` to * ``documentation_path`` is where Sphinx put the docs, in ``$SOURCE_CODE_DIRECTORY/build/sphinx/html/``. * ``nav_uploads_path`` is the upload path you created in step 8. -* ``nav_python_base`` should be :file:`/usr/local/lib/python3.7/dist-packages` (or wherever the ``nav`` Python module was installed) +* ``nav_python_base`` should be :file:`/usr/local/lib/python3.9/dist-packages` (or wherever the ``nav`` Python module was installed) We suggest creating a new Apache site config: Inside a ``VirtualHost``-directive, add: From 4088f0997679879a14731fa268981371201820da Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 8 May 2024 08:52:36 +0200 Subject: [PATCH 9/9] Add changelog entries --- changelog.d/2790.changed.md | 1 + changelog.d/2790.removed.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 changelog.d/2790.changed.md create mode 100644 changelog.d/2790.removed.md diff --git a/changelog.d/2790.changed.md b/changelog.d/2790.changed.md new file mode 100644 index 0000000000..85b3fb94a4 --- /dev/null +++ b/changelog.d/2790.changed.md @@ -0,0 +1 @@ +Upgrade dependencies after dropping support for Python 3.7 \ No newline at end of file diff --git a/changelog.d/2790.removed.md b/changelog.d/2790.removed.md new file mode 100644 index 0000000000..02f870785a --- /dev/null +++ b/changelog.d/2790.removed.md @@ -0,0 +1 @@ +Drop support for Python 3.7 \ No newline at end of file