build: move the pytest settings into pyproject.toml - #960
Merged
cigamit merged 6 commits intoSep 13, 2026
Conversation
blaipr
force-pushed
the
build/pytest-and-coverage-into-pyproject
branch
from
September 13, 2026 00:37
f4a94b4 to
4b7c37a
Compare
blaipr
force-pushed
the
build/pytest-and-coverage-into-pyproject
branch
from
September 13, 2026 01:22
4b7c37a to
69f2cb3
Compare
MANIFEST.in names eight paths that are not in the tree: awx/lib/site-packages, awx/plugins, awx/api/tests, awx/ui/client, awx/playbooks/library/mkfifo.py, awx/public, VERSION, COPYING All inherited, and some of them long gone: awx/ui/client is the AngularJS UI, which went years before the 22.5.0 import this fork starts from. It only costs setuptools warnings, so the change is cosmetic in effect. What it is not cosmetic about is trust: this is the file that decides what ships in the sdist, and one that names eight things that do not exist reads as nobody's business. After this every path it names is real. .coveragerc carries the same rot in its omit list, awx/lib/site-packages/*, so that goes in the same change. Checked by building from a copy of the tree: setuptools reports no missing path warnings afterwards.
pyproject already owns setuptools, setuptools_scm and ruff, so pytest.ini becomes [tool.pytest.ini_options] and the file goes. tox.ini and .yamllint stay, since neither reads pyproject. .coveragerc moves separately, so the two can be reviewed and reverted on their own. One value changed on the way, and it is the reason collection has been reporting 14 errors. pytest.ini set python_files to every .py, so collecting imported the whole repository looking for tests, including modules that parse argv at import time. One of them, tools/data_generators/rbac_dummy_data_ generator.py, calls sys.exit(2) from optparse, which takes the whole run down with an INTERNALERROR rather than reporting a failure. Nobody has seen it because CI collects named paths rather than the tree. Nothing needed that wider net. Not one file outside pytest's own patterns defines a test: the only two that look like they do are fixtures named test_* inside a conftest.py, which is never collected as a module anyway. So python_files is pytest's default now, and collecting the tree gives the same 4,020 tests with no errors, in 8 seconds instead of 26. before 4,020 tests collected, 14 errors, 26.1s after 4,020 tests collected, 0 errors, 8.5s Everything else is moved unchanged. All eight markers still register and the unit suite passes. README, CONTRIBUTING and the copilot instructions pointed readers at pytest.ini and now point at pyproject.toml.
blaipr
force-pushed
the
build/pytest-and-coverage-into-pyproject
branch
from
September 13, 2026 08:58
69f2cb3 to
3f74102
Compare
cigamit
approved these changes
Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sits on #958, which edits
.coveragerc; merge that first. The.coveragercmove is a separate pull request so the two can be reviewed, and reverted, on their own.pyproject.tomlalready owns[tool.setuptools],[tool.setuptools_scm]and[tool.ruff], sopytest.inibecomes[tool.pytest.ini_options]and the file goes.tox.iniand.yamllintstay, since neither readspyproject.toml.One value changed, and it fixes 14 collection errors
pytest.inisetpython_filesto every.py, so collecting imported the whole repository looking for tests. That includes modules which parse argv at import time, and one of them takes the run down rather than reporting:Nobody has seen it because CI collects named paths rather than the tree.
Nothing needed the wider net. I checked every
.pyin the repository: not one file outside pytest's own patterns defines a test. The only two that look like they do are fixtures namedtest_*inside aconftest.py, which pytest never collects as a module anyway. Sopython_filesis pytest's default now:Same tests, no errors, and collection is three times faster because pytest stops importing the codebase to look for them.
Checks
ac,survey,inventory_import,defined_in_file,job_permissions,activity_stream_access,job_runtime_vars,fixture_args).awx/main/tests/unit: passing.README.md,CONTRIBUTING.mdand.github/copilot-instructions.mdpointed readers atpytest.iniand now point atpyproject.toml.