From c41809e2c804619bf7d3d4349c77ecac57c5bf3f Mon Sep 17 00:00:00 2001 From: Julian Hofer Date: Tue, 17 Nov 2026 11:11:13 +0100 Subject: [PATCH] fix: Exercise package table generation in PR CI --- .github/workflows/checks.yml | 2 + pixi.lock | 122 ++++++++++++++++++++++- pixi.toml | 5 + scripts/compare_pkg_completeness.py | 4 +- scripts/test_compare_pkg_completeness.py | 23 +++++ 5 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 scripts/test_compare_pkg_completeness.py diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e8a8e55f..99f73d3a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -15,6 +15,8 @@ jobs: persist-credentials: false - uses: prefix-dev/setup-pixi@9936258fee697aff89b3fed6ca1f80a382ef694e # v0.11.3 - run: pixi run lint + - run: pixi run test-scripts + - run: pixi run update-tables - run: pixi run build-docs dependabot: diff --git a/pixi.lock b/pixi.lock index ad0158bf..9618a079 100644 --- a/pixi.lock +++ b/pixi.lock @@ -2,13 +2,13 @@ version: 7 platforms: - name: linux-64 virtual-packages: - - __unix=0=0 + - __unix=0 - __linux=4.18 - __glibc=2.28 - __archspec=0=x86_64 - name: osx-arm64 virtual-packages: - - __unix=0=0 + - __unix=0 - __osx=13.0 - __archspec=0=m1 - name: win-64 @@ -64,14 +64,22 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_3.conda - conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda - conda: https://prefix.dev/conda-forge/noarch/charset-normalizer-3.4.9-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/cpython-3.13.18-py313hd8ed1ab_100.conda + - conda: https://prefix.dev/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/ghp-import-2.1.0-pyhd8ed1ab_2.conda - conda: https://prefix.dev/conda-forge/noarch/h11-0.16.0-pyhcf101f3_1.conda + - conda: https://prefix.dev/conda-forge/noarch/iniconfig-2.3.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/niquests-3.21.2-pyh5ded981_0.conda + - conda: https://prefix.dev/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pluggy-1.7.0-pyh5ded981_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pytest-9.2.0-pyhc364b38_1.conda - conda: https://prefix.dev/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda - conda: https://prefix.dev/conda-forge/noarch/python-gil-3.13.18-h4df99d1_100.conda - conda: https://prefix.dev/conda-forge/noarch/python_abi-3.13-9_cp313.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://prefix.dev/conda-forge/noarch/tomli-2.5.0-pyh5ded981_0.conda - conda: https://prefix.dev/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda - conda: https://prefix.dev/conda-forge/noarch/urllib3-future-2.24.900-pyhcf101f3_0.conda @@ -80,14 +88,22 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_3.conda - conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2026.7.22-hbd8a1cb_0.conda - conda: https://prefix.dev/conda-forge/noarch/charset-normalizer-3.4.9-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/cpython-3.14.6-py314hd8ed1ab_101.conda + - conda: https://prefix.dev/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/ghp-import-2.1.0-pyhd8ed1ab_2.conda - conda: https://prefix.dev/conda-forge/noarch/h11-0.16.0-pyhcf101f3_1.conda + - conda: https://prefix.dev/conda-forge/noarch/iniconfig-2.3.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/niquests-3.21.2-pyh5ded981_0.conda + - conda: https://prefix.dev/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pluggy-1.7.0-pyh5ded981_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pytest-9.2.0-pyhc364b38_1.conda - conda: https://prefix.dev/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda - conda: https://prefix.dev/conda-forge/noarch/python-gil-3.14.6-h4df99d1_101.conda - conda: https://prefix.dev/conda-forge/noarch/python_abi-3.14-8_cp314.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://prefix.dev/conda-forge/noarch/tomli-2.5.0-pyh5ded981_0.conda - conda: https://prefix.dev/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda - conda: https://prefix.dev/conda-forge/noarch/urllib3-future-2.24.900-pyhcf101f3_0.conda @@ -130,14 +146,22 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_3.conda - conda: https://prefix.dev/conda-forge/noarch/ca-certificates-2026.7.22-h4c7d964_0.conda - conda: https://prefix.dev/conda-forge/noarch/charset-normalizer-3.4.9-pyhd8ed1ab_0.conda + - conda: https://prefix.dev/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/cpython-3.14.6-py314hd8ed1ab_101.conda + - conda: https://prefix.dev/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/ghp-import-2.1.0-pyhd8ed1ab_2.conda - conda: https://prefix.dev/conda-forge/noarch/h11-0.16.0-pyhcf101f3_1.conda + - conda: https://prefix.dev/conda-forge/noarch/iniconfig-2.3.1-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/niquests-3.21.2-pyh5ded981_0.conda + - conda: https://prefix.dev/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pluggy-1.7.0-pyh5ded981_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + - conda: https://prefix.dev/conda-forge/noarch/pytest-9.2.0-pyhc364b38_1.conda - conda: https://prefix.dev/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda - conda: https://prefix.dev/conda-forge/noarch/python-gil-3.14.6-h4df99d1_101.conda - conda: https://prefix.dev/conda-forge/noarch/python_abi-3.14-8_cp314.conda - conda: https://prefix.dev/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://prefix.dev/conda-forge/noarch/tomli-2.5.0-pyh5ded981_0.conda - conda: https://prefix.dev/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda - conda: https://prefix.dev/conda-forge/noarch/tzdata-2026c-h151e31d_0.conda - conda: https://prefix.dev/conda-forge/noarch/urllib3-future-2.24.900-pyhcf101f3_0.conda @@ -797,6 +821,16 @@ packages: run_exports: {} size: 61418 timestamp: 1783505332569 +- conda: https://prefix.dev/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + sha256: ab29d57dc70786c1269633ba3dff20288b81664d3ff8d21af995742e2bb03287 + md5: 962b9857ee8e7018c22f2776ffa0b2d7 + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + run_exports: {} + size: 27011 + timestamp: 1733218222191 - conda: https://prefix.dev/conda-forge/noarch/cpython-3.13.18-py313hd8ed1ab_100.conda noarch: generic sha256: 283ec2ea28bb5f6de4bb74abebca67b984d95879eef436a13b5635396328e082 @@ -819,6 +853,16 @@ packages: run_exports: {} size: 49508 timestamp: 1784909547134 +- conda: https://prefix.dev/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + sha256: ee6cf346d017d954255bbcbdb424cddea4d14e4ed7e9813e429db1d795d01144 + md5: 8e662bd460bda79b1ea39194e3c4c9ab + depends: + - python >=3.10 + - typing_extensions >=4.6.0 + license: MIT and PSF-2.0 + run_exports: {} + size: 21333 + timestamp: 1763918099466 - conda: https://prefix.dev/conda-forge/noarch/ghp-import-2.1.0-pyhd8ed1ab_2.conda sha256: 40fdf5a9d5cc7a3503cd0c33e1b90b1e6eab251aaaa74e6b965417d089809a15 md5: 93f742fe078a7b34c29a182958d4d765 @@ -842,6 +886,16 @@ packages: run_exports: {} size: 39069 timestamp: 1767729720872 +- conda: https://prefix.dev/conda-forge/noarch/iniconfig-2.3.1-pyhd8ed1ab_0.conda + sha256: 8f53876d0fb3525235e39635dd55633abe0a4307b1b3ab1415c80a9e0bbdf663 + md5: c0a803d97dd09da7e2c8b0fdfaa5739b + depends: + - python >=3.11 + license: MIT + license_family: MIT + run_exports: {} + size: 14485 + timestamp: 1791588553866 - conda: https://prefix.dev/conda-forge/noarch/niquests-3.21.2-pyh5ded981_0.conda sha256: 1c717c3773edc07f8581d2e9d81e238cc4a49e3d61c56eeb09fcb14d9ece00e7 md5: 48ef952873b92ea14113c2670c02807a @@ -856,6 +910,59 @@ packages: run_exports: {} size: 157288 timestamp: 1790216203086 +- conda: https://prefix.dev/conda-forge/noarch/packaging-26.3-pyhc364b38_0.conda + sha256: c432626b16768b8dab228bfb706f7060c2d462a21c516d240f68f2f902b5a044 + md5: 936687ed80f295a1f5dbcf8bd34c252c + depends: + - python >=3.9 + - python + license: Apache-2.0 + license_family: APACHE + run_exports: {} + size: 116363 + timestamp: 1785888127370 +- conda: https://prefix.dev/conda-forge/noarch/pluggy-1.7.0-pyh5ded981_0.conda + sha256: 34c40106bc3172b3a47656e84837e13a5d4829d413d65f30fb214e7568a09cea + md5: 50c6bcd41b7ceaaeeea8852e3198663e + depends: + - python >=3.11 + - python + license: MIT + license_family: MIT + run_exports: {} + size: 30111 + timestamp: 1792063298993 +- conda: https://prefix.dev/conda-forge/noarch/pygments-2.21.0-pyhcf101f3_0.conda + sha256: f5f015ff1bc3e1b7fc08eee096b1865234189ae0b82bebdb86a5369116e42fa0 + md5: 2882dee445dfa45b0c5afce3ffb7730a + depends: + - python >=3.10 + - python + license: BSD-2-Clause + license_family: BSD + run_exports: {} + size: 959376 + timestamp: 1786995678795 +- conda: https://prefix.dev/conda-forge/noarch/pytest-9.2.0-pyhc364b38_1.conda + sha256: a9cf3571e80a4e86992502068eb1d29a109e88345c39babf03b10450895056af + md5: f0cfded84ced11a9dfb3790c4c1c0b63 + depends: + - colorama + - python >=3.10 + - exceptiongroup >=1 + - iniconfig >=2 + - packaging >=24 + - pluggy >=1.6,<2 + - pygments >=2.15 + - tomli >=2 + - python + constrains: + - pytest-faulthandler >=2 + license: MIT + license_family: MIT + run_exports: {} + size: 326683 + timestamp: 1793214631903 - conda: https://prefix.dev/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda sha256: d6a17ece93bbd5139e02d2bd7dbfa80bee1a4261dced63f65f679121686bf664 md5: 5b8d21249ff20967101ffa321cab24e8 @@ -921,6 +1028,17 @@ packages: run_exports: {} size: 18455 timestamp: 1753199211006 +- conda: https://prefix.dev/conda-forge/noarch/tomli-2.5.0-pyh5ded981_0.conda + sha256: 93b6f517fb7adff00b62be02b798d384a1b34d0e368fdb576fb248bcb3bb9ec7 + md5: 36d6a162326c52d6339c8b606f43932d + depends: + - python >=3.11 + - python + license: MIT + license_family: MIT + run_exports: {} + size: 21687 + timestamp: 1791394576814 - conda: https://prefix.dev/conda-forge/noarch/typing_extensions-4.16.0-pyhcf101f3_0.conda sha256: 2d888f90af0686044882c74193ec80a90ec1943145d94a7b1b048958acda1848 md5: c70ad746c22219b9700931707482992c diff --git a/pixi.toml b/pixi.toml index 66926bd4..d36b2e6d 100644 --- a/pixi.toml +++ b/pixi.toml @@ -84,8 +84,13 @@ lint = { pyyaml = ">=6.0.3,<7" py-rattler = ">=0.28.1,<0.29" niquests = ">=3.21.2,<4" +pytest = ">=9.2.0,<10" [feature.scripts.tasks] +test-scripts = { + cmd = "pytest scripts", + description = "Test package table generation", +} check-dependabot-merge = { cmd = "python scripts/check_dependabot_merge.py", description = "Check whether every Dependabot update qualifies for auto-merge", diff --git a/scripts/compare_pkg_completeness.py b/scripts/compare_pkg_completeness.py index 38c07ba6..84ba1415 100644 --- a/scripts/compare_pkg_completeness.py +++ b/scripts/compare_pkg_completeness.py @@ -58,7 +58,7 @@ import niquests import yaml -from rattler import MatchSpec, PackageRecord +from rattler import BuildString, MatchSpec, PackageRecord from urllib3.util.retry import Retry # The distro list and the platform list are shared with the site through @@ -289,7 +289,7 @@ def collect_mutexes(repos: dict[str, list[Artifact]]) -> tuple[str, MutexRecords PackageRecord( name=artifact["name"], version=artifact["version"], - build=artifact["build"], + build=BuildString(artifact["build"]), build_number=artifact.get("build_number", 0), subdir=platform, ) diff --git a/scripts/test_compare_pkg_completeness.py b/scripts/test_compare_pkg_completeness.py new file mode 100644 index 00000000..6c0e5cd1 --- /dev/null +++ b/scripts/test_compare_pkg_completeness.py @@ -0,0 +1,23 @@ +"""Regression tests for package availability across mutex builds.""" + +from compare_pkg_completeness import collect_mutexes, mutex_matcher + + +def test_matches_version_and_build_across_platforms() -> None: + name, records = collect_mutexes( + { + "linux-64": [ + {"name": "ros-distro-mutex", "version": "0.6.0", "build": "noetic_0"}, + {"name": "ros-distro-mutex", "version": "0.7.0", "build": "noetic_2"}, + ], + "osx-arm64": [ + {"name": "ros-distro-mutex", "version": "0.6.0", "build": "noetic_1"}, + ], + } + ) + match = mutex_matcher(records) + assert name == "ros-distro-mutex" + assert match(f"{name} 0.6.* noetic_0") == {"0.6.0"} + assert match(f"{name} 0.6.* noetic_1") == {"0.6.0"} + assert match(f"{name} >=0.6.0,<0.8.0a0") == {"0.6.0", "0.7.0"} + assert match(f"{name} 0.6.* noetic_2") == set()