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

View File

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

View File

@ -3,7 +3,7 @@ import nox
nox.options.error_on_external_run = 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
@ -11,7 +11,7 @@ nox.options.sessions = ["tests-3", "tests-2.7", "linters"]
# version using --force-python.
@nox.session(python="3")
def linters(session):
session.install("hacking>=3.2.0,<3.3")
session.install("hacking>=7,<8")
session.run("flake8")
@ -36,8 +36,8 @@ def venv(session):
session.run(*session.posargs)
# This will attempt to run python3 and 2.7 tests by default.
@nox.session(python=["3", "2.7"])
# This will attempt to run python3 tests by default.
@nox.session(python=["3"])
def tests(session):
session.install("-r", "requirements.txt")
session.install("-r", "test-requirements.txt")

View File

@ -33,6 +33,8 @@ classifier =
Programming Language :: Python :: 3.9
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
Topic :: Software Development :: Quality Assurance
Topic :: Software Development :: Testing

View File

@ -16,14 +16,6 @@
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(
setup_requires=['pbr'],
pbr=True)

View File

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