Align pytest with score_tooling pin - #26
Conversation
…python to 1.5.0 for constraints support
| pip install -r requirements.txt.lock | ||
| # can't combine with the line above: pip blocks local installs under hash-checking | ||
| pip install -e . --no-deps |
There was a problem hiding this comment.
when bazel already resolved deps with score we should install only those so we mimic downstream repos env
There was a problem hiding this comment.
Dropped the second install — the job now installs only the lock.
| constraints = [ | ||
| "@score_tooling//python_basics:requirements.txt", | ||
| ], | ||
| data = glob(["testing_utils/**/*.py"]), # needed to build metadata from pyproject.toml |
There was a problem hiding this comment.
how is that building metadata from pyproject.toml by providing all python files?
There was a problem hiding this comment.
only needs the package directories to exist, narrowed to the two init.py markers
| constraints = [ | ||
| "@score_tooling//python_basics:requirements.txt", | ||
| ], |
There was a problem hiding this comment.
there is no such argument in documentation, why not src?
There was a problem hiding this comment.
Switched to srcs — constraints only exists from rules_python 1.5.0, not the 1.4.1 this module pins, so the rules_python bump is reverted too.
|
|
||
| [tool.pytest.ini_options] | ||
| pythonpath = ["."] | ||
| testpaths = ["tests"] |
There was a problem hiding this comment.
depreciated, use correct section
https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml
What this PR does
testing-utils's declaredpytest,pytest-html,pytest-repeat(plusruff,from
[project.optional-dependencies]) into a new flatrequirements.txt, unpinned.pyproject.toml's owndependenciesfield is untouched.compile_pip_requirements(BUILD) with explicitsrcs = ["requirements.txt", "@score_tooling//python_basics:requirements.txt"], merged aspeer inputs. A score_tooling bump is picked up by re-running
bazel run //:requirements.updatewith no edit anywhere in
testing_tools, since our side carries no version of its own to fallout of range.
requirements.txt.lock— a real, hash-pinned lock generated viabazel run //:requirements.update..github/workflows/fomat_and_test.yml: both thelintandtestjobs now installfrom the same hash-pinned lock (
lintpreviously ranpip install -e ".[dev]" || true—unpinned, errors silently swallowed). Neither job installs the package itself;
pyproject.toml's[tool.pytest]setspythonpath = ["."], so tests importtesting_utilswithout an install step.
Files
BUILDcompile_pip_requirements: explicitsrcs = ["requirements.txt", "@score_tooling//python_basics:requirements.txt"];extra_args = ["--no-annotate"](needed —bazel runvsbazel testembed different runfiles paths in annotations otherwise, breaking the freshness check);tags = ["manual"]requirements.txtpytest,pytest-html,pytest-repeat,ruffrequirements.txt.lockruffpyproject.toml[tool.pytest.ini_options]→[tool.pytest](pytest ≥9.0's native section);dependenciesunchanged.github/workflows/fomat_and_test.ymllintjob installs from the lock instead ofpip install -e ".[dev]" || true;testjob installs only the lock;bazel test //:requirements_testfreshness check addedVerification
bazel run //:requirements.updatereproducesrequirements.txt.lockbyte-for-byte from aclean checkout.
bazel test //:requirements_testpasses on the fresh lock and fails on a corrupted one.pytest==8.4.1installstesting-utilscleanly with noconflict (bare
requirements.txtimposes no floor of its own), and our own lock resolvespytest==9.0.1, matchingscore_tooling@1.1.2's exact pin.pip installrefuse withTHESE PACKAGES DO NOT MATCH THE HASHES....Known limitations
1.2.0and1.3.1,python_basics:requirements.txtwas renamed to aper-Python-version file. Bumping score_tooling in
testing_toolspast that boundary will makerequirements.updatefail to analyze — a hard, visible error, not silent drift — until thesrcslabel inBUILDis updated to match.