Align pytest with score_tooling pin - #99
Conversation
PiotrKorkus
left a comment
There was a problem hiding this comment.
you need to update pyproject.toml thats what is being resolved when we add testing_tools as pip dependency
| @@ -0,0 +1,3 @@ | |||
| pytest | |||
There was a problem hiding this comment.
pin the version, otherwise we might end up with failures if it resolves into newer version. This already happened in presistency
| ], | ||
| requirements_txt = "requirements.txt.lock", | ||
| tags = ["manual"], | ||
| ) |
There was a problem hiding this comment.
extra_args = [
"--no-annotate",
],
| # Locked Python test dependencies. requirements.txt.lock is compiled from | ||
| # requirements.txt merged with score_tooling's own pinned pytest version (see | ||
| # BUILD), so re-running `bazel run //:requirements.update` after bumping | ||
| # score_tooling above always picks up score_tooling's current pytest pin | ||
| # instead of drifting from it independently. |
| pip install -e . --no-deps | ||
| pip install -r requirements.txt.lock |
There was a problem hiding this comment.
have a single source of reqs to be installed
There was a problem hiding this comment.
still two separate installs
There was a problem hiding this comment.
can't combine into one — pip refuses a local install under hash-checking.
| python_version = PYTHON_VERSION, | ||
| requirements_lock = "//:requirements.txt.lock", | ||
| ) | ||
| use_repo(pip, "pip_score_venv_test") |
There was a problem hiding this comment.
you added python toolchain, where is it used?
There was a problem hiding this comment.
pip.parse hub was not consuming it removed.
1e605d5 to
9562510
Compare
…python to 1.5.0 for constraints support
e921230 to
9b53b87
Compare
What this PR does
compile_pip_requirements(BUILD) with a newrequirements.txt(
pytest==9.0.1,pytest-html==4.1.1,pytest-repeat==0.9.4), using@score_tooling//python_basics:requirements.txtas a constraint (not a peerrequirements source), so pytest resolves to whatever
score_toolingcurrently pins.requirements.txt.lock— a real, hash-pinned lock generated viabazel run //:requirements.update(not hand-written). Currently resolvespytest==9.0.1,matching
score_tooling@1.1.2's (the versiontesting_toolsitself declares) actual pin..github/workflows/fomat_and_test.yml's test job to install from the lock(
pip install -e . --no-deps && pip install -r requirements.txt.lock) instead of thepreviously unpinned
pip install -e ".[dev]" || true, and adds abazel test //:requirements.teststep so a stale lock fails CI loudly instead ofdrifting silently.
Files
BUILDcompile_pip_requirements;@score_tooling//python_basics:requirements.txtis passed asconstraints, notsrcsrequirements.txtpytest==9.0.1,pytest-html==4.1.1,pytest-repeat==0.9.4requirements.txt.lock.github/workflows/fomat_and_test.ymlpip install -e ".[dev]"; adds a lock-freshness check (bazel test //:requirements.test)pyproject.tomldependencieschanged from>=floors to exact pins matching the lockMODULE.bazelrules_pythonbumped1.4.1→1.5.0— needed forcompile_pip_requirements'sconstraintsparameter, added in 1.5.0Verification
bazel run //:requirements.updateruns clean and produces a valid lock (confirmedbasedpyright/nodejs-wheel-binariesare absent from the regenerated lock).bazel build //...andbazel test //:requirements.testboth pass after therules_pythonbump.score_toolingto1.2.0(pytest unchanged at 9.0.1, consistent) and to1.3.1(pytest 9.0.3 — the merge correctly picked up the new pin after re-running
requirements.update), confirming the mechanism does what it's meant to.Known limitations
score_tooling1.2.0 and 1.3.1 the exported file this PR merges in(
python_basics:requirements.txt) was renamed to a per-Python-version file(
requirements_3_12.txt). Bumpingscore_toolingintesting_toolspast that boundarywill make
bazel run //:requirements.updatefail to analyze (hard error, not silentdrift) until the
BUILDsrc is updated to match — noted inline inBUILD's comment.