pip / pipenv tweaks

* Some older pipenv versions break with python 3.12
* pip was actually running via the vendored python pip site package and not ours :/
This commit is contained in:
Max Howell 2024-01-06 06:44:11 -05:00
parent 89a2f0e910
commit e4872f02d1
2 changed files with 15 additions and 8 deletions

View file

@ -30,25 +30,29 @@ build:
while semverator lt $v {{deps.python.org.version.marketing}}; do while semverator lt $v {{deps.python.org.version.marketing}}; do
v=$(semverator bump $v minor | cut -d. -f1,2) v=$(semverator bump $v minor | cut -d. -f1,2)
cp $PROP pip$v cp $PROP pip$v
echo "exec pkgx python@$v \"\$d/lib/bin/pip\" \"\$@\"" >> pip$v echo "exec pkgx python@$v \"\$d/bin/pip\" \"\$@\"" >> pip$v
done done
cp $PROP pip{{ deps.python.org.version.major }} cp $PROP pip{{ deps.python.org.version.major }}
echo 'exec pkgx python@{{ deps.python.org.version.major }} "$d/lib/bin/pip" "$@"' >> 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 cp $PROP pip
echo 'exec pkgx python "$d/lib/bin/pip" "$@"' >> pip echo 'exec pkgx python "$d/bin/pip" "$@"' >> pip
rm {{prefix}}/lib/bin/pip?* rm {{prefix}}/lib/bin/pip?*
working-directory: working-directory:
${{prefix}}/bin ${{prefix}}/bin
prop: | prop: |
#!/bin/sh #!/bin/sh
d="$(cd "$(dirname "$0")"/.. && pwd)" d="$(cd "$(dirname "$0")"/.. && pwd)/lib"
export PIP_DISABLE_PIP_VERSION_CHECK=1 export PIP_DISABLE_PIP_VERSION_CHECK=1
export PYTHONPATH="$d:$PYTHONPATH" if [ -n "$PYTHONPATH" ]; then
export PYTHONPATH="$d:$PYTHONPATH"
else
export PYTHONPATH="$d"
fi
- fix-shebangs.ts {{prefix}}/lib/bin/* - fix-shebangs.ts {{prefix}}/bin/*
test: test:
- run: pkgx +python.org~3.9 pip install findtui --target . - run: pkgx +python.org~3.9 pip install findtui --target .
@ -60,6 +64,8 @@ test:
- test -f findtui/main.py - test -f findtui/main.py
- pip --version | grep {{prefix}}
provides: provides:
- bin/pip - bin/pip
#FIXME - bin/pip{{deps.python.org.version.major}} #FIXME - bin/pip{{deps.python.org.version.major}}

View file

@ -14,7 +14,7 @@ dependencies:
build: build:
dependencies: dependencies:
python.org: '*' # we want the latest python and should restock when it bumps python.org: ~3.11 # approx. 3 older versions wont work with python 3.12
crates.io/semverator: '*' crates.io/semverator: '*'
script: script:
- bkpyvenv stage {{prefix}} {{version}} - bkpyvenv stage {{prefix}} {{version}}
@ -26,7 +26,8 @@ build:
${{prefix}}/bin ${{prefix}}/bin
run: | run: |
v=3.6 v=3.6
while semverator lt $v {{deps.python.org.version.marketing}}; do vMax=3.12 #FIXME determine dynamically or even script this in the shim
while semverator lt $v $vMax; do
v=$(semverator bump $v minor | cut -d. -f1,2) v=$(semverator bump $v minor | cut -d. -f1,2)
echo '#!/bin/sh' > python$v echo '#!/bin/sh' > python$v
echo "exec pkgx python~$v \"\$@\"" >> python$v echo "exec pkgx python~$v \"\$@\"" >> python$v