diff --git a/cython.yaml b/cython.yaml deleted file mode 100644 index de6de25ccf8..00000000000 --- a/cython.yaml +++ /dev/null @@ -1,35 +0,0 @@ -package: - name: cython - version: 3.0.10 - epoch: 2 - description: Cython is an optimising static compiler for both the Python & the extended Cython programming languages. - copyright: - - license: Apache-2.0 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3-setuptools - - python3 - - python3-dev - -pipeline: - - uses: git-checkout - with: - expected-commit: 7ae85318297ed306b84ecc72d0279e27090b25f3 - repository: https://github.com/cython/cython - tag: ${{package.version}} - - - runs: | - python setup.py build - python setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - uses: strip - -update: - enabled: true - github: - identifier: cython/cython diff --git a/numpy.yaml b/numpy.yaml deleted file mode 100644 index b3fcf043398..00000000000 --- a/numpy.yaml +++ /dev/null @@ -1,61 +0,0 @@ -package: - name: numpy - version: 1.26.4 - epoch: 2 - description: "The fundamental package for scientific computing with Python." - copyright: - - license: BSD-3-Clause - -environment: - contents: - packages: - - bash - - build-base - - busybox - - cython - - gfortran - - git - - meson - - openblas-dev - - py3-gpep517 - - py3-packaging - - py3-pip - - py3-setuptools - - py3-wheel - - python3 - - python3-dev - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/numpy/numpy - tag: v${{package.version}} - expected-commit: 9815c16f449e12915ef35a8255329ba26dacd5c0 - recurse-submodules: true - - - runs: | - python3 setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - uses: strip - -subpackages: - - name: f2py - description: "f2py for numpy (for python3)" - pipeline: - - runs: | - mkdir -p "${{targets.subpkgdir}}"/usr/bin - mv "${{targets.destdir}}"/usr/bin/f2py* "${{targets.subpkgdir}}"/usr/bin - dependencies: - runtime: - - python3-dev - - numpy - -update: - enabled: true - github: - identifier: numpy/numpy - # There are some v2 pre-releases - tag-filter: v1 - strip-prefix: v - strip-suffix: .dev0 diff --git a/pipelines/py/collect-wheels.yaml b/pipelines/py/collect-wheels.yaml new file mode 100644 index 00000000000..98ab7cbee2b --- /dev/null +++ b/pipelines/py/collect-wheels.yaml @@ -0,0 +1,28 @@ +name: Collect wheels built by a python pipeline + +needs: + packages: + - util-linux + +inputs: + dest: + description: the destination + default: ${{targets.subpkgdir}}/usr/share/wheels + +pipeline: + - name: "pip build ${{inputs.python}}" + runs: | + found="" + set -- + for wheel in ./.wheels/*/*.whl; do + [ -f "$wheel" ] || continue + set -- "$@" "$wheel" + done + if [ $# -eq 0 ]; then + echo "No wheels found in $PWD/.wheels/*/*.whl" + exit 1 + fi + mkdir -p ${{inputs.dest}} + echo "Found wheels:" "$@" + sha256sum "$@" + cp -v "$@" "${{inputs.dest}}" diff --git a/pipelines/py/install-compile.yaml b/pipelines/py/install-compile.yaml new file mode 100644 index 00000000000..fd1dd68161f --- /dev/null +++ b/pipelines/py/install-compile.yaml @@ -0,0 +1,18 @@ +name: Setup, install and compile python + +inputs: + python: + description: which python to use + required: true + dest: + description: the destination + default: ${{targets.subpkgdir}} + +pipeline: + - name: "setup ${{inputs.python}}" + runs: | + ${{inputs.python}} setup.py install --no-compile --root="${{targets.subpkgdir}}" --prefix=/usr + rm -Rf build/ + - name: "compileall ${{inputs.python}}" + runs: | + ${{inputs.python}} -m compileall --invalidation-mode=unchecked-hash -r100 ${{targets.subpkgdir}}/usr/lib/ diff --git a/pipelines/py/pip-build-install-bootstrap.yaml b/pipelines/py/pip-build-install-bootstrap.yaml new file mode 100644 index 00000000000..865c749a7e0 --- /dev/null +++ b/pipelines/py/pip-build-install-bootstrap.yaml @@ -0,0 +1,58 @@ +name: Use pip from a zipapp for bootstrap. Only for use with bootstrapping. + +needs: + packages: + - pip-zipapp + +inputs: + python: + description: which python to use + required: true + wheel: + description: build a wheel? + required: false + default: true + dest: + description: the destination + default: ${{targets.subpkgdir}} + +pipeline: + - name: "pip-bootstrap build" + runs: | + export SOURCE_DATE_EPOCH=315532800 + py=${{inputs.python}} + pipzip=/usr/share/pip-zipapp/pip-zipapp.pyz + [ -e "$pipzip" ] || { echo "missing pip-zip - $pipzip does not exist"; exit 1; } + [ -f "$pipzip" ] || { echo "missing pip-zip - $pipzip is not a file"; exit 1; } + pyver=$("$py" -c 'import sys; print("%s.%s" % (sys.version_info.major, sys.version_info.minor))') + sitepkgd=$("$py" -c 'import site; print(site.getsitepackages()[0])') + sitepkgd=${sitepkgd#/} + root=${{inputs.dest}} + wd="./.wheels/$pyver" + info() { echo "$@" 1>&2; } + vr() { info "execute:" "$@"; "$@"; } + + tmpd=$(mktemp -d) + trap "rm -Rf '$tmpd'" EXIT + + # --find-links to an empty dir and --no-index makes pip fully "offline" + distwheelsd="/usr/share/pip-zipapp/wheels" + mkdir -p "$distwheelsd" + info "$py is $pyver with site_packages dir '$sitepkgd'" + + if [ "${{inputs.wheel}}" = "false" ]; then + info "skipping bdist-wheel" + vr "$py" "$pipzip" --python=/usr/bin/$py install --verbose --no-deps \ + "--find-links=$distwheelsd" --no-index \ + --force-reinstall --no-compile --prefix=/usr "--root=$root" . + else + vr "$py" "$pipzip" --python=/usr/bin/$py wheel --verbose "--wheel-dir=$wd" \ + "--find-links=$distwheelsd" --no-index --no-deps . + set -- "$wd"/*.whl + [ -f "$1" ] || { info "did not produce a wheel in $wd"; exit 1; } + info "produced $# wheels: $*" + vr "$py" "$pipzip" --python=/usr/bin/$py install --verbose \ + "--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps \ + --force-reinstall --no-compile --prefix=/usr "--root=$root" "$@" + fi + vr $py -m compileall --invalidation-mode=unchecked-hash -r100 "$root/$sitepkgd" diff --git a/pipelines/py/pip-build-install.yaml b/pipelines/py/pip-build-install.yaml new file mode 100644 index 00000000000..13d38b63b5f --- /dev/null +++ b/pipelines/py/pip-build-install.yaml @@ -0,0 +1,35 @@ +name: Build and install python package with pip + +inputs: + python: + description: which python to use + required: true + dest: + description: the destination + default: ${{targets.subpkgdir}} + +pipeline: + - name: "pip build ${{inputs.python}}" + runs: | + export SOURCE_DATE_EPOCH=315532800 + py=${{inputs.python}} + pyver=$("$py" -c 'import sys; print("%s.%s" % (sys.version_info.major, sys.version_info.minor))') + sitepkgd=$("$py" -c 'import site; print(site.getsitepackages()[0])') + sitepkgd=${sitepkgd#/} + root=${{inputs.dest}} + wd="./.wheels/$pyver" + vr() { echo "execute:" "$@"; "$@"; } + + tmpd=$(mktemp -d) + trap "rm -Rf '$tmpd'" EXIT + + # --find-links to an empty dir and --no-index makes pip fully "offline" + distwheelsd="$tmpd/dist-wheels" + mkdir -p "$distwheelsd" + echo "$py is $pyver with site_packages dir '$sitepkgd'" + vr $py -m pip wheel --verbose "--wheel-dir=$wd" \ + "--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps . + vr $py -m pip install --verbose \ + "--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps \ + --force-reinstall --no-compile --prefix=/usr "--root=$root" "$wd"/*.whl + vr $py -m compileall --invalidation-mode=unchecked-hash -r100 "$root/$sitepkgd" diff --git a/py3-cython.yaml b/py3-cython.yaml new file mode 100644 index 00000000000..242c20d952e --- /dev/null +++ b/py3-cython.yaml @@ -0,0 +1,57 @@ +package: + name: py3-cython + version: 3.0.10 + epoch: 1 + description: Cython is an optimising static compiler for both the Python & the extended Cython programming languages. + copyright: + - license: Apache-2.0 + dependencies: + provider-priority: 0 + +vars: + pypi-package: cython + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + +environment: + contents: + packages: + - build-base + - busybox + - py3-supported-pip + - py3-supported-python-dev + - py3-supported-wheel + +pipeline: + - uses: fetch + with: + expected-sha256: 00f97476cef9fcd9a89f9d2a49be3b518e1a74b91f377fe08c97fcb44bc0f7d7 + uri: https://github.com/cython/cython/archive/${{package.version}}.tar.gz + +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + dependencies: + provider-priority: ${{range.value}} + provides: + - ${{package.name}} + - cython + pipeline: + - uses: py/pip-build-install + with: + python: python${{range.key}} + - uses: strip + + - name: py3-wheels-${{vars.pypi-package}} + pipeline: + - uses: py/collect-wheels + +update: + enabled: true + github: + identifier: cython/cython diff --git a/py3-flit-core.yaml b/py3-flit-core.yaml index 93f01fdaf6f..fc9e9ce60b1 100644 --- a/py3-flit-core.yaml +++ b/py3-flit-core.yaml @@ -1,23 +1,29 @@ package: name: py3-flit-core version: 3.9.0 - epoch: 1 + epoch: 2 description: "simple packaging tool for simple packages (core)" copyright: - license: BSD-3-Clause dependencies: - runtime: - - python3 + provider-priority: 0 + +vars: + pypi-package: flit-core + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - build-base - busybox - - ca-certificates-bundle - - py3-installer - - python3 - - wolfi-base + - py3-supported-python pipeline: - uses: fetch @@ -25,18 +31,41 @@ pipeline: uri: https://files.pythonhosted.org/packages/source/f/flit/flit-${{package.version}}.tar.gz expected-sha256: d75edf5eb324da20d53570a6a6f87f51e606eee8384925cd66a90611140844c7 - - runs: | - cd flit_core - python3 build_dists.py - - - runs: | - cd flit_core - python3 -m installer -d "${{targets.destdir}}" dist/flit_core-${{package.version}}-py3-none-any.whl +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + provider-priority: ${{range.value}} + provides: + - ${{package.name}} + pipeline: + - runs: | + cd flit_core + rm -Rf dist/ + python${{range.key}} -m flit_core.wheel + python${{range.key}} bootstrap_install.py \ + --install-root=${{targets.subpkgdir}} \ + dist/flit_core-${{package.version}}-py3-none-any.whl + mkdir -p /home/build/.wheels/${{range.key}}/ + cp dist/flit_core-${{package.version}}-py3-none-any.whl \ + /home/build/.wheels/${{range.key}}/ + python${{range.key}} -m compileall --invalidation-mode=unchecked-hash -r100 \ + ${{targets.subpkgdir}} + rm -rf "${{targets.subpkgdir}}"/usr/lib/python3*/site-packages/flit_core/tests + - uses: strip - - runs: | - rm -rf "${{targets.destdir}}"/usr/lib/python3*/site-packages/flit_core/tests + - name: py3-wheels-${{vars.pypi-package}} + pipeline: + - uses: py/collect-wheels - - 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}} update: enabled: true diff --git a/py3-gpep517.yaml b/py3-gpep517.yaml index 98518bc45c7..9f81c81cd8a 100644 --- a/py3-gpep517.yaml +++ b/py3-gpep517.yaml @@ -1,24 +1,32 @@ package: name: py3-gpep517 version: "16" - epoch: 0 + epoch: 1 description: "PEP517 build system support for distros" copyright: - license: MIT dependencies: - runtime: - - py3-installer - - py3-tomli - - python3 + provider-priority: 0 + +vars: + pypi-package: gpep517 + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - build-base - busybox - - ca-certificates-bundle - - python3 - - wolfi-base + - py3-supported-pip + - py3-supported-python + - py3-supported-setuptools + - py3-supported-wheel pipeline: - uses: fetch @@ -26,14 +34,43 @@ pipeline: uri: https://github.com/mgorny/gpep517/archive/v${{package.version}}/gpep517-v${{package.version}}.tar.gz expected-sha256: 965ff7cb2217fa03091face01fcb9a2b0205f58be80c8be9ccf832eab7a55414 - - runs: | - _site_pkgs="$(python3 -c 'import site; print(site.getsitepackages()[0])')" - _py3ver=$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))') +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: Easily download, build, install, upgrade, and uninstall Python packages + pipeline: + - uses: py/pip-build-install + with: + python: python${{range.key}} + dependencies: + provider-priority: ${{range.value}} + provides: + - ${{package.name}} + runtime: + - py${{range.key}}-tomli + - py${{range.key}}-installer - mkdir -p "${{targets.destdir}}"/"$_site_pkgs" - cp -a gpep517 "${{targets.destdir}}"/$_site_pkgs/ + - 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}} + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} + pipeline: + - runs: | + mkdir -p ${{targets.contextdir}}/usr + mv ${{targets.contextdir}}/../py${{range.key}}-${{vars.pypi-package}}/usr/bin ${{targets.contextdir}}/usr - - 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}} update: enabled: true diff --git a/py3-installer.yaml b/py3-installer.yaml new file mode 100644 index 00000000000..0759ff78720 --- /dev/null +++ b/py3-installer.yaml @@ -0,0 +1,60 @@ +package: + name: py3-installer + version: 0.7.0 + epoch: 6 + description: A library for installing Python wheels. + copyright: + - license: "MIT" + dependencies: + provider-priority: 0 + +vars: + pypi-package: installer + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + +environment: + contents: + packages: + - build-base + - busybox + - py3-supported-python + +pipeline: + - uses: git-checkout + with: + repository: https://github.com/pypa/installer.git + tag: ${{package.version}} + expected-commit: b1d39180f8548820d09ce992dfadff0a42242c48 + +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + provider-priority: ${{range.value}} + provides: + - ${{package.name}} + pipeline: + - uses: py/pip-build-install-bootstrap + with: + python: python${{range.key}} + + - 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}} + +update: + enabled: true + github: + identifier: pypa/installer + use-tag: true diff --git a/py3-numpy.yaml b/py3-numpy.yaml new file mode 100644 index 00000000000..30dffc06977 --- /dev/null +++ b/py3-numpy.yaml @@ -0,0 +1,81 @@ +package: + name: py3-numpy + version: 1.26.4 + epoch: 3 + description: "The fundamental package for scientific computing with Python." + copyright: + - license: BSD-3-Clause + dependencies: + provider-priority: 0 + +vars: + pypi-package: numpy + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + +environment: + contents: + packages: + - bash + - build-base + - busybox + - gfortran + - git + - meson + - openblas-dev + - py3-cython + - py3-supported-pip + - py3-supported-python-dev + - wolfi-base + +pipeline: + - uses: git-checkout + with: + repository: https://github.com/numpy/numpy + tag: v${{package.version}} + expected-commit: 9815c16f449e12915ef35a8255329ba26dacd5c0 + recurse-submodules: true + +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + pipeline: + - runs: python${{range.key}} -m pip install . "--root=${{targets.subpkgdir}}" --prefix=/usr + - uses: strip + dependencies: + runtime: + - py${{range.key}}-${{vars.pypi-package}} + provides: + - py3-${{vars.pypi-package}} + - numpy + - f2py + provider-priority: ${{range.value}} + + - 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}} + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} + pipeline: + - runs: | + mkdir -p ${{targets.contextdir}}/usr + mv ${{targets.contextdir}}/../py${{range.key}}-${{vars.pypi-package}}/usr/bin ${{targets.contextdir}}/usr + +update: + enabled: true + github: + identifier: numpy/numpy + # There are some v2 pre-releases + tag-filter: v1 + strip-prefix: v + strip-suffix: .dev0 diff --git a/py3-pathspec.yaml b/py3-pathspec.yaml index 71262c44ea6..573ae2cab61 100644 --- a/py3-pathspec.yaml +++ b/py3-pathspec.yaml @@ -1,23 +1,30 @@ package: name: py3-pathspec version: 0.12.1 - epoch: 0 + epoch: 1 description: "Utility library for gitignore style pattern matching of file paths" copyright: - license: MPL-2.0 dependencies: - runtime: - - python3 + provider-priority: 0 + +vars: + pypi-package: pathspec + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - build-base - busybox - - ca-certificates-bundle - - py3-setuptools - - python3 - - wolfi-base + - py3-supported-pip + - py3-supported-python pipeline: - uses: fetch @@ -25,13 +32,22 @@ pipeline: uri: https://files.pythonhosted.org/packages/source/p/pathspec/pathspec-${{package.version}}.tar.gz expected-sha512: 19d1a8ae5936e76eacd691b0e2fb33d0de376556751a9ae007f6b09d0aa36af7d171101df620cab3e93c9913be578ff3d6bba9d4460351ac248e5c9e015380ad - - runs: | - python3 setup.py build - - - runs: | - python3 setup.py install --prefix=/usr --root="${{targets.destdir}}" --skip-build +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + pipeline: + - uses: py/pip-build-install + with: + python: python${{range.key}} + dependencies: + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} - - uses: strip + - name: py3-wheels-${{vars.pypi-package}} + pipeline: + - uses: py/collect-wheels update: enabled: true diff --git a/py3-pip.yaml b/py3-pip.yaml new file mode 100644 index 00000000000..532c4171d9f --- /dev/null +++ b/py3-pip.yaml @@ -0,0 +1,81 @@ +package: + name: py3-pip + version: "24.0" + epoch: 2 + description: The PyPA recommended tool for installing Python packages. + copyright: + - license: MIT + dependencies: + provider-priority: 0 + +vars: + pypi-package: pip + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + +environment: + contents: + packages: + - build-base + - busybox + - py3-supported-python + +pipeline: + - uses: git-checkout + with: + repository: https://github.com/pypa/pip + expected-commit: ef78c129b1a966dbbbdb8ebfffc43723e89110d1 + tag: ${{package.version}} + +subpackages: + - range: py-versions + # Historically py3.X-pip installed /usr/bin/pip + # Hence co-installable modules only package is called -base + # And /usr/bin/pip conflicting package is called py3.X-pip + name: py${{range.key}}-${{vars.pypi-package}}-base + description: ${{vars.pypi-package}} installed for python${{range.key}} + pipeline: + - uses: py/pip-build-install-bootstrap + with: + python: python${{range.key}} + dependencies: + runtime: + - py${{range.key}}-flit-core + - py${{range.key}}-setuptools + + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: Executable binaries for ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + runtime: + - py${{range.key}}-${{vars.pypi-package}}-base + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} + pipeline: + - runs: | + mkdir -p ${{targets.contextdir}}/usr/bin + mv ${{targets.contextdir}}/../py${{range.key}}-${{vars.pypi-package}}-base/usr/bin/pip ${{targets.contextdir}}/usr/bin/ + mv ${{targets.contextdir}}/../py${{range.key}}-${{vars.pypi-package}}-base/usr/bin/pip3 ${{targets.contextdir}}/usr/bin/ + + - name: py3-supported-${{vars.pypi-package}} + description: meta package providing ${{vars.pypi-package}} for supported python versions. + dependencies: + runtime: + - py3.12-${{vars.pypi-package}}-base + - py3.11-${{vars.pypi-package}}-base + - py3.10-${{vars.pypi-package}}-base + +update: + ignore-regex-patterns: + - b + enabled: true + shared: true + github: + identifier: pypa/pip + use-tag: true diff --git a/py3-pyyaml.yaml b/py3-pyyaml.yaml index 3d649a37327..9e953b58984 100644 --- a/py3-pyyaml.yaml +++ b/py3-pyyaml.yaml @@ -1,25 +1,32 @@ package: name: py3-pyyaml version: 6.0.1 - epoch: 4 + epoch: 5 description: "Python3 bindings for YAML" copyright: - license: MIT dependencies: - runtime: - - python3 + provider-priority: 0 + +vars: + pypi-package: pyyaml + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - build-base - busybox - - ca-certificates-bundle - - cython - - py3-setuptools - - python3 - - python3-dev - - wolfi-base + - py3-cython + - py3-supported-pip + - py3-supported-python-dev + - py3-supported-wheel - yaml-dev pipeline: @@ -34,13 +41,24 @@ pipeline: with: patches: pyyaml-cython3.patch - - runs: | - python3 setup.py build - - - runs: | - python3 setup.py install --prefix=/usr --root="${{targets.destdir}}" +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + provider-priority: ${{range.value}} + provides: + - py3-${{vars.pypi-package}} + pipeline: + - runs: python${{range.key}} setup.py clean --all + - uses: py/pip-build-install + with: + python: python${{range.key}} + - uses: strip - - uses: strip + - name: py3-wheels-${{vars.pypi-package}} + pipeline: + - uses: py/collect-wheels update: enabled: true diff --git a/py3-setuptools.yaml b/py3-setuptools.yaml new file mode 100644 index 00000000000..86881e80366 --- /dev/null +++ b/py3-setuptools.yaml @@ -0,0 +1,63 @@ +package: + name: py3-setuptools + version: 70.0.0 + epoch: 1 + description: Easily download, build, install, upgrade, and uninstall Python packages + copyright: + - license: "MIT" + dependencies: + provider-priority: 0 + +vars: + pypi-package: setuptools + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + +environment: + contents: + packages: + - build-base + - busybox + - py3-supported-python + environment: + # This is needed to work around the error "ValueError: ZIP does not support timestamps before 1980" + SOURCE_DATE_EPOCH: 315532800 + +pipeline: + - uses: fetch + with: + expected-sha256: f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0 + uri: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-${{package.version}}.tar.gz + +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + provider-priority: ${{range.value}} + provides: + - py3-${{vars.pypi-package}} + pipeline: + - uses: py/pip-build-install-bootstrap + with: + python: python${{range.key}} + - 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}} + +update: + enabled: true + shared: true + release-monitor: + identifier: 4021 diff --git a/py3-six.yaml b/py3-six.yaml index 2eed069b61c..8222f585bfc 100644 --- a/py3-six.yaml +++ b/py3-six.yaml @@ -6,18 +6,26 @@ package: copyright: - license: MIT dependencies: - runtime: - - python3 + provider-priority: 0 + +vars: + pypi-package: six + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - build-base - busybox - - ca-certificates-bundle - - py3-setuptools - - python3 - - wolfi-base + - py3-supported-pip + - py3-supported-python + - py3-supported-wheel pipeline: - uses: fetch @@ -25,13 +33,23 @@ pipeline: uri: https://files.pythonhosted.org/packages/source/s/six/six-${{package.version}}.tar.gz expected-sha256: 1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 - - runs: | - python3 setup.py build - - - runs: | - python3 setup.py install --prefix=/usr --root="${{targets.destdir}}" --skip-build +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} + pipeline: + - uses: py/pip-build-install + with: + python: python${{range.key}} + - uses: strip - - uses: strip + - name: py3-wheels-${{vars.pypi-package}} + pipeline: + - uses: py/collect-wheels update: enabled: true diff --git a/py3-supported-python.yaml b/py3-supported-python.yaml new file mode 100644 index 00000000000..a75a9c5694d --- /dev/null +++ b/py3-supported-python.yaml @@ -0,0 +1,30 @@ +package: + name: py3-supported-python + version: 1 + epoch: 1 + description: metapackage to install all supported versions of python + copyright: + - license: "MIT" + dependencies: + runtime: + - python-3.10-base + - python-3.11-base + - python-3.12-base + +environment: + contents: + packages: + - build-base + - busybox + +subpackages: + - name: ${{package.name}}-dev + description: metapackage to install all supported versions of python-dev + dependencies: + runtime: + - python-3.10-base-dev + - python-3.11-base-dev + - python-3.12-base-dev + +update: + enabled: false diff --git a/py3-tomli.yaml b/py3-tomli.yaml index 272010149f1..be4c5436a1b 100644 --- a/py3-tomli.yaml +++ b/py3-tomli.yaml @@ -1,23 +1,30 @@ package: name: py3-tomli version: 2.0.1 - epoch: 7 + epoch: 8 description: "TOML parser" copyright: - license: MIT dependencies: - runtime: - - python3 + provider-priority: 0 + +vars: + pypi-package: tomli + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - build-base - busybox - - ca-certificates-bundle - - py3-installer - - python3 - - wolfi-base + - py3-supported-installer + - py3-supported-python pipeline: - uses: fetch @@ -26,10 +33,19 @@ pipeline: expected-sha256: 939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc extract: false - - runs: | - python3 -m installer -d "${{targets.destdir}}" tomli-${{package.version}}-py3-none-any.whl - - - uses: strip +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + dependencies: + provider-priority: ${{range.value}} + provides: + - ${{package.name}} + pipeline: + - runs: | + python${{range.key}} -m installer -d "${{targets.subpkgdir}}" \ + tomli-${{package.version}}-py3-none-any.whl + - uses: strip update: enabled: true @@ -38,6 +54,6 @@ update: test: pipeline: - - uses: python/import - with: - import: tomli + - name: Verify tomli installation + runs: | + python3.12 -c "import tomli" || exit 1 diff --git a/py3-wheel.yaml b/py3-wheel.yaml index 62205348a1a..d746f4405d2 100644 --- a/py3-wheel.yaml +++ b/py3-wheel.yaml @@ -6,19 +6,23 @@ package: copyright: - license: MIT dependencies: - runtime: - - py3-installer - - python3 + provider-priority: 0 + +vars: + pypi-package: wheel + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" environment: contents: packages: - busybox - - ca-certificates-bundle - - py3-flit-core - - py3-gpep517 - - python3 - - wolfi-base + - py3-supported-python pipeline: - uses: git-checkout @@ -27,11 +31,36 @@ pipeline: tag: ${{package.version}} expected-commit: fa33dfd01fd665c1fd90097563b34bce4b5527ef - - runs: | - python3 -m gpep517 build-wheel --wheel-dir dist --output-fd 1 - python3 -m installer -d "${{targets.destdir}}" dist/wheel-${{package.version}}-py3-none-any.whl +subpackages: + - range: py-versions + name: py${{range.key}}-${{vars.pypi-package}} + description: ${{vars.pypi-package}} installed for python${{range.key}} + pipeline: + - uses: py/pip-build-install-bootstrap + with: + python: python${{range.key}} + + - 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}} + provides: + - py3-${{vars.pypi-package}} + provider-priority: ${{range.value}} + pipeline: + - runs: | + mkdir -p ${{targets.contextdir}}/usr + mv ${{targets.contextdir}}/../py${{range.key}}-${{vars.pypi-package}}/usr/bin ${{targets.contextdir}}/usr - - 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}} update: enabled: true diff --git a/py3.10-installer.yaml b/py3.10-installer.yaml deleted file mode 100644 index 58f59fcad57..00000000000 --- a/py3.10-installer.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Generated from https://pypi.org/project/installer/ -package: - name: py3.10-installer - version: 0.7.0 # When bumping this, also bump the provides below! - epoch: 4 - description: A library for installing Python wheels. - copyright: - - license: "MIT" - dependencies: - runtime: - - python-3.10 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3.10-pip - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/pypa/installer.git - tag: ${{package.version}} - expected-commit: b1d39180f8548820d09ce992dfadff0a42242c48 - - - name: Python Install - runs: pip install . --prefix=/usr --root=${{targets.destdir}} - - - uses: strip - -update: - enabled: true - github: - identifier: pypa/installer - use-tag: true diff --git a/py3.10-pip.yaml b/py3.10-pip.yaml deleted file mode 100644 index 09a13cf9220..00000000000 --- a/py3.10-pip.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Generated from https://pypi.org/project/pip/ -package: - name: py3.10-pip - version: "24.0" - epoch: 1 - description: The PyPA recommended tool for installing Python packages. - copyright: - - license: MIT - dependencies: - runtime: - - python-3.10 - - py3.10-setuptools - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3.10-setuptools - - python-3.10 - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/pypa/pip - expected-commit: ef78c129b1a966dbbbdb8ebfffc43723e89110d1 - tag: ${{package.version}} - - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - uses: strip - -update: - enabled: true - ignore-regex-patterns: - - 'b' - shared: true - github: - identifier: pypa/pip - use-tag: true diff --git a/py3.10-setuptools.yaml b/py3.10-setuptools.yaml deleted file mode 100644 index a8105041a83..00000000000 --- a/py3.10-setuptools.yaml +++ /dev/null @@ -1,39 +0,0 @@ -package: - name: py3.10-setuptools - version: 70.0.0 - epoch: 0 - description: Easily download, build, install, upgrade, and uninstall Python packages - copyright: - - license: "MIT" - dependencies: - runtime: - - python-3.10 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - python-3.10 - - wolfi-base - -pipeline: - - uses: fetch - with: - expected-sha256: f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0 - uri: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-${{package.version}}.tar.gz - - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - uses: strip - -update: - enabled: true - shared: true - release-monitor: - identifier: 4021 diff --git a/py3.11-installer.yaml b/py3.11-installer.yaml deleted file mode 100644 index 01e4ceba23a..00000000000 --- a/py3.11-installer.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# Generated from https://pypi.org/project/installer/ -package: - name: py3.11-installer - version: 0.7.0 # When bumping this, also bump the provides below! - epoch: 3 - description: A library for installing Python wheels. - copyright: - - license: "MIT" - dependencies: - provides: - - py3-installer=${{package.full-version}} - runtime: - - python-3.11 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3.11-pip - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/pypa/installer.git - tag: ${{package.version}} - expected-commit: b1d39180f8548820d09ce992dfadff0a42242c48 - - - name: Python Install - runs: pip install . --prefix=/usr --root=${{targets.destdir}} - - - uses: strip - -update: - enabled: true - github: - identifier: pypa/installer - use-tag: true diff --git a/py3.11-pip.yaml b/py3.11-pip.yaml deleted file mode 100644 index 8eab4bb01fa..00000000000 --- a/py3.11-pip.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Generated from https://pypi.org/project/pip/ -package: - name: py3.11-pip - version: "24.0" - epoch: 1 - description: The PyPA recommended tool for installing Python packages. - copyright: - - license: MIT - dependencies: - provides: - - py3-pip=23.1.999 - runtime: - - python-3.11 - - py3.11-setuptools - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3.11-setuptools - - python-3.11 - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/pypa/pip - expected-commit: ef78c129b1a966dbbbdb8ebfffc43723e89110d1 - tag: ${{package.version}} - - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - uses: strip - -update: - enabled: true - ignore-regex-patterns: - - 'b' - shared: true - github: - identifier: pypa/pip - use-tag: true diff --git a/py3.11-setuptools.yaml b/py3.11-setuptools.yaml deleted file mode 100644 index 9ef4914672e..00000000000 --- a/py3.11-setuptools.yaml +++ /dev/null @@ -1,39 +0,0 @@ -package: - name: py3.11-setuptools - version: 70.0.0 # When bumping this, also bump the provides below! - epoch: 0 - description: Easily download, build, install, upgrade, and uninstall Python packages - copyright: - - license: "MIT" - dependencies: - provides: - - py3-setuptools=69.0.0 # force the provides version lower than the py3.12-setuptools provides, so that the apk resolver favours py3.12-setuptools - runtime: - - python-3.11 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - python-3.11 - - wolfi-base - -pipeline: - - uses: fetch - with: - expected-sha256: f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0 - uri: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-${{package.version}}.tar.gz - - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" - -update: - enabled: true - shared: true - release-monitor: - identifier: 4021 diff --git a/py3.12-installer.yaml b/py3.12-installer.yaml deleted file mode 100644 index 63fec9c98be..00000000000 --- a/py3.12-installer.yaml +++ /dev/null @@ -1,39 +0,0 @@ -package: - name: py3.12-installer - version: 0.7.0 - epoch: 6 - description: A library for installing Python wheels. - copyright: - - license: "MIT" - dependencies: - provides: - - py3-installer=${{package.full-version}} - runtime: - - python-3.12 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3.12-pip - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/pypa/installer.git - tag: ${{package.version}} - expected-commit: b1d39180f8548820d09ce992dfadff0a42242c48 - - - name: Python Install - runs: pip install . --prefix=/usr --root=${{targets.destdir}} - - - uses: strip - -update: - enabled: true - github: - identifier: pypa/installer - use-tag: true diff --git a/py3.12-pip.yaml b/py3.12-pip.yaml deleted file mode 100644 index 8444d960e99..00000000000 --- a/py3.12-pip.yaml +++ /dev/null @@ -1,47 +0,0 @@ -package: - name: py3.12-pip - version: "24.0" - epoch: 2 - description: The PyPA recommended tool for installing Python packages. - copyright: - - license: MIT - dependencies: - provides: - - py3-pip=${{package.full-version}} - runtime: - - py3.12-setuptools - - python-3.12 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - py3.12-setuptools - - python-3.12 - - wolfi-base - -pipeline: - - uses: git-checkout - with: - repository: https://github.com/pypa/pip - expected-commit: ef78c129b1a966dbbbdb8ebfffc43723e89110d1 - tag: ${{package.version}} - - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - uses: strip - -update: - enabled: true - ignore-regex-patterns: - - 'b' - shared: true - github: - identifier: pypa/pip - use-tag: true diff --git a/py3.12-setuptools.yaml b/py3.12-setuptools.yaml deleted file mode 100644 index e870827e520..00000000000 --- a/py3.12-setuptools.yaml +++ /dev/null @@ -1,39 +0,0 @@ -package: - name: py3.12-setuptools - version: 70.0.0 - epoch: 0 - description: Easily download, build, install, upgrade, and uninstall Python packages - copyright: - - license: "MIT" - dependencies: - provides: - - py3-setuptools=${{package.full-version}} - runtime: - - python-3.12 - -environment: - contents: - packages: - - build-base - - busybox - - ca-certificates-bundle - - python-3.12 - - wolfi-base - -pipeline: - - uses: fetch - with: - expected-sha256: f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0 - uri: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-${{package.version}}.tar.gz - - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" --skip-build - -update: - enabled: true - shared: true - release-monitor: - identifier: 4021