From c800079690a2e2e7fb53d8409ceb2526cededfc5 Mon Sep 17 00:00:00 2001 From: srishtih Date: Mon, 19 Aug 2024 16:36:55 -0700 Subject: [PATCH] Add python versioned py3-pycparser (#26681) Signed-off-by: Srishti Hegde --- py3-pycparser.yaml | 63 ++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/py3-pycparser.yaml b/py3-pycparser.yaml index 954fd850c4b..2e297e8b47a 100644 --- a/py3-pycparser.yaml +++ b/py3-pycparser.yaml @@ -2,13 +2,12 @@ package: name: py3-pycparser version: "2.22" - epoch: 1 + epoch: 2 description: C parser in Python copyright: - license: BSD-3-Clause dependencies: - runtime: - - python3 + provider-priority: 0 environment: contents: @@ -16,10 +15,24 @@ environment: - build-base - busybox - ca-certificates-bundle - - py3-setuptools - - python3 + - py3-supported-installer + - py3-supported-pip + - py3-supported-pytest + - py3-supported-python + - py3-supported-setuptools + - py3-supported-wheel - wolfi-base +vars: + pypi-package: pycparser + +data: + - name: py-versions + items: + 3.10: "310" + 3.11: "311" + 3.12: "312" + pipeline: - uses: git-checkout with: @@ -27,16 +40,27 @@ pipeline: tag: release_v${{package.version}} expected-commit: 129d32ef805d715d90a3b2035b13168c17ca63d2 - - name: Python Build - runs: python setup.py build - - - name: Python Install - runs: python setup.py install --prefix=/usr --root="${{targets.destdir}}" - - - name: Python Unit Test - runs: python setup.py test -s tests - - - uses: strip +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}} + - runs: | + python${{range.key}} -m pytest tests/ + - uses: strip + test: + pipeline: + - uses: python/import + with: + python: python${{range.key}} + import: ${{vars.pypi-package}} update: enabled: true @@ -47,12 +71,3 @@ update: identifier: eliben/pycparser strip-prefix: release_v use-tag: true - -test: - environment: - contents: - packages: - - python3 - pipeline: - - runs: | - python -c "import pycparser; print(pycparser.__version__)"