2022-10-27 07:36:26 +03:00
|
|
|
distributable:
|
|
|
|
url: https://github.com/pypa/pip/archive/refs/tags/{{version.raw}}.tar.gz
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
|
|
|
github: pypa/pip/tags
|
2023-07-11 01:41:15 +03:00
|
|
|
# FIXME: the major prior to 18 is 10, which is ancient and doesn't currently work
|
|
|
|
ignore: ['<18']
|
2022-10-27 07:36:26 +03:00
|
|
|
|
|
|
|
dependencies:
|
2024-01-05 19:38:07 +03:00
|
|
|
pkgx.sh: ^1
|
2023-02-27 17:27:27 +03:00
|
|
|
|
2022-10-27 07:36:26 +03:00
|
|
|
build:
|
|
|
|
dependencies:
|
2024-01-07 13:10:53 +03:00
|
|
|
python.org: ~3.11
|
2024-01-05 19:38:07 +03:00
|
|
|
crates.io/semverator: ^0.4.3
|
|
|
|
script:
|
|
|
|
- pkgx curl -O https://bootstrap.pypa.io/get-pip.py
|
|
|
|
|
2024-01-07 13:10:53 +03:00
|
|
|
- rm -rf bootstrap && mkdir bootstrap
|
|
|
|
- python get-pip.py --target=bootstrap
|
|
|
|
|
|
|
|
- PYTHONPATH=$PWD/bootstrap
|
|
|
|
python -m pip install .
|
|
|
|
--target={{prefix}}/libexec
|
|
|
|
|
2024-01-06 17:22:14 +03:00
|
|
|
- run:
|
2024-01-07 13:10:53 +03:00
|
|
|
# FIXME 3.7 *should* work but doesn't
|
2024-01-06 17:22:14 +03:00
|
|
|
- v=3.7
|
2022-10-27 07:36:26 +03:00
|
|
|
|
2024-01-07 13:10:53 +03:00
|
|
|
# Python 3.12 had various breaking changes (semver is meaningless
|
|
|
|
# apparently) and thus pip less than 23.1.2 will not work with it
|
|
|
|
# FIXME hardcoding 3.12 sucks
|
|
|
|
- |
|
|
|
|
if semverator lt {{version}} 23.1.2; then
|
|
|
|
vMax=3.11
|
|
|
|
else
|
|
|
|
vMax=3.12
|
|
|
|
fi
|
|
|
|
|
|
|
|
- while semverator lt $v $vMax; do
|
|
|
|
- v=$(semverator bump $v minor | cut -d. -f1,2)
|
2022-10-27 07:36:26 +03:00
|
|
|
|
2024-01-06 17:22:14 +03:00
|
|
|
- |
|
|
|
|
install -D $PROP {{prefix}}/bin/pip$v
|
|
|
|
echo "exec pkgx python@$v \"\$d/bin/pip\" \"\$@\"" >> {{prefix}}/bin/pip$v
|
|
|
|
- done
|
2024-01-07 13:10:53 +03:00
|
|
|
|
|
|
|
# FIXME hardcoded `3`
|
|
|
|
- |
|
|
|
|
install -D $PROP {{prefix}}/bin/pip3
|
2024-01-07 13:35:22 +03:00
|
|
|
if semverator lt {{version}} 23.1.2; then
|
|
|
|
python="'python<3.12'"
|
|
|
|
else
|
|
|
|
python=python@3
|
|
|
|
fi
|
|
|
|
echo "exec pkgx $python \"\$d/bin/pip\" \"\$@\"" >> {{prefix}}/bin/pip3
|
2024-01-07 13:10:53 +03:00
|
|
|
|
|
|
|
- |
|
|
|
|
install -D $PROP {{prefix}}/bin/pip
|
2024-01-07 13:35:22 +03:00
|
|
|
if semverator lt {{version}} 23.1.2; then
|
|
|
|
python="'python<3.12'"
|
|
|
|
else
|
|
|
|
python=python
|
|
|
|
fi
|
|
|
|
echo "exec pkgx $python \"\$d/bin/pip\" \"\$@\"" >> {{prefix}}/bin/pip
|
2024-01-07 13:10:53 +03:00
|
|
|
|
2024-01-05 19:38:07 +03:00
|
|
|
prop: |
|
|
|
|
#!/bin/sh
|
2024-01-07 13:10:53 +03:00
|
|
|
d="$(cd "$(dirname "$0")"/.. && pwd)/libexec"
|
2024-01-05 19:38:07 +03:00
|
|
|
export PIP_DISABLE_PIP_VERSION_CHECK=1
|
2024-01-06 14:44:11 +03:00
|
|
|
if [ -n "$PYTHONPATH" ]; then
|
|
|
|
export PYTHONPATH="$d:$PYTHONPATH"
|
|
|
|
else
|
|
|
|
export PYTHONPATH="$d"
|
|
|
|
fi
|
2024-01-05 19:38:07 +03:00
|
|
|
|
2024-01-07 13:10:53 +03:00
|
|
|
# cleanup unused files
|
|
|
|
- rm {{prefix}}/libexec/bin/pip?*
|
2024-01-06 17:22:14 +03:00
|
|
|
|
2024-01-07 13:10:53 +03:00
|
|
|
- fix-shebangs.ts {{prefix}}/libexec/bin/*
|
2022-10-27 07:36:26 +03:00
|
|
|
|
|
|
|
test:
|
2024-01-05 19:38:07 +03:00
|
|
|
- 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
|
2022-10-27 07:36:26 +03:00
|
|
|
|
2024-01-06 14:44:11 +03:00
|
|
|
- pip --version | grep {{prefix}}
|
2024-01-06 17:22:14 +03:00
|
|
|
- pip --version | grep {{version}}
|
2024-01-06 14:44:11 +03:00
|
|
|
|
2024-01-07 13:35:22 +03:00
|
|
|
- run: |
|
|
|
|
for v in 3.8 3.9 3.10 3.11; do
|
|
|
|
test $(pip$v inspect | pkgx jq --raw-output .environment.python_version) = $v
|
|
|
|
done
|
|
|
|
if: '>=22' # inspect command introduced at v22
|
2024-01-07 13:10:53 +03:00
|
|
|
|
2022-10-27 07:36:26 +03:00
|
|
|
provides:
|
|
|
|
- bin/pip
|
2024-01-07 13:10:53 +03:00
|
|
|
- bin/pip3.8
|
|
|
|
- bin/pip3.9
|
|
|
|
- bin/pip3.10
|
|
|
|
- bin/pip3.11
|
2024-01-07 13:16:07 +03:00
|
|
|
#FIXME - bin/pip3.12
|
2023-03-23 15:51:59 +03:00
|
|
|
#FIXME - bin/pip{{deps.python.org.version.major}}
|