From 1c81c6bff09aead36506e49f3bb9c2bb026e961c Mon Sep 17 00:00:00 2001 From: subramaniak Date: Mon, 27 Jul 2026 08:37:29 +0000 Subject: [PATCH 01/13] add hash-locked pip requirements merged with score_tooling's pytest pin --- .github/workflows/fomat_and_test.yml | 3 +- BUILD | 21 ++++ MODULE.bazel | 13 +++ requirements.txt | 3 + requirements.txt.lock | 163 +++++++++++++++++++++++++++ 5 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 requirements.txt create mode 100644 requirements.txt.lock diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index 58addf0..8f921c7 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -62,7 +62,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e ".[dev]" || true + pip install -e . --no-deps + pip install -r requirements.txt.lock - name: Run tests with pytest run: pytest tests -v diff --git a/BUILD b/BUILD index 26e73c3..9c489b1 100644 --- a/BUILD +++ b/BUILD @@ -10,9 +10,30 @@ # # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* +load("@rules_python//python:pip.bzl", "compile_pip_requirements") load("@score_tooling//:defs.bzl", "setup_starpls") setup_starpls( name = "starpls_server", visibility = ["//visibility:public"], ) + +# In order to update the requirements, change the `requirements.txt` file and run: +# `bazel run //:requirements.update`. +# This will update the `requirements.txt.lock` file. +# `@score_tooling//python_basics:requirements.txt` is merged in as a +# constraints source so pytest resolves to the same exact version pinned by +# score_tooling, instead of this repo's own floor (`pyproject.toml`) floating +# independently. Note: bumping score_tooling's version above may rename this +# exported file (it moved to per-Python-version files, e.g. +# `requirements_3_12.txt`, by score_tooling 1.3.x) — this src must be updated +# to match in the same change, or `requirements.update` fails to analyze. +compile_pip_requirements( + name = "requirements", + srcs = [ + "requirements.txt", + "@score_tooling//python_basics:requirements.txt", + ], + requirements_txt = "requirements.txt.lock", + tags = ["manual"], +) diff --git a/MODULE.bazel b/MODULE.bazel index 778be38..685a59c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -84,6 +84,19 @@ python.toolchain( ) use_repo(python) +# 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 = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True) +pip.parse( + hub_name = "pip_score_venv_test", + python_version = PYTHON_VERSION, + requirements_lock = "//:requirements.txt.lock", +) +use_repo(pip, "pip_score_venv_test") + # C++ GoogleTest dependencies. bazel_dep(name = "googletest", version = "1.17.0", dev_dependency = True) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..92a59c3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pytest +pytest-html +pytest-repeat diff --git a/requirements.txt.lock b/requirements.txt.lock new file mode 100644 index 0000000..a305a15 --- /dev/null +++ b/requirements.txt.lock @@ -0,0 +1,163 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# bazel run //:requirements.update +# +basedpyright==1.35.0 \ + --hash=sha256:2a7e0bd476623d48499e2b18ff6ed19dc28c51909cf9e1152ad355b5809049ad \ + --hash=sha256:4f4f84023df5a0cd4ee154916ba698596682ac98bacfa22c941ed6aaf07bba4e + # via -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt +iniconfig==2.3.0 \ + --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ + --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 + # via + # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt + # pytest +jinja2==3.1.6 \ + --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ + --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 + # via pytest-html +markupsafe==3.0.3 \ + --hash=sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f \ + --hash=sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a \ + --hash=sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf \ + --hash=sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19 \ + --hash=sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf \ + --hash=sha256:0f4b68347f8c5eab4a13419215bdfd7f8c9b19f2b25520968adfad23eb0ce60c \ + --hash=sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175 \ + --hash=sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219 \ + --hash=sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb \ + --hash=sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6 \ + --hash=sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab \ + --hash=sha256:15d939a21d546304880945ca1ecb8a039db6b4dc49b2c5a400387cdae6a62e26 \ + --hash=sha256:177b5253b2834fe3678cb4a5f0059808258584c559193998be2601324fdeafb1 \ + --hash=sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce \ + --hash=sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218 \ + --hash=sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634 \ + --hash=sha256:1ba88449deb3de88bd40044603fafffb7bc2b055d626a330323a9ed736661695 \ + --hash=sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad \ + --hash=sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73 \ + --hash=sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c \ + --hash=sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe \ + --hash=sha256:2a15a08b17dd94c53a1da0438822d70ebcd13f8c3a95abe3a9ef9f11a94830aa \ + --hash=sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559 \ + --hash=sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa \ + --hash=sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37 \ + --hash=sha256:3537e01efc9d4dccdf77221fb1cb3b8e1a38d5428920e0657ce299b20324d758 \ + --hash=sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f \ + --hash=sha256:38664109c14ffc9e7437e86b4dceb442b0096dfe3541d7864d9cbe1da4cf36c8 \ + --hash=sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d \ + --hash=sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c \ + --hash=sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97 \ + --hash=sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a \ + --hash=sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19 \ + --hash=sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9 \ + --hash=sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9 \ + --hash=sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc \ + --hash=sha256:591ae9f2a647529ca990bc681daebdd52c8791ff06c2bfa05b65163e28102ef2 \ + --hash=sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4 \ + --hash=sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354 \ + --hash=sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50 \ + --hash=sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698 \ + --hash=sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9 \ + --hash=sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b \ + --hash=sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc \ + --hash=sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115 \ + --hash=sha256:7c3fb7d25180895632e5d3148dbdc29ea38ccb7fd210aa27acbd1201a1902c6e \ + --hash=sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485 \ + --hash=sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f \ + --hash=sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12 \ + --hash=sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025 \ + --hash=sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009 \ + --hash=sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d \ + --hash=sha256:949b8d66bc381ee8b007cd945914c721d9aba8e27f71959d750a46f7c282b20b \ + --hash=sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a \ + --hash=sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5 \ + --hash=sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f \ + --hash=sha256:a320721ab5a1aba0a233739394eb907f8c8da5c98c9181d1161e77a0c8e36f2d \ + --hash=sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1 \ + --hash=sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287 \ + --hash=sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6 \ + --hash=sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f \ + --hash=sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581 \ + --hash=sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed \ + --hash=sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b \ + --hash=sha256:c0c0b3ade1c0b13b936d7970b1d37a57acde9199dc2aecc4c336773e1d86049c \ + --hash=sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026 \ + --hash=sha256:c4ffb7ebf07cfe8931028e3e4c85f0357459a3f9f9490886198848f4fa002ec8 \ + --hash=sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676 \ + --hash=sha256:d2ee202e79d8ed691ceebae8e0486bd9a2cd4794cec4824e1c99b6f5009502f6 \ + --hash=sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e \ + --hash=sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d \ + --hash=sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d \ + --hash=sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01 \ + --hash=sha256:df2449253ef108a379b8b5d6b43f4b1a8e81a061d6537becd5582fba5f9196d7 \ + --hash=sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419 \ + --hash=sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795 \ + --hash=sha256:e2103a929dfa2fcaf9bb4e7c091983a49c9ac3b19c9061b6d5427dd7d14d81a1 \ + --hash=sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5 \ + --hash=sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d \ + --hash=sha256:e8fc20152abba6b83724d7ff268c249fa196d8259ff481f3b1476383f8f24e42 \ + --hash=sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe \ + --hash=sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda \ + --hash=sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e \ + --hash=sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737 \ + --hash=sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523 \ + --hash=sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591 \ + --hash=sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc \ + --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a \ + --hash=sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50 + # via jinja2 +nodejs-wheel-binaries==24.11.1 \ + --hash=sha256:0e14874c3579def458245cdbc3239e37610702b0aa0975c1dc55e2cb80e42102 \ + --hash=sha256:10197b1c9c04d79403501766f76508b0dac101ab34371ef8a46fcf51773497d0 \ + --hash=sha256:376b9ea1c4bc1207878975dfeb604f7aa5668c260c6154dcd2af9d42f7734116 \ + --hash=sha256:413dfffeadfb91edb4d8256545dea797c237bba9b3faefea973cde92d96bb922 \ + --hash=sha256:5ef598101b0fb1c2bf643abb76dfbf6f76f1686198ed17ae46009049ee83c546 \ + --hash=sha256:78bc5bb889313b565df8969bb7423849a9c7fc218bf735ff0ce176b56b3e96f0 \ + --hash=sha256:c2741525c9874b69b3e5a6d6c9179a6fe484ea0c3d5e7b7c01121c8e5d78b7e2 \ + --hash=sha256:c79a7e43869ccecab1cae8183778249cceb14ca2de67b5650b223385682c6239 \ + --hash=sha256:cde41d5e4705266688a8d8071debf4f8a6fcea264c61292782672ee75a6905f9 + # via + # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt + # basedpyright +packaging==25.0 \ + --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ + --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f + # via + # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt + # pytest +pluggy==1.6.0 \ + --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ + --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 + # via + # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt + # pytest +pygments==2.19.2 \ + --hash=sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887 \ + --hash=sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b + # via + # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt + # pytest +pytest==9.0.1 \ + --hash=sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8 \ + --hash=sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad + # via + # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt + # -r requirements.txt + # pytest-html + # pytest-metadata + # pytest-repeat +pytest-html==4.2.0 \ + --hash=sha256:b6a88cba507500d8709959201e2e757d3941e859fd17cfd4ed87b16fc0c67912 \ + --hash=sha256:ff5caf3e17a974008e5816edda61168e6c3da442b078a44f8744865862a85636 + # via -r requirements.txt +pytest-metadata==3.1.1 \ + --hash=sha256:c8e0844db684ee1c798cfa38908d20d67d0463ecb6137c72e91f418558dd5f4b \ + --hash=sha256:d2a29b0355fbc03f168aa96d41ff88b1a3b44a3b02acbe491801c98a048017c8 + # via pytest-html +pytest-repeat==0.9.4 \ + --hash=sha256:c1738b4e412a6f3b3b9e0b8b29fcd7a423e50f87381ad9307ef6f5a8601139f3 \ + --hash=sha256:d92ac14dfaa6ffcfe6917e5d16f0c9bc82380c135b03c2a5f412d2637f224485 + # via -r requirements.txt From 956251000f457617d9b9484d1ec25ed4d652146d Mon Sep 17 00:00:00 2001 From: subramaniak Date: Tue, 28 Jul 2026 14:08:33 +0000 Subject: [PATCH 02/13] drop unused pip.parse hub, --no-annotate, enforce requirements_test in CI --- .github/workflows/fomat_and_test.yml | 3 +++ BUILD | 14 ++++-------- MODULE.bazel | 13 ----------- pyproject.toml | 2 +- requirements.txt | 6 ++--- requirements.txt.lock | 33 +++------------------------- 6 files changed, 14 insertions(+), 57 deletions(-) diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index 8f921c7..c63fbe0 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -47,6 +47,9 @@ jobs: with: bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 + - name: Check pip lock is up to date with score_tooling + run: bazel test //:requirements_test + - name: Install Rust (Cargo) uses: actions-rs/toolchain@v1 with: diff --git a/BUILD b/BUILD index 9c489b1..a6bda84 100644 --- a/BUILD +++ b/BUILD @@ -18,22 +18,16 @@ setup_starpls( visibility = ["//visibility:public"], ) -# In order to update the requirements, change the `requirements.txt` file and run: -# `bazel run //:requirements.update`. -# This will update the `requirements.txt.lock` file. -# `@score_tooling//python_basics:requirements.txt` is merged in as a -# constraints source so pytest resolves to the same exact version pinned by -# score_tooling, instead of this repo's own floor (`pyproject.toml`) floating -# independently. Note: bumping score_tooling's version above may rename this -# exported file (it moved to per-Python-version files, e.g. -# `requirements_3_12.txt`, by score_tooling 1.3.x) — this src must be updated -# to match in the same change, or `requirements.update` fails to analyze. +# To update: bazel run //:requirements.update compile_pip_requirements( name = "requirements", srcs = [ "requirements.txt", "@score_tooling//python_basics:requirements.txt", ], + extra_args = [ + "--no-annotate", + ], requirements_txt = "requirements.txt.lock", tags = ["manual"], ) diff --git a/MODULE.bazel b/MODULE.bazel index 685a59c..778be38 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -84,19 +84,6 @@ python.toolchain( ) use_repo(python) -# 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 = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True) -pip.parse( - hub_name = "pip_score_venv_test", - python_version = PYTHON_VERSION, - requirements_lock = "//:requirements.txt.lock", -) -use_repo(pip, "pip_score_venv_test") - # C++ GoogleTest dependencies. bazel_dep(name = "googletest", version = "1.17.0", dev_dependency = True) diff --git a/pyproject.toml b/pyproject.toml index 94f5557..3bdd870 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "testing-utils" version = "0.3.2" -dependencies = ["pytest>=8.3.5", "pytest-html>=4.1.1", "pytest-repeat>=0.9.4"] +dependencies = ["pytest==9.0.1", "pytest-html==4.1.1", "pytest-repeat==0.9.4"] requires-python = ">=3.12" authors = [ { name = "Igor Ostrowski", email = "igor.ostrowski.ext@qorix.ai" }, diff --git a/requirements.txt b/requirements.txt index 92a59c3..6ce4700 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pytest -pytest-html -pytest-repeat +pytest==9.0.1 +pytest-html==4.1.1 +pytest-repeat==0.9.4 diff --git a/requirements.txt.lock b/requirements.txt.lock index a305a15..0b87cc9 100644 --- a/requirements.txt.lock +++ b/requirements.txt.lock @@ -7,17 +7,12 @@ basedpyright==1.35.0 \ --hash=sha256:2a7e0bd476623d48499e2b18ff6ed19dc28c51909cf9e1152ad355b5809049ad \ --hash=sha256:4f4f84023df5a0cd4ee154916ba698596682ac98bacfa22c941ed6aaf07bba4e - # via -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt iniconfig==2.3.0 \ --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 - # via - # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt - # pytest jinja2==3.1.6 \ --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 - # via pytest-html markupsafe==3.0.3 \ --hash=sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f \ --hash=sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a \ @@ -108,7 +103,6 @@ markupsafe==3.0.3 \ --hash=sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc \ --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a \ --hash=sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50 - # via jinja2 nodejs-wheel-binaries==24.11.1 \ --hash=sha256:0e14874c3579def458245cdbc3239e37610702b0aa0975c1dc55e2cb80e42102 \ --hash=sha256:10197b1c9c04d79403501766f76508b0dac101ab34371ef8a46fcf51773497d0 \ @@ -119,45 +113,24 @@ nodejs-wheel-binaries==24.11.1 \ --hash=sha256:c2741525c9874b69b3e5a6d6c9179a6fe484ea0c3d5e7b7c01121c8e5d78b7e2 \ --hash=sha256:c79a7e43869ccecab1cae8183778249cceb14ca2de67b5650b223385682c6239 \ --hash=sha256:cde41d5e4705266688a8d8071debf4f8a6fcea264c61292782672ee75a6905f9 - # via - # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt - # basedpyright packaging==25.0 \ --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f - # via - # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt - # pytest pluggy==1.6.0 \ --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 - # via - # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt - # pytest pygments==2.19.2 \ --hash=sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887 \ --hash=sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b - # via - # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt - # pytest pytest==9.0.1 \ --hash=sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8 \ --hash=sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad - # via - # -r /var/cache/bazel/116bc44c26dbf40db61235b2a625e9ed/external/score_tooling+/python_basics/requirements.txt - # -r requirements.txt - # pytest-html - # pytest-metadata - # pytest-repeat -pytest-html==4.2.0 \ - --hash=sha256:b6a88cba507500d8709959201e2e757d3941e859fd17cfd4ed87b16fc0c67912 \ - --hash=sha256:ff5caf3e17a974008e5816edda61168e6c3da442b078a44f8744865862a85636 - # via -r requirements.txt +pytest-html==4.1.1 \ + --hash=sha256:70a01e8ae5800f4a074b56a4cb1025c8f4f9b038bba5fe31e3c98eb996686f07 \ + --hash=sha256:c8152cea03bd4e9bee6d525573b67bbc6622967b72b9628dda0ea3e2a0b5dd71 pytest-metadata==3.1.1 \ --hash=sha256:c8e0844db684ee1c798cfa38908d20d67d0463ecb6137c72e91f418558dd5f4b \ --hash=sha256:d2a29b0355fbc03f168aa96d41ff88b1a3b44a3b02acbe491801c98a048017c8 - # via pytest-html pytest-repeat==0.9.4 \ --hash=sha256:c1738b4e412a6f3b3b9e0b8b29fcd7a423e50f87381ad9307ef6f5a8601139f3 \ --hash=sha256:d92ac14dfaa6ffcfe6917e5d16f0c9bc82380c135b03c2a5f412d2637f224485 - # via -r requirements.txt From 295cd7a2c45ddfb7c775e1b9ba9a9d49e63d712c Mon Sep 17 00:00:00 2001 From: subramaniak Date: Wed, 29 Jul 2026 06:41:33 +0000 Subject: [PATCH 03/13] scope score_tooling merge to constraints instead of srcs, bump rules_python to 1.5.0 for constraints support --- .github/workflows/fomat_and_test.yml | 2 +- BUILD | 2 ++ MODULE.bazel | 2 +- requirements.txt.lock | 13 ------------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index c63fbe0..0e816b6 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -48,7 +48,7 @@ jobs: bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 - name: Check pip lock is up to date with score_tooling - run: bazel test //:requirements_test + run: bazel test //:requirements.test - name: Install Rust (Cargo) uses: actions-rs/toolchain@v1 diff --git a/BUILD b/BUILD index a6bda84..86afa53 100644 --- a/BUILD +++ b/BUILD @@ -23,6 +23,8 @@ compile_pip_requirements( name = "requirements", srcs = [ "requirements.txt", + ], + constraints = [ "@score_tooling//python_basics:requirements.txt", ], extra_args = [ diff --git a/MODULE.bazel b/MODULE.bazel index 778be38..be98692 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,7 +17,7 @@ module( ) # Bazel global rules -bazel_dep(name = "rules_python", version = "1.4.1") +bazel_dep(name = "rules_python", version = "1.5.0") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_cc", version = "0.1.1") bazel_dep(name = "aspect_rules_lint", version = "1.0.3") diff --git a/requirements.txt.lock b/requirements.txt.lock index 0b87cc9..b286f52 100644 --- a/requirements.txt.lock +++ b/requirements.txt.lock @@ -4,9 +4,6 @@ # # bazel run //:requirements.update # -basedpyright==1.35.0 \ - --hash=sha256:2a7e0bd476623d48499e2b18ff6ed19dc28c51909cf9e1152ad355b5809049ad \ - --hash=sha256:4f4f84023df5a0cd4ee154916ba698596682ac98bacfa22c941ed6aaf07bba4e iniconfig==2.3.0 \ --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 @@ -103,16 +100,6 @@ markupsafe==3.0.3 \ --hash=sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc \ --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a \ --hash=sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50 -nodejs-wheel-binaries==24.11.1 \ - --hash=sha256:0e14874c3579def458245cdbc3239e37610702b0aa0975c1dc55e2cb80e42102 \ - --hash=sha256:10197b1c9c04d79403501766f76508b0dac101ab34371ef8a46fcf51773497d0 \ - --hash=sha256:376b9ea1c4bc1207878975dfeb604f7aa5668c260c6154dcd2af9d42f7734116 \ - --hash=sha256:413dfffeadfb91edb4d8256545dea797c237bba9b3faefea973cde92d96bb922 \ - --hash=sha256:5ef598101b0fb1c2bf643abb76dfbf6f76f1686198ed17ae46009049ee83c546 \ - --hash=sha256:78bc5bb889313b565df8969bb7423849a9c7fc218bf735ff0ce176b56b3e96f0 \ - --hash=sha256:c2741525c9874b69b3e5a6d6c9179a6fe484ea0c3d5e7b7c01121c8e5d78b7e2 \ - --hash=sha256:c79a7e43869ccecab1cae8183778249cceb14ca2de67b5650b223385682c6239 \ - --hash=sha256:cde41d5e4705266688a8d8071debf4f8a6fcea264c61292782672ee75a6905f9 packaging==25.0 \ --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f From 9b53b87451e52b00aa7082aa6e41ba2a1dc22aae Mon Sep 17 00:00:00 2001 From: subramaniak Date: Thu, 30 Jul 2026 10:06:37 +0000 Subject: [PATCH 04/13] single pip install via pytest pythonpath --- .github/workflows/fomat_and_test.yml | 1 - pyproject.toml | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index 0e816b6..f5b577a 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -65,7 +65,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e . --no-deps pip install -r requirements.txt.lock - name: Run tests with pytest diff --git a/pyproject.toml b/pyproject.toml index 3bdd870..673dd65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,9 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["testing_utils", "testing_utils.net"] +[tool.pytest.ini_options] +pythonpath = ["."] + [project.optional-dependencies] dev = ["ruff"] From c78919e4dd079fc494754cc429974a4712ad801b Mon Sep 17 00:00:00 2001 From: subramaniak Date: Sat, 1 Aug 2026 04:35:17 +0000 Subject: [PATCH 05/13] fix: resolve pip deps from pyproject.toml --- .github/workflows/fomat_and_test.yml | 6 +++++- BUILD | 13 ++++++++++--- pyproject.toml | 5 +---- requirements.txt | 3 --- requirements.txt.lock | 19 +++++++++++++++++++ 5 files changed, 35 insertions(+), 11 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index f5b577a..6059f77 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e ".[dev]" || true + pip install -r requirements.txt.lock - name: Check formatting with Ruff run: ruff check . --exclude scripts/internal @@ -65,7 +65,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + # requirements.txt.lock is the only source of dependencies; the second + # command installs the package under test itself and adds none + # (pip refuses an editable requirement while hash-checking). pip install -r requirements.txt.lock + pip install -e . --no-deps - name: Run tests with pytest run: pytest tests -v diff --git a/BUILD b/BUILD index 86afa53..abfbb64 100644 --- a/BUILD +++ b/BUILD @@ -18,17 +18,24 @@ setup_starpls( visibility = ["//visibility:public"], ) +# Resolves [project.dependencies] from pyproject.toml (the default src) against +# score_tooling's pins as constraints, so a score_tooling bump is picked up by +# re-running the update -- no version edit here. # To update: bazel run //:requirements.update compile_pip_requirements( name = "requirements", - srcs = [ - "requirements.txt", - ], constraints = [ "@score_tooling//python_basics:requirements.txt", ], + # pip-compile builds this package's metadata to read [project.dependencies], + # so the setuptools backend needs the `readme` file and the packages listed + # in [tool.setuptools] to be present in the sandbox. + data = ["README.md"] + glob(["testing_utils/**/*.py"]), extra_args = [ "--no-annotate", + # include [project.optional-dependencies].dev (ruff) so the lint and + # test jobs install from this one lock + "--extra=dev", ], requirements_txt = "requirements.txt.lock", tags = ["manual"], diff --git a/pyproject.toml b/pyproject.toml index 673dd65..f2437c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "testing-utils" version = "0.3.2" -dependencies = ["pytest==9.0.1", "pytest-html==4.1.1", "pytest-repeat==0.9.4"] +dependencies = ["pytest~=9.0.1", "pytest-html~=4.1.1", "pytest-repeat~=0.9.4"] requires-python = ">=3.12" authors = [ { name = "Igor Ostrowski", email = "igor.ostrowski.ext@qorix.ai" }, @@ -18,9 +18,6 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = ["testing_utils", "testing_utils.net"] -[tool.pytest.ini_options] -pythonpath = ["."] - [project.optional-dependencies] dev = ["ruff"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6ce4700..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest==9.0.1 -pytest-html==4.1.1 -pytest-repeat==0.9.4 diff --git a/requirements.txt.lock b/requirements.txt.lock index b286f52..9df762a 100644 --- a/requirements.txt.lock +++ b/requirements.txt.lock @@ -121,3 +121,22 @@ pytest-metadata==3.1.1 \ pytest-repeat==0.9.4 \ --hash=sha256:c1738b4e412a6f3b3b9e0b8b29fcd7a423e50f87381ad9307ef6f5a8601139f3 \ --hash=sha256:d92ac14dfaa6ffcfe6917e5d16f0c9bc82380c135b03c2a5f412d2637f224485 +ruff==0.16.1 \ + --hash=sha256:07bf434b1c95f4e093be4532068ef4fcf00924eb2ade8796075980902d6fd54a \ + --hash=sha256:09b05e8b90c2cb06ad63464350e7a45e8e44a2dfe52072ebfba6666ca8d3f596 \ + --hash=sha256:24e9c631573cbca9d20f1283f8f479b2afa4a8503504822bd71a293889f16743 \ + --hash=sha256:26e9ca5c9bc3971f20d3cf18a957f52ffd6a5f6564ff15c4912a144dcac22494 \ + --hash=sha256:30affbcedf59ad5703d9c91f82266e02b47739f797e1a7b6e158e5526a6dae38 \ + --hash=sha256:39897739f112253ee4fdd2e8aa9a4f9ded99fb2be367d5f31dfa4ded6025584c \ + --hash=sha256:4d5f2ed10f8242d83fc08d521301089364e3375375705356f20c0e31606ef3ef \ + --hash=sha256:58edb313b88f0c5460a26adf5f39a37a3be789494a15e3e411e35fa78b89f9a0 \ + --hash=sha256:67e1e1e3fa4f0c82f0e36d4cd61e661f6e7a6196cb1aa92fe0828fa7b8f257cd \ + --hash=sha256:82ae3c0c0d74daf17b968a10b7b3bb3ef297ab7de0c1f749646b25e690ccb150 \ + --hash=sha256:a4665b309891f83f3e3c25447935f1213e9abbd4b5640af7a1f2def9f8d413c1 \ + --hash=sha256:b0d1e1393b7648079e13669de1c1f4fde06d4583e84d8fd5c1551e0a77a2aa75 \ + --hash=sha256:b41bdd48fb420987a9b5212e4957c26ad4abce401fa9ea9d4d85843727945f4f \ + --hash=sha256:d31765e131295b8445caf301e3e8a85b34d1b9b211b4109b7ba457888b051806 \ + --hash=sha256:dbaadaac38c70239f056d306b7476f246b0bf000fa6b3876402acbf5b227eaf8 \ + --hash=sha256:e0d4c20532fca4f7fa609369161d968dd28f65d83dabbd61d8e9c7edbf7001f6 \ + --hash=sha256:fde5a99e2f97479af66edd6622c6d5a2a7592c77cf4153d9e4428f5eeb55b60c \ + --hash=sha256:fedad7c801dabd3fb9741d76aca39246e6ddd9ca446a015875207bf19f1e6bc7 From 3977f26e5a8a0a0bd6c8f17b0a22b32e8173dcf0 Mon Sep 17 00:00:00 2001 From: subramaniak Date: Sat, 1 Aug 2026 05:06:44 +0000 Subject: [PATCH 06/13] fix: drop README from requirements data, add moderate timeout --- BUILD | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/BUILD b/BUILD index abfbb64..9ee50ca 100644 --- a/BUILD +++ b/BUILD @@ -27,10 +27,12 @@ compile_pip_requirements( constraints = [ "@score_tooling//python_basics:requirements.txt", ], - # pip-compile builds this package's metadata to read [project.dependencies], - # so the setuptools backend needs the `readme` file and the packages listed - # in [tool.setuptools] to be present in the sandbox. - data = ["README.md"] + glob(["testing_utils/**/*.py"]), + # pip-compile builds this package's metadata to read [project.dependencies]; + # the setuptools backend needs the packages listed in [tool.setuptools] to + # be present in the sandbox to do that (verified: the readme file is not + # actually required for metadata-only resolution, despite being a required + # key in [project] -- only building an actual sdist/wheel would need it). + data = glob(["testing_utils/**/*.py"]), extra_args = [ "--no-annotate", # include [project.optional-dependencies].dev (ruff) so the lint and @@ -39,4 +41,8 @@ compile_pip_requirements( ], requirements_txt = "requirements.txt.lock", tags = ["manual"], + # building this package's metadata from pyproject.toml adds real time on + # top of dependency resolution; the rule's default "short" (60s) timeout + # has been observed to trip under load. + timeout = "moderate", ) From 7946add43931d9eb38f6a8aec9ed6773e3db4c1a Mon Sep 17 00:00:00 2001 From: subramaniak Date: Mon, 3 Aug 2026 02:17:28 +0000 Subject: [PATCH 07/13] update requirements comments --- .github/workflows/fomat_and_test.yml | 4 +--- BUILD | 19 +++---------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index 6059f77..48cd267 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -65,10 +65,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - # requirements.txt.lock is the only source of dependencies; the second - # command installs the package under test itself and adds none - # (pip refuses an editable requirement while hash-checking). 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 - name: Run tests with pytest diff --git a/BUILD b/BUILD index 9ee50ca..44700e7 100644 --- a/BUILD +++ b/BUILD @@ -18,31 +18,18 @@ setup_starpls( visibility = ["//visibility:public"], ) -# Resolves [project.dependencies] from pyproject.toml (the default src) against -# score_tooling's pins as constraints, so a score_tooling bump is picked up by -# re-running the update -- no version edit here. # To update: bazel run //:requirements.update compile_pip_requirements( name = "requirements", constraints = [ "@score_tooling//python_basics:requirements.txt", ], - # pip-compile builds this package's metadata to read [project.dependencies]; - # the setuptools backend needs the packages listed in [tool.setuptools] to - # be present in the sandbox to do that (verified: the readme file is not - # actually required for metadata-only resolution, despite being a required - # key in [project] -- only building an actual sdist/wheel would need it). - data = glob(["testing_utils/**/*.py"]), + data = glob(["testing_utils/**/*.py"]), # needed to build metadata from pyproject.toml extra_args = [ "--no-annotate", - # include [project.optional-dependencies].dev (ruff) so the lint and - # test jobs install from this one lock - "--extra=dev", + "--extra=dev", # so ruff resolves from this lock too ], requirements_txt = "requirements.txt.lock", tags = ["manual"], - # building this package's metadata from pyproject.toml adds real time on - # top of dependency resolution; the rule's default "short" (60s) timeout - # has been observed to trip under load. - timeout = "moderate", + timeout = "moderate", # metadata build exceeds the rule's default "short" ) From 6a0070c2016dd69bfc6eb9e53665ff01cbe678d3 Mon Sep 17 00:00:00 2001 From: subramaniak Date: Mon, 3 Aug 2026 09:37:43 +0000 Subject: [PATCH 08/13] resolve score_tooling pins via srcs --- .github/workflows/fomat_and_test.yml | 6 +++--- BUILD | 31 +++++++++++++++++++++++++--- MODULE.bazel | 2 +- pyproject.toml | 7 +++++++ requirements.txt.lock | 13 ++++++++++++ 5 files changed, 52 insertions(+), 7 deletions(-) diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index 48cd267..89c27c6 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -47,8 +47,10 @@ jobs: with: bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 + # `requirements_test`, not `requirements.test`: rules_python only renamed the + # target in 1.5.0, and this module tracks score_tooling's 1.4.1. - name: Check pip lock is up to date with score_tooling - run: bazel test //:requirements.test + run: bazel test //:requirements_test - name: Install Rust (Cargo) uses: actions-rs/toolchain@v1 @@ -66,8 +68,6 @@ jobs: run: | python -m pip install --upgrade pip 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 - name: Run tests with pytest run: pytest tests -v diff --git a/BUILD b/BUILD index 44700e7..c508441 100644 --- a/BUILD +++ b/BUILD @@ -19,17 +19,42 @@ setup_starpls( ) # To update: bazel run //:requirements.update +# +# Resolved the same way every downstream S-CORE module resolves it (see +# score_persistency //tests/test_cases:requirements): this module's own +# dependencies and score_tooling's pins are peer `srcs`, so score_tooling's +# pytest pin is what lands in the lock. `pyproject.toml` is the src rather than +# a separate requirements.in so the dependency list has a single source of +# truth -- the same metadata downstream consumers resolve against. compile_pip_requirements( name = "requirements", - constraints = [ + timeout = "moderate", # that metadata build exceeds the rule's default "short" (60s) + srcs = [ + "pyproject.toml", "@score_tooling//python_basics:requirements.txt", ], - data = glob(["testing_utils/**/*.py"]), # needed to build metadata from pyproject.toml + # rules_python pins pip-tools 7.4.1, which has no static-metadata path: it + # always runs setuptools' PEP 517 `get_requires_for_build_wheel`. That reads + # `[tool.setuptools] packages` and aborts with + # error: package directory 'testing_utils' does not exist + # unless those directories exist in the runfiles tree. Only the package + # markers are needed, not the sources -- listing them explicitly instead of + # globbing `testing_utils/**/*.py` keeps `requirements_test` from re-running a + # network resolve on every unrelated source edit. Verified: the resolved lock + # is identical either way. + data = [ + "testing_utils/__init__.py", + "testing_utils/net/__init__.py", + ], extra_args = [ + # A `srcs` entry from another module resolves to an absolute path, and + # pip-compile writes it into the `# via -r ...` annotations -- score_persistency's + # committed lock carries one developer's `/home//.cache/bazel/...` path for + # exactly this reason. That makes the lock machine-specific, so `requirements_test` + # below could never pass anywhere else. Dropping annotations keeps it reproducible. "--no-annotate", "--extra=dev", # so ruff resolves from this lock too ], requirements_txt = "requirements.txt.lock", tags = ["manual"], - timeout = "moderate", # metadata build exceeds the rule's default "short" ) diff --git a/MODULE.bazel b/MODULE.bazel index be98692..778be38 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,7 +17,7 @@ module( ) # Bazel global rules -bazel_dep(name = "rules_python", version = "1.5.0") +bazel_dep(name = "rules_python", version = "1.4.1") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_cc", version = "0.1.1") bazel_dep(name = "aspect_rules_lint", version = "1.0.3") diff --git a/pyproject.toml b/pyproject.toml index f2437c1..77363d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,13 @@ packages = ["testing_utils", "testing_utils.net"] [project.optional-dependencies] dev = ["ruff"] +[tool.pytest.ini_options] +# Import testing_utils from the source tree, so this repo's own test run needs +# nothing installed beyond the resolved lock -- no separate install of this +# package on top of it. +pythonpath = ["."] +testpaths = ["tests"] + [tool.ruff] # Exclude a variety of commonly ignored directories. exclude = [ diff --git a/requirements.txt.lock b/requirements.txt.lock index 9df762a..169cf6a 100644 --- a/requirements.txt.lock +++ b/requirements.txt.lock @@ -4,6 +4,9 @@ # # bazel run //:requirements.update # +basedpyright==1.35.0 \ + --hash=sha256:2a7e0bd476623d48499e2b18ff6ed19dc28c51909cf9e1152ad355b5809049ad \ + --hash=sha256:4f4f84023df5a0cd4ee154916ba698596682ac98bacfa22c941ed6aaf07bba4e iniconfig==2.3.0 \ --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 @@ -100,6 +103,16 @@ markupsafe==3.0.3 \ --hash=sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc \ --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a \ --hash=sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50 +nodejs-wheel-binaries==24.11.1 \ + --hash=sha256:0e14874c3579def458245cdbc3239e37610702b0aa0975c1dc55e2cb80e42102 \ + --hash=sha256:10197b1c9c04d79403501766f76508b0dac101ab34371ef8a46fcf51773497d0 \ + --hash=sha256:376b9ea1c4bc1207878975dfeb604f7aa5668c260c6154dcd2af9d42f7734116 \ + --hash=sha256:413dfffeadfb91edb4d8256545dea797c237bba9b3faefea973cde92d96bb922 \ + --hash=sha256:5ef598101b0fb1c2bf643abb76dfbf6f76f1686198ed17ae46009049ee83c546 \ + --hash=sha256:78bc5bb889313b565df8969bb7423849a9c7fc218bf735ff0ce176b56b3e96f0 \ + --hash=sha256:c2741525c9874b69b3e5a6d6c9179a6fe484ea0c3d5e7b7c01121c8e5d78b7e2 \ + --hash=sha256:c79a7e43869ccecab1cae8183778249cceb14ca2de67b5650b223385682c6239 \ + --hash=sha256:cde41d5e4705266688a8d8071debf4f8a6fcea264c61292782672ee75a6905f9 packaging==25.0 \ --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f From dd9191a92ad371ec4bc16818aa8321b30a928d8e Mon Sep 17 00:00:00 2001 From: subramaniak Date: Mon, 3 Aug 2026 10:02:59 +0000 Subject: [PATCH 09/13] remove comments from requirements setup --- .github/workflows/fomat_and_test.yml | 2 -- BUILD | 23 +---------------------- pyproject.toml | 3 --- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/.github/workflows/fomat_and_test.yml b/.github/workflows/fomat_and_test.yml index 89c27c6..8bf56af 100644 --- a/.github/workflows/fomat_and_test.yml +++ b/.github/workflows/fomat_and_test.yml @@ -47,8 +47,6 @@ jobs: with: bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 - # `requirements_test`, not `requirements.test`: rules_python only renamed the - # target in 1.5.0, and this module tracks score_tooling's 1.4.1. - name: Check pip lock is up to date with score_tooling run: bazel test //:requirements_test diff --git a/BUILD b/BUILD index c508441..e2642bc 100644 --- a/BUILD +++ b/BUILD @@ -19,39 +19,18 @@ setup_starpls( ) # To update: bazel run //:requirements.update -# -# Resolved the same way every downstream S-CORE module resolves it (see -# score_persistency //tests/test_cases:requirements): this module's own -# dependencies and score_tooling's pins are peer `srcs`, so score_tooling's -# pytest pin is what lands in the lock. `pyproject.toml` is the src rather than -# a separate requirements.in so the dependency list has a single source of -# truth -- the same metadata downstream consumers resolve against. compile_pip_requirements( name = "requirements", - timeout = "moderate", # that metadata build exceeds the rule's default "short" (60s) + timeout = "moderate", # metadata build exceeds the rule's default "short" srcs = [ "pyproject.toml", "@score_tooling//python_basics:requirements.txt", ], - # rules_python pins pip-tools 7.4.1, which has no static-metadata path: it - # always runs setuptools' PEP 517 `get_requires_for_build_wheel`. That reads - # `[tool.setuptools] packages` and aborts with - # error: package directory 'testing_utils' does not exist - # unless those directories exist in the runfiles tree. Only the package - # markers are needed, not the sources -- listing them explicitly instead of - # globbing `testing_utils/**/*.py` keeps `requirements_test` from re-running a - # network resolve on every unrelated source edit. Verified: the resolved lock - # is identical either way. data = [ "testing_utils/__init__.py", "testing_utils/net/__init__.py", ], extra_args = [ - # A `srcs` entry from another module resolves to an absolute path, and - # pip-compile writes it into the `# via -r ...` annotations -- score_persistency's - # committed lock carries one developer's `/home//.cache/bazel/...` path for - # exactly this reason. That makes the lock machine-specific, so `requirements_test` - # below could never pass anywhere else. Dropping annotations keeps it reproducible. "--no-annotate", "--extra=dev", # so ruff resolves from this lock too ], diff --git a/pyproject.toml b/pyproject.toml index 77363d8..73a0032 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,6 @@ packages = ["testing_utils", "testing_utils.net"] dev = ["ruff"] [tool.pytest.ini_options] -# Import testing_utils from the source tree, so this repo's own test run needs -# nothing installed beyond the resolved lock -- no separate install of this -# package on top of it. pythonpath = ["."] testpaths = ["tests"] From 41cb320afb51cf4d11513b6c4b2652618301b2ed Mon Sep 17 00:00:00 2001 From: subramaniak Date: Wed, 5 Aug 2026 09:10:57 +0000 Subject: [PATCH 10/13] compile requirements from a flat requirements.txt instead of pyproject.toml --- BUILD | 8 +------- requirements.txt | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 requirements.txt diff --git a/BUILD b/BUILD index e2642bc..a6bda84 100644 --- a/BUILD +++ b/BUILD @@ -21,18 +21,12 @@ setup_starpls( # To update: bazel run //:requirements.update compile_pip_requirements( name = "requirements", - timeout = "moderate", # metadata build exceeds the rule's default "short" srcs = [ - "pyproject.toml", + "requirements.txt", "@score_tooling//python_basics:requirements.txt", ], - data = [ - "testing_utils/__init__.py", - "testing_utils/net/__init__.py", - ], extra_args = [ "--no-annotate", - "--extra=dev", # so ruff resolves from this lock too ], requirements_txt = "requirements.txt.lock", tags = ["manual"], diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..31607a9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,17 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +pytest~=9.0.1 +pytest-html~=4.1.1 +pytest-repeat~=0.9.4 +ruff From 0baf649ce238b6fde7fdba6736fdf3382b3870d2 Mon Sep 17 00:00:00 2001 From: subramaniak Date: Thu, 6 Aug 2026 01:27:49 +0000 Subject: [PATCH 11/13] resolve pins from pyproject.toml again and use pytest 9's native [tool.pytest] section --- BUILD | 9 ++++++++- pyproject.toml | 2 +- requirements.txt | 17 ----------------- 3 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 requirements.txt diff --git a/BUILD b/BUILD index a6bda84..7a2775c 100644 --- a/BUILD +++ b/BUILD @@ -21,12 +21,19 @@ setup_starpls( # To update: bazel run //:requirements.update compile_pip_requirements( name = "requirements", + timeout = "moderate", # metadata build exceeds the rule's default "short" under CI load srcs = [ - "requirements.txt", + "pyproject.toml", "@score_tooling//python_basics:requirements.txt", ], + # setuptools' build backend needs the package directories to exist to + # build this package's own metadata when resolving [project.dependencies] + # from pyproject.toml; the glob tracks [tool.setuptools]'s packages list + # automatically instead of needing a hand-kept duplicate here. + data = glob(["testing_utils/**/__init__.py"]), extra_args = [ "--no-annotate", + "--extra=dev", # so ruff resolves from this lock too ], requirements_txt = "requirements.txt.lock", tags = ["manual"], diff --git a/pyproject.toml b/pyproject.toml index 73a0032..bdaaa63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ packages = ["testing_utils", "testing_utils.net"] [project.optional-dependencies] dev = ["ruff"] -[tool.pytest.ini_options] +[tool.pytest] pythonpath = ["."] testpaths = ["tests"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 31607a9..0000000 --- a/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0 -# -# SPDX-License-Identifier: Apache-2.0 -# ******************************************************************************* - -pytest~=9.0.1 -pytest-html~=4.1.1 -pytest-repeat~=0.9.4 -ruff From 5b0ba905a3e4b7388cae01f8a4507ba384c8e539 Mon Sep 17 00:00:00 2001 From: subramaniak Date: Thu, 6 Aug 2026 02:31:21 +0000 Subject: [PATCH 12/13] transfer pyproject deps into a flat requirements.txt resolved against score_tooling's pins --- BUILD | 9 +-------- pyproject.toml | 2 +- requirements.txt | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 requirements.txt diff --git a/BUILD b/BUILD index 7a2775c..a6bda84 100644 --- a/BUILD +++ b/BUILD @@ -21,19 +21,12 @@ setup_starpls( # To update: bazel run //:requirements.update compile_pip_requirements( name = "requirements", - timeout = "moderate", # metadata build exceeds the rule's default "short" under CI load srcs = [ - "pyproject.toml", + "requirements.txt", "@score_tooling//python_basics:requirements.txt", ], - # setuptools' build backend needs the package directories to exist to - # build this package's own metadata when resolving [project.dependencies] - # from pyproject.toml; the glob tracks [tool.setuptools]'s packages list - # automatically instead of needing a hand-kept duplicate here. - data = glob(["testing_utils/**/__init__.py"]), extra_args = [ "--no-annotate", - "--extra=dev", # so ruff resolves from this lock too ], requirements_txt = "requirements.txt.lock", tags = ["manual"], diff --git a/pyproject.toml b/pyproject.toml index bdaaa63..6b834cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "testing-utils" version = "0.3.2" -dependencies = ["pytest~=9.0.1", "pytest-html~=4.1.1", "pytest-repeat~=0.9.4"] +dependencies = ["pytest>=8.3.5", "pytest-html>=4.1.1", "pytest-repeat>=0.9.4"] requires-python = ">=3.12" authors = [ { name = "Igor Ostrowski", email = "igor.ostrowski.ext@qorix.ai" }, diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1db5587 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,17 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +pytest +pytest-html +pytest-repeat +ruff From be05fb971cde0b5b3a231d58c96481c85e05befd Mon Sep 17 00:00:00 2001 From: subramaniak Date: Thu, 6 Aug 2026 05:50:16 +0000 Subject: [PATCH 13/13] pin pytest to match score_tooling's resolved versions --- pyproject.toml | 2 +- requirements.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b834cc..bdaaa63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "testing-utils" version = "0.3.2" -dependencies = ["pytest>=8.3.5", "pytest-html>=4.1.1", "pytest-repeat>=0.9.4"] +dependencies = ["pytest~=9.0.1", "pytest-html~=4.1.1", "pytest-repeat~=0.9.4"] requires-python = ">=3.12" authors = [ { name = "Igor Ostrowski", email = "igor.ostrowski.ext@qorix.ai" }, diff --git a/requirements.txt b/requirements.txt index 1db5587..31607a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -pytest -pytest-html -pytest-repeat +pytest~=9.0.1 +pytest-html~=4.1.1 +pytest-repeat~=0.9.4 ruff