From b8d9313ab8146767bd3d9af7e96727f43b96a639 Mon Sep 17 00:00:00 2001 From: dann frazier Date: Fri, 6 Dec 2024 16:25:34 -0500 Subject: [PATCH 1/4] libmamba: add python multiversioning support Signed-off-by: dann frazier --- libmamba.yaml | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/libmamba.yaml b/libmamba.yaml index f26a15ce7fea..47636c571186 100644 --- a/libmamba.yaml +++ b/libmamba.yaml @@ -6,6 +6,17 @@ package: copyright: - license: BSD-3-Clause +vars: + pypi-package: libmambapy + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + 3.13: "300" + environment: contents: packages: @@ -25,12 +36,12 @@ environment: - nlohmann-json - openssf-compiler-options - openssl-dev - - py3-distro - - py3-pip - - py3-pybind11-dev - - py3-scikit-build - - py3-wheel - - python3-dev + - py3-supported-distro + - py3-supported-pip + - py3-supported-pybind11 + - py3-supported-python-dev + - py3-supported-scikit-build + - py3-supported-wheel - reproc - reproc++ - samurai @@ -71,16 +82,29 @@ pipeline: - uses: strip subpackages: - - name: py3-libmambapy + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} dependencies: runtime: - libmamba + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} pipeline: - runs: | CMAKE_PREFIX_PATH=${{targets.subpkgdir}}/usr \ libmamba_DIR=${{targets.destdir}}/usr/lib/cmake/libmamba \ python -m pip install --root=${{targets.subpkgdir}} --no-deps --no-build-isolation --ignore-installed ./libmambapy/ + - name: py3-supported-${{vars.pypi-package}} + description: meta package providing ${{vars.pypi-package}} for supported python versions + dependencies: + runtime: + - py3.10-${{vars.pypi-package}} + - py3.11-${{vars.pypi-package}} + - py3.12-${{vars.pypi-package}} + - py3.13-${{vars.pypi-package}} + - name: libmamba-dev pipeline: - uses: split/dev From 58cc26d4477ff4426d716e366890e1e280c5a619 Mon Sep 17 00:00:00 2001 From: dann frazier Date: Fri, 6 Dec 2024 16:26:09 -0500 Subject: [PATCH 2/4] libmamba: add python/import tests Signed-off-by: dann frazier --- libmamba.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/libmamba.yaml b/libmamba.yaml index 47636c571186..af4904c289e3 100644 --- a/libmamba.yaml +++ b/libmamba.yaml @@ -8,6 +8,7 @@ package: vars: pypi-package: libmambapy + import: libmambapy data: - name: py-versions @@ -95,6 +96,12 @@ subpackages: CMAKE_PREFIX_PATH=${{targets.subpkgdir}}/usr \ libmamba_DIR=${{targets.destdir}}/usr/lib/cmake/libmamba \ python -m pip install --root=${{targets.subpkgdir}} --no-deps --no-build-isolation --ignore-installed ./libmambapy/ + test: + pipeline: + - uses: python/import + with: + python: python${{range.key}} + import: ${{vars.import}} - name: py3-supported-${{vars.pypi-package}} description: meta package providing ${{vars.pypi-package}} for supported python versions @@ -104,6 +111,24 @@ subpackages: - py3.11-${{vars.pypi-package}} - py3.12-${{vars.pypi-package}} - py3.13-${{vars.pypi-package}} + test: + pipeline: + - uses: python/import + with: + python: python3.10 + import: ${{vars.import}} + - uses: python/import + with: + python: python3.11 + import: ${{vars.import}} + - uses: python/import + with: + python: python3.12 + import: ${{vars.import}} + - uses: python/import + with: + python: python3.13 + import: ${{vars.import}} - name: libmamba-dev pipeline: From 399e3bb432f495fee589be903d9a5f362a9fbc57 Mon Sep 17 00:00:00 2001 From: dann frazier Date: Fri, 6 Dec 2024 16:27:15 -0500 Subject: [PATCH 3/4] libmamba: switch to py/pip-build-install pipeline pip builds need to find the .cmake files that will have been staged under ${{targets.destdir}} by the main package pipeline, which requires setting the libmamba_DIR environment variable. When we were building in a 'run:' stage, we just set that environment variable on the command line. Unfortunately, no such facility seems to exist for the py/pip-build-install pipeline. ${{X.Y}} variables are not expanded in an 'environment:' block. So here use a 'run:' block to create python interpreter wrappers to set this variable before calling the real interpreter. We also no longer set CMAKE_PREFIX_PATH because files get installed in the correct places without it. Signed-off-by: dann frazier --- libmamba.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libmamba.yaml b/libmamba.yaml index af4904c289e3..5696c2152788 100644 --- a/libmamba.yaml +++ b/libmamba.yaml @@ -93,9 +93,18 @@ subpackages: provider-priority: ${{range.value}} pipeline: - runs: | - CMAKE_PREFIX_PATH=${{targets.subpkgdir}}/usr \ - libmamba_DIR=${{targets.destdir}}/usr/lib/cmake/libmamba \ - python -m pip install --root=${{targets.subpkgdir}} --no-deps --no-build-isolation --ignore-installed ./libmambapy/ + mkdir -p wrapper-bin + cat > wrapper-bin/python${{range.key}} < Date: Fri, 6 Dec 2024 16:45:48 -0500 Subject: [PATCH 4/4] libmamba: bump the epoch Signed-off-by: dann frazier --- libmamba.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmamba.yaml b/libmamba.yaml index 5696c2152788..8db97002a884 100644 --- a/libmamba.yaml +++ b/libmamba.yaml @@ -1,7 +1,7 @@ package: name: libmamba version: 2024.10.02 - epoch: 0 + epoch: 1 description: Cross-Platform Package Manager copyright: - license: BSD-3-Clause