Update for newer Python, Tox and Hacking

Small but overdue fix for Tox v4 support, switch to newer Hacking so
that we can test on more recent Python versions, and update the
Trove classifiers to indicate the newer jobs we're running. Also
drop Python 2.7 from the envlist since we stopped supporting it
previously, and do the same for nox for symmetry.

Remove python-dev-all from the sample bindep.txt used for testing,
since that package no longer exists on Noble.

Clean up a missed Python 2.7 workaround in setup.py as well.

Note that while we're not yet testing with Python 3.13, I ran unit
tests on it locally and everything seems to be working.

Change-Id: Ifdd15e06269b0768ef2cb6c75894dbfcdbba7a4e
This commit is contained in:
Jeremy Stanley 2024-10-11 15:12:35 +00:00
parent 6e68fba298
commit 2113b3ea41
6 changed files with 16 additions and 35 deletions

View File

@ -21,14 +21,9 @@
nodeset: ubuntu-bionic nodeset: ubuntu-bionic
- job: - job:
name: bindep-ubuntu-focal name: bindep-ubuntu-noble
parent: bindep-base parent: bindep-base
nodeset: ubuntu-focal nodeset: ubuntu-noble
- job:
name: bindep-ubuntu-jammy
parent: bindep-base
nodeset: ubuntu-jammy
- project: - project:
vars: vars:
@ -39,31 +34,25 @@
jobs: jobs:
- bindep-centos-9-stream - bindep-centos-9-stream
- bindep-ubuntu-bionic - bindep-ubuntu-bionic
- bindep-ubuntu-focal - bindep-ubuntu-noble
- bindep-ubuntu-jammy
- build-python-release - build-python-release
- nox-linters - nox-linters
- nox-py36: - nox-py36:
nodeset: ubuntu-bionic nodeset: ubuntu-bionic
- nox-py310: - nox-py312:
nodeset: ubuntu-jammy nodeset: ubuntu-noble
- nox-py311:
nodeset: ubuntu-jammy
- nox-cover - nox-cover
gate: gate:
jobs: jobs:
- bindep-centos-9-stream - bindep-centos-9-stream
- bindep-ubuntu-bionic - bindep-ubuntu-bionic
- bindep-ubuntu-focal - bindep-ubuntu-noble
- bindep-ubuntu-jammy
- build-python-release - build-python-release
- nox-linters - nox-linters
- nox-py36: - nox-py36:
nodeset: ubuntu-bionic nodeset: ubuntu-bionic
- nox-py310: - nox-py312:
nodeset: ubuntu-jammy nodeset: ubuntu-noble
- nox-py311:
nodeset: ubuntu-jammy
- nox-cover - nox-cover
promote: promote:
jobs: jobs:

View File

@ -3,7 +3,6 @@
python3-all-dev [platform:dpkg] python3-all-dev [platform:dpkg]
python3-all [platform:dpkg] python3-all [platform:dpkg]
python-all-dev [platform:dpkg]
python-devel [platform:rpm !platform:centos-8] python-devel [platform:rpm !platform:centos-8]
python3-devel [platform:rpm] python3-devel [platform:rpm]

View File

@ -3,7 +3,7 @@ import nox
nox.options.error_on_external_run = True nox.options.error_on_external_run = True
nox.options.reuse_existing_virtualenvs = True nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["tests-3", "tests-2.7", "linters"] nox.options.sessions = ["tests-3", "linters"]
# Note setting python this way seems to give us a target name without # Note setting python this way seems to give us a target name without
@ -11,7 +11,7 @@ nox.options.sessions = ["tests-3", "tests-2.7", "linters"]
# version using --force-python. # version using --force-python.
@nox.session(python="3") @nox.session(python="3")
def linters(session): def linters(session):
session.install("hacking>=3.2.0,<3.3") session.install("hacking>=7,<8")
session.run("flake8") session.run("flake8")
@ -36,8 +36,8 @@ def venv(session):
session.run(*session.posargs) session.run(*session.posargs)
# This will attempt to run python3 and 2.7 tests by default. # This will attempt to run python3 tests by default.
@nox.session(python=["3", "2.7"]) @nox.session(python=["3"])
def tests(session): def tests(session):
session.install("-r", "requirements.txt") session.install("-r", "requirements.txt")
session.install("-r", "test-requirements.txt") session.install("-r", "test-requirements.txt")

View File

@ -33,6 +33,8 @@ classifier =
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Quality Assurance Topic :: Software Development :: Quality Assurance
Topic :: Software Development :: Testing Topic :: Software Development :: Testing

View File

@ -16,14 +16,6 @@
import setuptools import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr'], setup_requires=['pbr'],
pbr=True) pbr=True)

View File

@ -1,7 +1,6 @@
[tox] [tox]
min_version = 3.1 min_version = 3.1
envlist = py3,py27,pep8 envlist = py3,pep8
skipsdist = True
ignore_basepython_conflict=true ignore_basepython_conflict=true
[testenv] [testenv]
@ -19,7 +18,7 @@ commands =
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3
deps = deps =
hacking>=3.2.0,<3.3 hacking>=7,<8
commands = flake8 commands = flake8
[testenv:venv] [testenv:venv]