From fae90ff2c74b658a15b14ebabfb1abaa9ee5e136 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 7 Jan 2024 05:35:22 -0500 Subject: [PATCH] Fix pip < 23.1 --- projects/pip.pypa.io/package.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/projects/pip.pypa.io/package.yml b/projects/pip.pypa.io/package.yml index fe7fd01e..72d12211 100644 --- a/projects/pip.pypa.io/package.yml +++ b/projects/pip.pypa.io/package.yml @@ -49,11 +49,21 @@ build: # FIXME hardcoded `3` - | install -D $PROP {{prefix}}/bin/pip3 - echo "exec pkgx python@3 \"\$d/bin/pip\" \"\$@\"" >> {{prefix}}/bin/pip3 + 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 - | install -D $PROP {{prefix}}/bin/pip - echo "exec pkgx python \"\$d/bin/pip\" \"\$@\"" >> {{prefix}}/bin/pip + 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 prop: | #!/bin/sh @@ -83,10 +93,11 @@ test: - pip --version | grep {{prefix}} - pip --version | grep {{version}} - - | - 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 + - 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 provides: - bin/pip