diff --git a/projects/pip.pypa.io/package.yml b/projects/pip.pypa.io/package.yml index 9fe04000..4be5737b 100644 --- a/projects/pip.pypa.io/package.yml +++ b/projects/pip.pypa.io/package.yml @@ -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