diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 65ea4a79..a31800c5 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -7,9 +7,9 @@ # - Release tags (X.Y.Z) are uploaded to PyPI. A manual run can upload to # TestPyPI or PyPI ("publish" input). # -# The wheels build against the mp2p-icp wheels from PyPI: the mp2p-icp version -# pinned in mola_metric_maps/packaging/pip/pyproject.toml must be published -# first. Uploads use PyPI Trusted Publishing (no tokens), set up once on +# The wheels build against the mp2p-icp wheels from PyPI: an mp2p-icp that +# satisfies the lower bound in mola_metric_maps/packaging/pip/pyproject.toml +# must be published first. Uploads use PyPI Trusted Publishing (no tokens), set up once on # (test.)pypi.org for this repository, this workflow and an environment named # like the index (pypi / testpypi). See # mola_metric_maps/packaging/pip/README-dev.md. @@ -51,14 +51,29 @@ jobs: with: persist-credentials: false - # The build needs the mp2p-icp wheel (its C++ SDK) from PyPI. Until that - # version is published, pull requests and the weekly run skip the build; - # tags and manual runs fail instead, so nothing is published without it. + # The build needs the mp2p-icp wheel (its C++ SDK) from PyPI. Until a + # version satisfying the lower bound is published, pull requests and the + # weekly run skip the build; tags and manual runs fail instead, so + # nothing is published without it. - name: Check that the mp2p-icp build requirement is on PyPI id: deps run: | - req=$(grep -o 'mp2p-icp==[0-9.]*' mola_metric_maps/packaging/pip/pyproject.toml | head -1) - if curl -sf "https://pypi.org/pypi/mp2p-icp/${req#mp2p-icp==}/json" > /dev/null; then + req=$(grep -o 'mp2p-icp>=[0-9.]*' mola_metric_maps/packaging/pip/pyproject.toml | head -1) + if [ -z "$req" ]; then + echo "::error::no 'mp2p-icp>=X.Y.Z' build requirement found in pyproject.toml" + exit 1 + fi + if releases=$(curl -sf https://pypi.org/pypi/mp2p-icp/json) && python3 -c ' + import json, sys + lower = tuple(int(x) for x in sys.argv[1].split(".")) + releases = json.load(sys.stdin)["releases"] + ok = any( + files and all(p.isdigit() for p in v.split(".")) + and tuple(int(p) for p in v.split(".")) >= lower + for v, files in releases.items() + ) + sys.exit(0 if ok else 1) + ' "${req#mp2p-icp>=}" <<< "$releases"; then echo "available=true" >> "$GITHUB_OUTPUT" elif [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "schedule" ]; then echo "::notice::${req} is not on PyPI yet: skipping the wheel build" diff --git a/agents.md b/agents.md index f1a00acf..8ba22495 100644 --- a/agents.md +++ b/agents.md @@ -655,8 +655,8 @@ Classes registered by `src/register.cpp` (these are the names a YAML must use): `_core` and `libmola_metric_maps.so` go into `site-packages/mola_metric_maps/`, with a RUNPATH to both SDK lib dirs; `libmp2p_icp*`, `libmrpt_*` and `libtbb` are never bundled. Requires `mp2p-icp`/`mrpt3` of the minor series it was built against. CI: - `.github/workflows/python-wheels.yml`, uploaded to PyPI on release tags (the pinned - mp2p-icp must be published first). + `.github/workflows/python-wheels.yml`, uploaded to PyPI on release tags (an mp2p-icp satisfying its lower-bound + build requirement must be published first). ### Feature macros diff --git a/mola_metric_maps/packaging/pip/README-dev.md b/mola_metric_maps/packaging/pip/README-dev.md index b1630649..4c04bade 100644 --- a/mola_metric_maps/packaging/pip/README-dev.md +++ b/mola_metric_maps/packaging/pip/README-dev.md @@ -47,18 +47,21 @@ other wheels ever need to build C++ code against `mola_metric_maps`. The wheel requires `mp2p-icp>=X.Y.Z,=X.Y.Z,=0.11", "pybind11==3.1.0", "mrpt3==3.6.2", "mp2p-icp==3.1.0"] +# Only lower bounds: builds use the newest versions on PyPI. Raise them only +# when the code needs newer ones. mp2p-icp 3.2.0 is the first with a wheel. +requires = ["scikit-build-core>=0.11", "pybind11==3.1.0", "mrpt3>=3.6.2", "mp2p-icp>=3.2.0"] build-backend = "scikit_build_core.build" [project]