Skip to content

Commit

Permalink
python/multi-version batch 13 (#30471)
Browse files Browse the repository at this point in the history
Convert packages to python multi-version.

This is part of a series of programatic changes to
add the ability to support python packages for multiple
python versions.
  • Loading branch information
smoser authored Oct 9, 2024
1 parent 71f4212 commit 12869a8
Show file tree
Hide file tree
Showing 17 changed files with 1,013 additions and 309 deletions.
68 changes: 54 additions & 14 deletions py3-awslambdaric.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
package:
name: py3-awslambdaric
version: 2.2.1
epoch: 1
epoch: 2
description: AWS Lambda Runtime Interface Client for Python
copyright:
- license: Apache-2.0
dependencies:
runtime:
- python-3.12
provider-priority: 0

vars:
pypi-package: awslambdaric
import: awslambdaric

data:
- name: py-versions
items:
3.10: '310'
3.11: '311'
3.12: '312'
3.13: '300'

environment:
contents:
packages:
- autoconf
- automake
- aws-crt-cpp-dev
- build-base
- busybox
- ca-certificates-bundle
- cmake
- libtool
- make
- openssf-compiler-options
- openssl-dev
- py3-gpep517
- py3-setuptools
- py3-wheel
- python3-dev
- wolfi-base
- py3-supported-build-base-dev
- py3-supported-gpep517

pipeline:
- uses: git-checkout
Expand All @@ -33,10 +41,42 @@ pipeline:
tag: ${{package.version}}
expected-commit: 2fe3ecab9c184667a9633095dded480c4ca9c147

- name: make build
runs: make build
subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
description: python${{range.key}} version of ${{vars.pypi-package}}
dependencies:
provider-priority: ${{range.value}}
provides:
- py3-${{vars.pypi-package}}
pipeline:
- uses: py/pip-build-install
with:
python: python${{range.key}}
- uses: strip
test:
pipeline:
- uses: python/import
with:
python: python${{range.key}}
imports: |
import ${{vars.import}}
- 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}}

- uses: strip
test:
pipeline:
- uses: python/import
with:
imports: |
import ${{vars.import}}
update:
enabled: true
Expand Down
114 changes: 84 additions & 30 deletions py3-babel.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,111 @@
package:
name: py3-babel
version: 2.16.0
epoch: 0
epoch: 1
description: Python3 i18n tool
copyright:
- license: BSD-3-Clause
dependencies:
runtime:
- python3
provider-priority: 0

vars:
pypi-package: babel
import: babel

data:
- name: py-versions
items:
3.10: '310'
3.11: '311'
3.12: '312'
3.13: '300'

environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- py3-setuptools
- python3
- wolfi-base
- py3-supported-build-base

pipeline:
- uses: fetch
with:
uri: https://files.pythonhosted.org/packages/source/B/Babel/babel-${{package.version}}.tar.gz
expected-sha256: d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316

- name: Python Build
runs: python setup.py build
subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
description: python${{range.key}} version of ${{vars.pypi-package}}
dependencies:
provider-priority: ${{range.value}}
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}}
imports: |
import ${{vars.import}}
- name: Python Install
runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}"
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}-bin
description: Executable binaries for ${{vars.pypi-package}} installed for python${{range.key}}
dependencies:
provider-priority: ${{range.value}}
provides:
- py3-${{vars.pypi-package}}
- py3-${{vars.pypi-package}}-bin
runtime:
- py${{range.key}}-${{vars.pypi-package}}
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/usr/
mv ./cleanup/${{range.key}}/bin ${{targets.contextdir}}/usr/
test:
environment:
contents:
packages:
- apk-tools
pipeline:
- runs: |
apk info -L py${{range.key}}-${{vars.pypi-package}}-bin > "pkg.list"
echo "Please write a test for these:"
grep usr/bin/ pkg.list > bins.list
sed 's,^,> ,' bins.list
- uses: strip
while read line; do
echo == /$line ==
/$line --help && echo exited 0 || echo "exited $?"
done < bins.list
update:
enabled: true
shared: true
release-monitor:
identifier: 11984
- 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}}

test:
pipeline:
- uses: python/import
with:
imports: |
import ${{vars.import}}
- runs: |
LIBRARY="babel"
IMPORT_STATEMENT="import babel"
if ! python -c "$IMPORT_STATEMENT"; then
echo "Failed to import library '$LIBRARY'."
python -c "$IMPORT_STATEMENT" 2>&1
exit 1
else
echo "Library '$LIBRARY' is installed and can be imported successfully."
exit 0
fi
pybabel --version
pybabel --help
update:
enabled: true
shared: true
release-monitor:
identifier: 11984
69 changes: 52 additions & 17 deletions py3-cli-helpers.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# Generated from https://pypi.org/project/cli-helpers/
package:
name: py3-cli-helpers
version: 2.3.1
epoch: 0
epoch: 1
description: Helpers for building command-line apps
copyright:
- license: BSD-3-Clause
dependencies:
runtime:
- py3-configobj
- py3-tabulate
- python3
provider-priority: 0

vars:
pypi-package: cli-helpers
import: cli_helpers

data:
- name: py-versions
items:
3.10: '310'
3.11: '311'
3.12: '312'
3.13: '300'

environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- py3-setuptools
- python3
- wolfi-base
- py3-supported-build-base

pipeline:
- uses: git-checkout
Expand All @@ -29,13 +32,45 @@ pipeline:
tag: v${{package.version}}
expected-commit: 75e1b3af90c06f0138cd70bb2a4df39eed372d74

- name: Python Build
runs: python setup.py build
subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
description: python${{range.key}} version of ${{vars.pypi-package}}
dependencies:
provider-priority: ${{range.value}}
provides:
- py3-${{vars.pypi-package}}
runtime:
- py${{range.key}}-configobj
- py${{range.key}}-tabulate
pipeline:
- uses: py/pip-build-install
with:
python: python${{range.key}}
- uses: strip
test:
pipeline:
- uses: python/import
with:
python: python${{range.key}}
imports: |
import ${{vars.import}}
- name: Python Install
runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}"
- 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}}

- uses: strip
test:
pipeline:
- uses: python/import
with:
imports: |
import ${{vars.import}}
update:
enabled: true
Expand Down
Loading

0 comments on commit 12869a8

Please sign in to comment.