
Python 3.6 reached its upstream EOL in September 2021, and was last included in CentOS Stream 8 and Ubuntu 18.04 LTS (Bionic) which are also both well past their EOL. This allows us to do some cleanup in how bindep is packaged, since PEP 517 and its successors weren't really well supported until versions of tools that have themselves dropped support for 3.6. Retain testing on ubuntu-bionic nodes for now, since there's non-default Python 3.7 packaged on them, as the only platform we presently have which meets that requirement for our new lower bound. Change-Id: I0945465b63e4a8654c735786b3e3cf794c763741
60 lines
1.7 KiB
Python
60 lines
1.7 KiB
Python
import nox
|
|
|
|
|
|
nox.options.error_on_external_run = True
|
|
nox.options.reuse_existing_virtualenvs = True
|
|
nox.options.sessions = ["tests-3", "linters"]
|
|
|
|
|
|
# Note setting python this way seems to give us a target name without
|
|
# python specific suffixes while still allowing us to force a specific
|
|
# version using --force-python.
|
|
@nox.session(python="3")
|
|
def linters(session):
|
|
session.install("hacking>=7,<8")
|
|
session.run("flake8")
|
|
|
|
|
|
@nox.session(python="3")
|
|
def docs(session):
|
|
session.install("-r", "requirements.txt")
|
|
session.install("-r", "doc/requirements.txt")
|
|
session.install(".")
|
|
session.run(
|
|
"sphinx-build", "-W",
|
|
"-d", "doc/build/doctrees",
|
|
"-b", "html",
|
|
"doc/source/", "doc/build/html"
|
|
)
|
|
|
|
|
|
@nox.session(python="3")
|
|
def venv(session):
|
|
session.install("-r", "requirements.txt")
|
|
session.install("-r", "test-requirements.txt")
|
|
session.install("-e", ".")
|
|
session.run(*session.posargs)
|
|
|
|
|
|
# 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")
|
|
session.install("-e", ".")
|
|
session.run("stestr", "run", *session.posargs)
|
|
session.run("stestr", "slowest")
|
|
|
|
|
|
@nox.session(python="3")
|
|
def cover(session):
|
|
session.install("-r", "requirements.txt")
|
|
session.install("-r", "test-requirements.txt")
|
|
session.install("-e", ".")
|
|
session.env["PYTHON"] = "coverage run --source bindep --parallel-mode"
|
|
session.run("stestr", "run", *session.posargs)
|
|
session.run("stestr", "slowest")
|
|
session.run("coverage", "combine")
|
|
session.run("coverage", "html", "-d", "cover")
|
|
session.run("coverage", "xml", "-o", "cover/coverage.xml")
|