Skip to content

Commit

Permalink
Merge pull request #36456 from dannf/multiversion/py3-conda-libmamba-…
Browse files Browse the repository at this point in the history
…solver

Now that libmambapy is multiversioned, we can move up the stack.

I started with py3-conda-libmamba-solver, but found that it had dependencies on conda, which is really a python package in disguise, so I give it the py3- treatment here.

The other significant thing worth noting is that I abuse variables here to hold test code so I can share it between the main package and subpackages. I generally want to make sure tests work with each py3.x-foo, but also want to make sure we didn't regress that test for users who are pulling in the legacy provides, and hate cut & pasting code. Another option we could consider is to put the tests in scripts outside of the YAML, similar to how we include local patches.

Note: there's a pseudo-circular dependency here. py3-conda-libmamba-solver uses py3-conda from conda in its test cases, and conda uses py3-conda-libmamba-solver at runtime.

Also note that Python 3.13 support is currently blocked - upstream doesn't support it yet. I've filed and referenced the upstream issue.
  • Loading branch information
dannf authored Dec 14, 2024
2 parents 45e3aff + 929df0a commit a421d54
Show file tree
Hide file tree
Showing 2 changed files with 227 additions and 108 deletions.
156 changes: 111 additions & 45 deletions conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,59 @@
package:
name: conda
version: 24.11.1
epoch: 0
epoch: 1
description: "A system-level, binary package and environment manager running on all major operating systems and platforms."
copyright:
- license: BSD-3-Clause
options:
no-provides: true
no-depends: true
dependencies:
runtime:
- py3-archspec
- py3-boltons
- py3-conda-libmamba-solver
- py3-conda-package-handling
- py3-conda-package-streaming
- py3-libmambapy
- py3-packaging
- py3-platformdirs
- py3-pluggy
- py3-pycosat
- py3-requests
- py3-ruamel-yaml
- py3-tqdm
- python3
provider-priority: 0

vars:
pypi-package: conda
import: conda
test-commands: |
conda --version
conda info
conda init
conda create --quiet -n foo
conda install --quiet -n foo numpy
conda install --quiet -n foo --solver=classic requests
conda --help
data:
- name: py-versions
items:
# As of 24.11.1, 3.13 fails tests: https://github.com/conda/conda/issues/14439
3.10: "310"
3.11: "311"
3.12: "312"

environment:
contents:
packages:
- bash
- busybox
- ca-certificates-bundle
- py3-charset-normalizer
- py3-conda-package-handling
- py3-conda-package-streaming
- py3-hatch
- py3-hatchling
- py3-idna
- py3-installer
- py3-libmambapy
- py3-pip
- py3-pycosat
- py3-requests
- py3-urllib3
- py3-wheel
- py3-zstandard
- py3-supported-build-base
- py3-supported-charset-normalizer
- py3-supported-conda-package-handling
- py3-supported-conda-package-streaming
- py3-supported-hatch
- py3-supported-hatch-vcs
- py3-supported-hatchling
- py3-supported-idna
- py3-supported-libmambapy
- py3-supported-pycosat
- py3-supported-requests
- py3-supported-urllib3
- py3-supported-wheel
- py3-supported-zstandard
- python3
- wget
- wolfi-base
environment:
# This is needed to work around the error "ValueError: ZIP does not support timestamps before 1980"
SOURCE_DATE_EPOCH: 315532800

pipeline:
- uses: git-checkout
Expand All @@ -61,11 +64,81 @@ pipeline:
tag: ${{package.version}}
expected-commit: 1e025e1ac47914e470e140253f0ec69849535ca6

- runs: |
hatch build
python3 -m installer -d "${{targets.destdir}}" dist/conda*.whl
subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
description: python${{range.key}} version of ${{vars.pypi-package}}
dependencies:
runtime:
- py${{range.key}}-archspec
- py${{range.key}}-boltons
- py${{range.key}}-conda-libmamba-solver
- py${{range.key}}-conda-package-handling
- py${{range.key}}-conda-package-streaming
- py${{range.key}}-libmambapy
- py${{range.key}}-packaging
- py${{range.key}}-platformdirs
- py${{range.key}}-pluggy
- py${{range.key}}-pycosat
- py${{range.key}}-requests
- py${{range.key}}-ruamel-yaml
- py${{range.key}}-tqdm
pipeline:
- uses: py/pip-build-install
with:
python: python${{range.key}}
- name: "move usr/bin executables for -bin"
runs: |
mkdir -p ./cleanup/${{range.key}}/
mv ${{targets.contextdir}}/usr/bin ./cleanup/${{range.key}}/
- uses: strip
test:
pipeline:
- uses: python/import
with:
python: python${{range.key}}
import: ${{vars.import}}

- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}-bin
description: Executable binaries for ${{vars.pypi-package}} installed for python${{range.key}}
dependencies:
runtime:
- py${{range.key}}-${{vars.pypi-package}}
- python-${{range.key}}
provides:
- conda
provider-priority: ${{range.value}}
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/
mv ./cleanup/${{range.key}}/bin ${{targets.contextdir}}/usr/
test:
pipeline:
- runs: ${{vars.test-commands}}

- 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}}
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}}

- name: ${{package.name}}-init
description: Initializes conda
dependencies:
Expand Down Expand Up @@ -111,11 +184,4 @@ update:

test:
pipeline:
- runs: |
conda --version
conda info
conda init
conda create -n foo
conda install -n foo numpy
conda install -n foo --solver=classic requests
conda --help
- runs: ${{vars.test-commands}}
Loading

0 comments on commit a421d54

Please sign in to comment.