Skip to content

Align pytest with score_tooling pin - #99

Draft
Subramanian-K812 wants to merge 10 commits into
mainfrom
Subramanian-K812_pytest_score_tooling_alignment
Draft

Align pytest with score_tooling pin#99
Subramanian-K812 wants to merge 10 commits into
mainfrom
Subramanian-K812_pytest_score_tooling_alignment

Conversation

@Subramanian-K812

@Subramanian-K812 Subramanian-K812 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

  • Adds compile_pip_requirements (BUILD) with a new requirements.txt
    (pytest==9.0.1, pytest-html==4.1.1, pytest-repeat==0.9.4), using
    @score_tooling//python_basics:requirements.txt as a constraint (not a peer
    requirements source), so pytest resolves to whatever score_tooling currently pins.
  • Adds requirements.txt.lock — a real, hash-pinned lock generated via
    bazel run //:requirements.update (not hand-written). Currently resolves pytest==9.0.1,
    matching score_tooling@1.1.2's (the version testing_tools itself declares) actual pin.
  • Updates .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 the
    previously unpinned pip install -e ".[dev]" || true, and adds a
    bazel test //:requirements.test step so a stale lock fails CI loudly instead of
    drifting silently.

Files

File Change
BUILD Added compile_pip_requirements; @score_tooling//python_basics:requirements.txt is passed as constraints, not srcs
requirements.txt Newpytest==9.0.1, pytest-html==4.1.1, pytest-repeat==0.9.4
requirements.txt.lock New — generated, hash-pinned lock
.github/workflows/fomat_and_test.yml Test job installs from the lock instead of an unpinned pip install -e ".[dev]"; adds a lock-freshness check (bazel test //:requirements.test)
pyproject.toml dependencies changed from >= floors to exact pins matching the lock
MODULE.bazel rules_python bumped 1.4.11.5.0 — needed for compile_pip_requirements's constraints parameter, added in 1.5.0

Verification

  • bazel run //:requirements.update runs clean and produces a valid lock (confirmed
    basedpyright/nodejs-wheel-binaries are absent from the regenerated lock).
  • bazel build //... and bazel test //:requirements.test both pass after the
    rules_python bump.
  • End-to-end alignment check (done in a throwaway copy, not part of this PR): bumped
    score_tooling to 1.2.0 (pytest unchanged at 9.0.1, consistent) and to 1.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

  • Between score_tooling 1.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). Bumping score_tooling in testing_tools past that boundary
    will make bazel run //:requirements.update fail to analyze (hard error, not silent
    drift) until the BUILD src is updated to match — noted inline in BUILD's comment.

@PiotrKorkus PiotrKorkus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to update pyproject.toml thats what is being resolved when we add testing_tools as pip dependency

Comment thread requirements.txt Outdated
@@ -0,0 +1,3 @@
pytest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pin the version, otherwise we might end up with failures if it resolves into newer version. This already happened in presistency

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread BUILD
],
requirements_txt = "requirements.txt.lock",
tags = ["manual"],
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    extra_args = [
        "--no-annotate",
    ],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread MODULE.bazel Outdated
Comment on lines +87 to +91
# 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduce ai comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread .github/workflows/fomat_and_test.yml Outdated
Comment on lines +65 to +66
pip install -e . --no-deps
pip install -r requirements.txt.lock

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have a single source of reqs to be installed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still two separate installs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't combine into one — pip refuses a local install under hash-checking.

Comment thread MODULE.bazel Outdated
python_version = PYTHON_VERSION,
requirements_lock = "//:requirements.txt.lock",
)
use_repo(pip, "pip_score_venv_test")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you added python toolchain, where is it used?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pip.parse hub was not consuming it removed.

@Subramanian-K812
Subramanian-K812 force-pushed the Subramanian-K812_pytest_score_tooling_alignment branch from 1e605d5 to 9562510 Compare July 28, 2026 14:11
@Subramanian-K812
Subramanian-K812 force-pushed the Subramanian-K812_pytest_score_tooling_alignment branch from e921230 to 9b53b87 Compare July 30, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants