diff --git a/conda.yaml b/conda.yaml index b19f0c23c29..d096cbb516a 100644 --- a/conda.yaml +++ b/conda.yaml @@ -3,7 +3,7 @@ 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 @@ -11,21 +11,27 @@ package: 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: @@ -33,26 +39,23 @@ environment: - 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 @@ -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: @@ -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}} diff --git a/py3-conda-libmamba-solver.yaml b/py3-conda-libmamba-solver.yaml index 0c3f1655775..2cde3687309 100644 --- a/py3-conda-libmamba-solver.yaml +++ b/py3-conda-libmamba-solver.yaml @@ -1,30 +1,72 @@ package: name: py3-conda-libmamba-solver version: 24.11.1 - epoch: 0 + epoch: 1 description: The libmamba based solver for conda. copyright: - license: BSD-3-Clause dependencies: - runtime: - - py3-boltons - - py3-libmambapy - - python3 + provider-priority: 0 + +vars: + pypi-package: conda-libmamba-solver + import: conda_libmamba_solver + test-comprehensive: | + python3 <<-EOF + from conda.models.match_spec import MatchSpec + from conda.models.channel import Channel + from conda_libmamba_solver.solver import LibMambaSolver + + # Test a simple solve scenario + channel = Channel('defaults') + solver = LibMambaSolver( + prefix='/tmp/test-env', + channels=[channel], + specs_to_add=[MatchSpec('python=3.10'), MatchSpec('numpy')] + ) + + try: + solution = solver.solve_final_state() + if not solution: + raise Exception("No solution returned.") + + # Check that expected packages are present + solved_names = {pkg.name for pkg in solution} + for expected in ['python', 'numpy']: + if expected not in solved_names: + raise Exception(f"Expected {expected} in solution, got {solved_names}") + + print("Solver returned a valid solution containing python and numpy.") + + except Exception as e: + print(f"Error during solver test: {e}") + exit(1) + + # Test a conflicting scenario + solver.specs_to_add = [MatchSpec('python=3.10'), MatchSpec('python=3.9')] + try: + conflict_solution = solver.solve_final_state() + raise Exception("Expected a conflict, but solver returned a solution.") + except Exception as conflict_exception: + print("As expected, no solution could be found for conflicting specs.") + EOF + +data: + - name: py-versions + items: + # 3.13 is disabled until conda is available + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - - build-base - - busybox - ca-certificates-bundle - - py3-build - - py3-installer - - py3-setuptools - - python3 + - py3-supported-build-base + - py3-supported-hatch-vcs + - py3-supported-hatchling - 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 @@ -33,13 +75,60 @@ pipeline: tag: ${{package.version}} expected-commit: e09df1271eac29b62c0c773a24c5b05a9dd5b8ae - - name: Python Build - runs: python -m build +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: python${{range.key}} version of ${{vars.pypi-package}} + dependencies: + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} + runtime: + - py${{range.key}}-boltons + - py${{range.key}}-libmambapy + pipeline: + - uses: py/pip-build-install + with: + python: python${{range.key}} + - uses: strip + test: + environment: + contents: + packages: + # The comprehensive solver test will use `python3`, so let's + # make sure it points to the python3.x we want to test by + # installing python-3.x. + - py${{range.key}}-conda + - python-${{range.key}} + pipeline: + - uses: python/import + with: + python: python${{range.key}} + import: ${{vars.import}} + - name: "Run comprehensive solver test for python${{range.key}}" + runs: ${{vars.test-comprehensive}} - - name: Python Install - runs: python -m installer -d "${{targets.destdir}}/" dist/*.whl - - - uses: strip + - 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}} update: enabled: true @@ -50,48 +139,12 @@ test: environment: contents: packages: - - python3 - conda + - python3 pipeline: - - runs: | - python3 -c "import conda_libmamba_solver" - - name: "Run comprehensive solver test" - runs: | - python3 <<-EOF - from conda.models.match_spec import MatchSpec - from conda.models.channel import Channel - from conda_libmamba_solver.solver import LibMambaSolver - - # Test a simple solve scenario - channel = Channel('defaults') - solver = LibMambaSolver( - prefix='/tmp/test-env', - channels=[channel], - specs_to_add=[MatchSpec('python=3.10'), MatchSpec('numpy')] - ) - - try: - solution = solver.solve_final_state() - if not solution: - raise Exception("No solution returned.") - - # Check that expected packages are present - solved_names = {pkg.name for pkg in solution} - for expected in ['python', 'numpy']: - if expected not in solved_names: - raise Exception(f"Expected {expected} in solution, got {solved_names}") - - print("Solver returned a valid solution containing python and numpy.") - - except Exception as e: - print(f"Error during solver test: {e}") - exit(1) - - # Test a conflicting scenario - solver.specs_to_add = [MatchSpec('python=3.10'), MatchSpec('python=3.9')] - try: - conflict_solution = solver.solve_final_state() - raise Exception("Expected a conflict, but solver returned a solution.") - except Exception as conflict_exception: - print("As expected, no solution could be found for conflicting specs.") - EOF + - uses: python/import + with: + python: python3 + import: ${{vars.import}} + - name: "Run comprehensive solver test w/ python3" + runs: ${{vars.test-comprehensive}}