pantry/projects/pip.pypa.io/package.yml
2024-01-06 09:26:58 -05:00

75 lines
1.8 KiB
YAML

distributable:
url: https://github.com/pypa/pip/archive/refs/tags/{{version.raw}}.tar.gz
strip-components: 1
versions:
github: pypa/pip/tags
# FIXME: the major prior to 18 is 10, which is ancient and doesn't currently work
ignore: ['<18']
dependencies:
pkgx.sh: ^1
build:
dependencies:
crates.io/semverator: ^0.4.3
script:
- pkgx curl -O https://bootstrap.pypa.io/get-pip.py
# build a pip for every python
# FIXME hardcoding 3.12 sucks
# FIXME 3.7 *should* work but doesn't
- run:
- v=3.7
- while semverator lt $v 3.12; do
- v=$(semverator bump $v minor | cut -d. -f1,2)
- rm -rf bootstrap && mkdir bootstrap
- pkgx python@$v get-pip.py --target=bootstrap
- PYTHONPATH=$PWD/bootstrap
pkgx python@$v -m pip install .
--target={{prefix}}/py$v
- |
install -D $PROP {{prefix}}/bin/pip$v
sed -i s/{{v}}/$v/ {{prefix}}/bin/pip$v
echo "exec pkgx python@$v \"\$d/bin/pip\" \"\$@\"" >> {{prefix}}/bin/pip$v
- vMax=$v
- done
prop: |
#!/bin/sh
d="$(cd "$(dirname "$0")"/.. && pwd)/py{{v}}"
export PIP_DISABLE_PIP_VERSION_CHECK=1
if [ -n "$PYTHONPATH" ]; then
export PYTHONPATH="$d:$PYTHONPATH"
else
export PYTHONPATH="$d"
fi
# FIXME hardcoded `3`
- run: |
ln -s pip$vMax pip3
ln -s pip$vMax pip
working-directory:
${{prefix}}/bin
- fix-shebangs.ts {{prefix}}/py*/bin/*
test:
- run: pkgx +python.org~3.9 pip install findtui --target .
if: ~18
- run:
- pip install findtui --target foo
- pip3.10 install findtui --target .
if: '>=19'
- test -f findtui/main.py
- pip --version | grep {{prefix}}
- pip --version | grep {{version}}
provides:
- bin/pip
#FIXME - bin/pip{{deps.python.org.version.major}}