Compare commits

...

3 Commits

Author SHA1 Message Date
rockandska
ed8b6d6247
Merge 95775e4788 into 7881c26b5a 2025-09-16 17:57:14 +03:00
Michael Šimáček
7881c26b5a
Add GraalPy 25.0 (#3331)
Some checks are pending
macos_build / macos_build (3.10) (push) Waiting to run
macos_build / macos_build (3.11) (push) Waiting to run
macos_build / macos_build (3.12) (push) Waiting to run
macos_build / macos_build (3.13) (push) Waiting to run
macos_build / macos_build (3.9) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-13) (push) Waiting to run
pyenv_tests / pyenv_tests (macos-14) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Waiting to run
pyenv_tests / pyenv_tests (ubuntu-24.04) (push) Waiting to run
ubuntu_build / ubuntu_build (3.10) (push) Waiting to run
ubuntu_build / ubuntu_build (3.11) (push) Waiting to run
ubuntu_build / ubuntu_build (3.12) (push) Waiting to run
ubuntu_build / ubuntu_build (3.13) (push) Waiting to run
ubuntu_build / ubuntu_build (3.9) (push) Waiting to run
2025-09-16 17:57:02 +03:00
Christian Fredrik Johnsen
95775e4788 upgrade pip detetcion in pip-rehash to accept multiple variations:
- pip
- pip3
- pip3.10
- python -m pip
- uv pip

tests added in new pyenv-rehash file

Co-authored-by: Christian Fredrik Johnsen <christian@johnsen.no>
2025-09-16 10:38:52 +02:00
4 changed files with 196 additions and 0 deletions

View File

@ -0,0 +1,64 @@
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
VERSION='25.0.0'
BUILD=''
colorize 1 "GraalPy 23.1 and later installed by python-build use the faster Oracle GraalVM distribution" && echo
colorize 1 "Oracle GraalVM uses the GFTC license, which is free for development and production use, see https://medium.com/graalvm/161527df3d76" && echo
colorize 1 "The GraalVM Community Edition variant of GraalPy is also available, under the name graalpy-community-${VERSION}" && echo
graalpy_arch="$(graalpy_architecture 2>/dev/null || true)"
case "$graalpy_arch" in
"linux-amd64" )
checksum="8ca62fc996b4dcad146ff37139d22a8478959bde73789bfdd1e396287cd09dff"
;;
"linux-aarch64" )
checksum="e0008c00e8e925268d592de808839d913609e9f29b0e0dd9b69c795aabb64e2a"
;;
"macos-amd64" )
checksum="1709a02b2abc93cf698b95ddd6d8bbf43ddc7b268b09a9e5bced4e637d37369f"
;;
"macos-aarch64" )
checksum="4dfff34a4cfeb2c11441ce807c455719945b7f580bdec47d36daba342925a413"
;;
* )
{ echo
colorize 1 "ERROR"
echo ": No binary distribution of GraalPy is available for $(uname -sm)."
echo
} >&2
exit 1
;;
esac
if [ -n "${BUILD}" ]; then
{ echo
colorize 1 "ERROR"
echo "Oracle GraalPy currently doesn't provide snapshot builds. Use graalpy-community if you need snapshots."
echo
} >&2
exit 1
fi
url="https://github.com/oracle/graalpython/releases/download/graal-${VERSION}/graalpy-${VERSION}-${graalpy_arch}.tar.gz#${checksum}"
install_package "graalpy-${VERSION}" "${url}" "copy" ensurepip

View File

@ -0,0 +1,54 @@
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
VERSION='25.0.0'
BUILD=''
graalpy_arch="$(graalpy_architecture 2>/dev/null || true)"
case "$graalpy_arch" in
"linux-amd64" )
checksum="628d5e2af40b2a3ca694bbea169388394dd30fe0727a3f1b4c92319d7bb788d5"
;;
"linux-aarch64" )
checksum="7065492dea48a31adb5894379cd35acfd479c5a4158f3496f1485adedacf9bbb"
;;
"macos-amd64" )
checksum="1b866e651f0016cfdc8d5d4f8e64023cd26024755d4fe5bef86d02f1a9b701ec"
;;
"macos-aarch64" )
checksum="cec1e964f75ca5e881830e8670acea9486d589c1db909adf2ba974f16650bb58"
;;
* )
{ echo
colorize 1 "ERROR"
echo ": No binary distribution of GraalPy is available for $(uname -sm)."
echo
} >&2
exit 1
;;
esac
if [ -n "${BUILD}" ]; then
url="https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${VERSION}-dev-${BUILD}/graalpy-community-dev-${graalpy_arch}.tar.gz"
else
url="https://github.com/oracle/graalpython/releases/download/graal-${VERSION}/graalpy-community-${VERSION}-${graalpy_arch}.tar.gz#${checksum}"
fi
install_package "graalpy-community-${VERSION}${BUILD}" "${url}" "copy" ensurepip

View File

@ -4,6 +4,9 @@ PYENV_REHASH_COMMAND="${PYENV_COMMAND##*/}"
# Remove any version information, from e.g. "pip2" or "pip3.10".
if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.[0-9]+)?$ ]]; then
PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}"
# Check for ` -m pip ` in arguments
elif [[ "$*" =~ [[:space:]]-m[[:space:]]pip[[:space:]] ]]; then
PYENV_REHASH_COMMAND="pip"
fi
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND}" ]; then

75
test/pip-rehash.bats Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env bats
load test_helper
create_executable() {
local bin="${PYENV_ROOT}/versions/${PYENV_VERSION}/bin"
mkdir -p "$bin"
touch "${bin}/$2"
chmod +x "${bin}/$2"
}
create_fake_pip() {
local bin="${PYENV_ROOT}/versions/${PYENV_VERSION}/bin"
mkdir -p "$bin"
touch "${bin}/pip$1"
chmod +x "${bin}/pip$1"
}
copy_src_pyenvd() {
mkdir -p "${PYENV_ROOT}"
cp -r "${BATS_TEST_DIRNAME}/../pyenv.d/" "${PYENV_ROOT}"
}
@test "pip-rehash triggered when using 'pip'" {
export PYENV_VERSION="3.7.14"
create_executable "3.7.14" "example"
create_fake_pip
copy_src_pyenvd
run command -v example 2> /dev/null
assert_failure
run pyenv-exec pip install example
assert_success
run command -v example 2> /dev/null
assert_success
}
@test "pip-rehash triggered when using 'pip3'" {
export PYENV_VERSION="3.7.14"
create_executable "3.7.14" "example"
create_fake_pip "3"
copy_src_pyenvd
run command -v example 2> /dev/null
assert_failure
run pyenv-exec pip3 install example
assert_success
run command -v example 2> /dev/null
assert_success
}
@test "pip-rehash triggered when using 'pip3.x'" {
export PYENV_VERSION="3.7.14"
create_executable "3.7.14" "example"
create_fake_pip "3.7"
copy_src_pyenvd
run command -v example 2> /dev/null
assert_failure
run pyenv-exec pip3.7 install example
assert_success
run command -v example 2> /dev/null
assert_success
}
@test "pip-rehash triggered when using 'python -m pip install'" {
export PYENV_VERSION="3.7.14"
create_executable "3.7.14" "python"
create_executable "3.7.14" "example"
create_fake_pip
copy_src_pyenvd
run command -v example 2> /dev/null
assert_failure
run pyenv-exec python -m pip install example
assert_success
run command -v example 2> /dev/null
assert_success
}