k so obviously pip3.8 needs python3.8

This commit is contained in:
Max Howell 2024-01-06 09:22:14 -05:00
parent ce5a5d4054
commit d6e1bc9577

View file

@ -12,39 +12,34 @@ dependencies:
build:
dependencies:
python.org: ^3.7
crates.io/semverator: ^0.4.3
script:
- pkgx curl -O https://bootstrap.pypa.io/get-pip.py
- test -d bootstrap || mkdir bootstrap
# 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)
- python get-pip.py --target="$(pwd)/bootstrap"
- rm -rf bootstrap && mkdir bootstrap
- pkgx python@$v get-pip.py --target=bootstrap
- PYTHONPATH=$(pwd)/bootstrap python -m pip install . --target={{prefix}}/lib
- 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
# provide pip3.7 — pip3.12 (or whatever is latest)
# they will automatically use the correct python versions
- run: |
v=3.6
while semverator lt $v {{deps.python.org.version.marketing}}; do
v=$(semverator bump $v minor | cut -d. -f1,2)
cp $PROP pip$v
echo "exec pkgx python@$v \"\$d/bin/pip\" \"\$@\"" >> pip$v
done
cp $PROP pip{{ deps.python.org.version.major }}
echo 'exec pkgx python@{{ deps.python.org.version.major }} "$d/bin/pip" "$@"' >> pip{{ deps.python.org.version.major }}
cp $PROP pip
echo 'exec pkgx python "$d/bin/pip" "$@"' >> pip
rm {{prefix}}/lib/bin/pip?*
working-directory:
${{prefix}}/bin
- vMax=$v
- done
prop: |
#!/bin/sh
d="$(cd "$(dirname "$0")"/.. && pwd)/lib"
d="$(cd "$(dirname "$0")"/.. && pwd)/py{{v}}"
export PIP_DISABLE_PIP_VERSION_CHECK=1
if [ -n "$PYTHONPATH" ]; then
export PYTHONPATH="$d:$PYTHONPATH"
@ -52,7 +47,14 @@ build:
export PYTHONPATH="$d"
fi
- fix-shebangs.ts {{prefix}}/bin/*
# 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 .
@ -65,6 +67,7 @@ test:
- test -f findtui/main.py
- pip --version | grep {{prefix}}
- pip --version | grep {{version}}
provides:
- bin/pip