Skip to content

Commit

Permalink
py3-cairo: Add python multiversion support
Browse files Browse the repository at this point in the history
Signed-off-by: dann frazier <[email protected]>
  • Loading branch information
dannf committed Nov 17, 2024
1 parent 5a14dc0 commit 51ba04b
Showing 1 changed file with 72 additions and 8 deletions.
80 changes: 72 additions & 8 deletions py3-cairo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@ package:
copyright:
- license: LGPL-2.0-or-later
dependencies:
runtime:
- python3
provider-priority: 0

vars:
pypi-package: cairo
import: cairo

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

environment:
contents:
Expand All @@ -21,9 +32,10 @@ environment:
- fontconfig-dev
- freetype-dev
- libpng-dev
- meson
- openssf-compiler-options
- python3-dev
- py3-supported-meson-python
- py3-supported-pip
- py3-supported-python-dev
- zlib-dev

pipeline:
Expand All @@ -42,18 +54,70 @@ pipeline:

- uses: meson/install

- runs: python3 -m compileall "${{targets.destdir}}"/usr/lib
- runs: |
# python-version-specific files will be provided by subpackages
rm -rf ${{targets.destdir}}/usr/lib/python*
- uses: strip

subpackages:
- name: py3-cairo-dev
- 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}}
pipeline:
- uses: split/dev
- uses: py/pip-build-install
with:
python: python${{range.key}}
- uses: strip
test:
pipeline:
- uses: python/import
with:
python: python${{range.key}}
import: ${{vars.import}}
environment:
contents:
packages:
- py3-supported-${{vars.pypi-package}}

- name: py3-supported-${{vars.pypi-package}}
description: meta package providing ${{vars.pypi-package}} for supported python versions.
dependencies:
runtime:
- py3-cairo
- 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:
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: py3-cairo-dev
description: py3-cairo dev
dependencies:
runtime:
- py3-cairo
pipeline:
- uses: split/dev

update:
enabled: true
Expand Down

0 comments on commit 51ba04b

Please sign in to comment.