Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions cython.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions numpy.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions pip-zipapp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package:
name: pip-zipapp
version: 24.0
epoch: 0
description: "Pip as a python zipapp"
copyright:
- license: MIT

environment:
contents:
packages:
- busybox

pipeline:
- uses: fetch
with:
uri: https://bootstrap.pypa.io/pip/zipapp/pip-${{package.version}}.pyz
expected-sha256: 1af141650f2b1e71bf9d856db74324042b4bfe3a36c37f8c2b3e2d8d6b3da411
extract: false

- runs: |
destd=${{targets.destdir}}
sdir=usr/share/${{package.name}}
fname=${{package.name}}.pyz
mkdir -p "$destd/$sdir"
cp "pip-${{package.version}}.pyz" "$destd/$sdir/$fname"
chmod 0644 "$destd/$sdir/$fname"

update:
enabled: true
github:
identifier: pypa/pip
28 changes: 28 additions & 0 deletions pipelines/py/collect-wheels.yaml
Original file line number Diff line number Diff line change
@@ -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}}"
57 changes: 57 additions & 0 deletions pipelines/py/pip-build-install-bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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: false
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="$tmpd/dist-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" install --verbose --no-deps \
--force-reinstall --no-compile --prefix=/usr "--root=$root" .
else
vr "$py" "$pipzip" wheel --verbose "--wheel-dir=$wd" \
"--find-links=$distwheelsd" --no-index --no-build-isolation --no-deps .
set -- "$wd"/*.whl
[ -f "$1" ] || { info "did not produce a wheel in $wd"; exit 1; }
info "produced $# wheels: $*"
vr "$py" "$pipzip" 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"
46 changes: 46 additions & 0 deletions pipelines/py/pip-build-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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"

- name: "compileall ${{inputs.python}}"
runs: |
pyver=$(${{inputs.python}} -c 'import sys; print("%s.%s" % (sys.version_info.major, sys.version_info.minor))')
for bin in ${{inputs.dest}}/usr/bin/*; do
[ -f "$bin" ] && [ -x "$bin" ] || continue
d="${{inputs.dest}}/usr/pybin/$pyver"
[ -d "$d" ] || mkdir -p "$d"
mv "$bin" "$d/"
echo "moved $bin -> $d/"
done
64 changes: 64 additions & 0 deletions py3-cython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package:
name: py3-cython
version: 3.0.9
epoch: 1
description: Cython is an optimising static compiler for both the Python & the extended Cython programming languages.
copyright:
- license: Apache-2.0
dependencies:
runtime:
- py3.12-${{vars.pypi-package}}
provides:
- cython=${{package.version}}

vars:
pypi-package: cython

data:
- name: py-versions
items:
3.10: ""
3.11: ""
3.12: ""

environment:
contents:
packages:
- build-base
- busybox
- ca-certificates-bundle
- py3-supported-pip
- py3-supported-python-dev
- py3-supported-wheel

pipeline:
- uses: fetch
with:
expected-sha256: ca7758a3a87340a93f5bde4747e4a5ff1708cf2df407dee533b63ef6cc845777
uri: https://github.com/cython/cython/archive/${{package.version}}.tar.gz

subpackages:
- range: py-versions
name: py${{range.key}}-${{vars.pypi-package}}
pipeline:
- uses: py/pip-build-install
with:
python: python${{range.key}}
- uses: strip

- name: py3-wheels-${{vars.pypi-package}}
pipeline:
- uses: py/collect-wheels

- 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: cython/cython
Loading