Compare commits

...

25 Commits

Author SHA1 Message Date
6c464f7ab0 Add micropython 1.25.0 2025-06-13 11:30:05 +02:00
Ivan Pozdeev
a71a378dac 2.6.2 2025-06-12 13:19:45 +03:00
Ned Batchelder
807a4e0cac
Add CPython 3.13.5 (#3269) 2025-06-12 12:47:09 +03:00
Ivan Pozdeev
b9ede4ae0e 2.6.1 2025-06-04 20:22:49 +03:00
Ned Batchelder
0e05ee8694
Add CPython 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 (#3266) 2025-06-04 09:15:55 +03:00
Ivan Pozdeev
bfbe76e6a9 2.6.0 2025-05-26 22:59:51 +03:00
Ned Batchelder
d88de11543
Add CPython 3.14.0b2 (#3259) 2025-05-26 22:15:12 +03:00
Pedro Fonini
70b973fdd4
Fix python-build's has_broken_mac_readline when Readline is explicitly configured (#3254) 2025-05-22 07:58:25 +03:00
Alexander Studnitskiy
f24ff8d152
Add MacPorts support for python-build (#3186)
Did not implement customizable priority due to unclear use feedback and more compilation in the code, can decide and do that separately

Tcl/Tk from MacPorts support is omitted due to CPython's only being compatible with 
Tcl/Tk 9 since 3.12.5 and 3.13.0.

Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2025-05-18 18:24:38 +03:00
Ivan Pozdeev
5e82f5cf81 Merge branch 'master' of https://github.com/pyenv/pyenv 2025-05-18 12:27:06 +03:00
Ivan Pozdeev
6c86ae4175 README: fix erroneous extra indents in code blocks 2025-05-18 12:26:50 +03:00
Jordan Stewart
da3fcb7eb7
README: Add shell setup instructions for nushell (#2916) 2025-05-18 12:20:30 +03:00
Jesse Wattenbarger
018ca73444
Add --bare option to pyenv version (#2783) 2025-05-17 18:23:25 +03:00
Tom Godkin
90fa430eca
README: make fish PATH add conditional on the directory existing (#2786) 2025-05-17 16:13:12 +03:00
native-api
2d8bd15ccd
Add CODEOWNERS file (#3247)
to get notifications of pull requests ready for review

[no ci]
2025-05-17 15:38:33 +03:00
native-api
9656bcf0b9
python-build: Support patch paths with spaces/special characters (#3251)
This is now possible because all non-EOL MacOS versions now support
`find -print0`/`sort -z`/`xargs -0`
2025-05-17 08:58:06 +03:00
Ivan Pozdeev
f216b4bfb1 2.5.7 2025-05-09 00:52:54 +03:00
Edgar Ramírez Mondragón
54fd0106f8
Point 3.14-dev to 3.14 branch (#3246) 2025-05-09 00:51:24 +03:00
Ivan Pozdeev
6fff3d29d4 2.5.6 2025-05-08 17:12:28 +03:00
native-api
b70fb9c07b
Merge pull request #3245 from edgarrmondragon/cpython-3.14.0b1-3.15-dev
Add CPython 3.14.0b1 and 3.15-dev
2025-05-08 17:06:01 +03:00
Edgar Ramírez-Mondragón
f4b94c14a6
Add CPython 3.15-dev 2025-05-07 13:53:53 -06:00
Edgar Ramírez-Mondragón
e95941c9fe
Add CPython 3.14.0b1 2025-05-07 13:26:50 -06:00
native-api
bc7b6cb6b5
Cache uname and sw_vers output (#3244)
Mainly for tests, to avoid having to adjust call counts for stubs when the logic changes
2025-05-06 19:17:36 +03:00
David Lawson
ee40ad2253
Fix get-pip URLs for 3.7, 3.8 and Pyston (#3242)
Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2025-04-29 20:58:49 +03:00
Michael Šimáček
323af282db
Add GraalPy 24.2.1 (#3238) 2025-04-16 21:08:46 +03:00
30 changed files with 859 additions and 146 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
* @pyenv/pyenv-core-maintainers @pyenv/pyenv-core-committers

View File

@ -1,5 +1,30 @@
# Version History
## Release v2.6.2
* Add CPython 3.13.5 by @nedbat in https://github.com/pyenv/pyenv/pull/3269
## Release v2.6.1
* Add CPython 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 by @nedbat in https://github.com/pyenv/pyenv/pull/3266
## Release v2.6.0
* python-build: Support patch paths with spaces/special characters by @native-api in https://github.com/pyenv/pyenv/pull/3251
* Add CODEOWNERS file by @native-api in https://github.com/pyenv/pyenv/pull/3247
* README: make fish PATH add conditional on the directory existing by @BooleanCat in https://github.com/pyenv/pyenv/pull/2786
* Add --bare option to `pyenv version` by @jjwatt in https://github.com/pyenv/pyenv/pull/2783
* README: Add shell setup instructions for nushell by @jordanst3wart in https://github.com/pyenv/pyenv/pull/2916
* Add MacPorts support for python-build by @studnitskiy in https://github.com/pyenv/pyenv/pull/3186
* python-build: fix `has_broken_mac_readline` when Readline is explicitly configured by @fofoni in https://github.com/pyenv/pyenv/pull/3254
* Add CPython 3.14.0b2 by @nedbat in https://github.com/pyenv/pyenv/pull/3259
## Release v2.5.7
* Point 3.14-dev to `3.14` branch by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3246
## Release v2.5.6
* Add GraalPy 24.2.1 by @msimacek in https://github.com/pyenv/pyenv/pull/3238
* Fix get-pip URLs for 3.7, 3.8 and Pyston by @dmrlawson in https://github.com/pyenv/pyenv/pull/3242
* [CI] Cache `uname` and `sw_vers` output in Python-Build for easier mocking in tests by @native-api in https://github.com/pyenv/pyenv/pull/3244
* Add CPython 3.14.0b1 and 3.15-dev by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3245
## Release v2.5.5
* Add graalpy 24.2 by @msimacek in https://github.com/pyenv/pyenv/pull/3215
* Switch 3.9+ to OpenSSL 3 by @native-api in https://github.com/pyenv/pyenv/pull/3223

View File

@ -272,8 +272,15 @@ version of Python, or install a package that provides binaries.
Displays the currently active Python version, along with information on
how it was set.
Usage: pyenv version [--bare]
--bare show just the version name. An alias to `pyenv version-name'
$ pyenv version
2.7.6 (set by /home/yyuu/.pyenv/version)
$ pyenv version --bare
2.7.6
## `pyenv versions`

View File

@ -83,7 +83,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
<details>
The Homebrew option from the [MacOS section below](#macos) would also work if you have Homebrew installed.
##### 1. Automatic installer (Recommended)
```bash
@ -114,7 +114,7 @@ easy to fork and contribute any changes back upstream.
#### MacOS
<details>
The options from the [Linux section above](#linuxunix) also work but Homebrew is recommended for basic usage.
##### [Homebrew](https://brew.sh) in macOS
@ -222,36 +222,54 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
<details>
```zsh
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
```
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
</details>
#### Fish
<details>
1. If you have Fish 3.2.0 or newer, execute this interactively:
~~~ fish
set -Ux PYENV_ROOT $HOME/.pyenv
fish_add_path $PYENV_ROOT/bin
~~~
```fish
set -Ux PYENV_ROOT $HOME/.pyenv
test -d $PYENV_ROOT/bin; and fish_add_path $PYENV_ROOT/bin
```
2. Otherwise, execute the snippet below:
~~~ fish
set -Ux PYENV_ROOT $HOME/.pyenv
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
~~~
```fish
set -Ux PYENV_ROOT $HOME/.pyenv
test -d $PYENV_ROOT/bin; and set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
```
3. Now, add this to `~/.config/fish/config.fish`:
~~~ fish
pyenv init - fish | source
~~~
```fish
pyenv init - fish | source
```
</details>
#### Nushell
<details>
Add the following lines to your `config.nu` to add Pyenv and its shims to your `PATH`.
Shell integration (completions and subcommands changing the shell's state)
isn't currently supported.
~~~ nu
$env.PYENV_ROOT = "~/.pyenv" | path expand
if (( $"($env.PYENV_ROOT)/bin" | path type ) == "dir") {
$env.PATH = $env.PATH | prepend $"($env.PYENV_ROOT)/bin" }
$env.PATH = $env.PATH | prepend $"(pyenv root)/shims"
~~~
</details>
### C. Restart your shell
----

View File

@ -12,7 +12,7 @@
set -e
[ -n "$PYENV_DEBUG" ] && set -x
version="2.5.5"
version="2.6.2"
git_revision=""
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then

View File

@ -1,9 +1,8 @@
#!/usr/bin/env bash
# Summary: Show the current Python version(s) and its origin
# Usage: pyenv version [--bare]
#
# Shows the currently selected Python version(s) and how it was
# selected. To obtain only the version string, use `pyenv
# version-name'.
# --bare show just the version name. An alias to `pyenv version-name'
set -e
[ -n "$PYENV_DEBUG" ] && set -x
@ -13,8 +12,25 @@ OLDIFS="$IFS"
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name)) || exitcode=$?
IFS="$OLDIFS"
unset bare
for arg; do
case "$arg" in
--complete )
echo --bare
exit ;;
--bare ) bare=1 ;;
* )
pyenv-help --usage version >&2
exit 1
;;
esac
done
for PYENV_VERSION_NAME in "${PYENV_VERSION_NAMES[@]}"; do
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
if [[ -n $bare ]]; then
echo "$PYENV_VERSION_NAME"
else
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
fi
done
exit $exitcode

View File

@ -138,6 +138,17 @@ would break all Pyenv-managed installations that depend on it.
You can use a [community plugin `fix-version`](https://github.com/pyenv/pyenv/wiki/Plugins#community-plugins)
to fix installations in such a case.
##### MacPorts
MacPorts Homebrew is used to find dependency packages if `port` is found on `PATH` in MacOS.
Set `PYTHON_BUILD_USE_MACPORTS` or `PYTHON_BUILD_SKIP_MACPORTS` to override this default.
###### Interaction with Homebrew
If both Homebrew and MacPorts are installed and allowed to be used, Homebrew takes preference.
There first ecosystem where any of the required dependency packages is found is used.
##### Portage
In FreeBSD, if `pkg` is on PATH, Ports are searched for some dependencies that Configure is known to not search for via `pkg-config`.
@ -164,6 +175,8 @@ You can set certain environment variables to control the build process.
* `PYTHON_BUILD_SKIP_HOMEBREW`, if set, will not search for libraries installed by Homebrew when it would normally will.
* `PYTHON_BUILD_USE_HOMEBREW`, if set, will search for libraries installed by Homebrew when it would normally not.
* `PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA`, override the Homebrew OpenSSL formula to use.
* `PYTHON_BUILD_SKIP_MACPORTS`, if set, will not search for libraries installed by MacPorts when it would normally will.
* `PYTHON_BUILD_USE_MACPORTS`, if set, will search for libraries installed by MacPorts when it would normally not.
* `PYTHON_BUILD_ROOT` overrides the default location from where build definitions
in `share/python-build/` are looked up.
* `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get

View File

@ -27,7 +27,6 @@ shopt -s extglob
exec 3<&2 # preserve original stderr at fd 3
lib() {
parse_options() {
OPTIONS=()
@ -81,7 +80,12 @@ abs_dirname() {
cd "$cd_path"
fi
name="${path##*/}"
path="$(resolve_link "$name" || true)"
if [[ $name == ".." ]]; then
cd ..
path="$PWD"
else
path="$(resolve_link "$name" || true)"
fi
done
echo "$PWD"
@ -106,7 +110,7 @@ os_information() {
if type -p lsb_release >/dev/null; then
lsb_release -sir | xargs echo
elif type -p sw_vers >/dev/null; then
echo "OS X $(sw_vers -productVersion)"
echo "OS X ${_PYTHON_BUILD_CACHE_SW_VERS:=$(sw_vers -productVersion)}"
elif [ -r /etc/os-release ]; then
source /etc/os-release
echo "$NAME" $VERSION_ID
@ -117,22 +121,61 @@ os_information() {
}
is_mac() {
[ "$(uname -s)" = "Darwin" ] || return 1
[ "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" = "Darwin" ] || return 1
[ $# -eq 0 ] || [ "$(osx_version)" "$@" ]
}
can_use_homebrew() {
if locked_in; then
locked_in homebrew && rc=$? || rc=$?; return $rc
fi
[[ -n "$PYTHON_BUILD_USE_HOMEBREW" && -n "$PYTHON_BUILD_SKIP_HOMEBREW" ]] && {
echo "error: mutually exclusive environment variables PYTHON_BUILD_USE_HOMEBREW and PYTHON_BUILD_SKIP_HOMEBREW are set" >&3
exit 1
}
[[ -n "$PYTHON_BUILD_USE_HOMEBREW" ]] && return 0
[[ -n "$PYTHON_BUILD_SKIP_HOMEBREW" ]] && return 1
is_mac && return 0
is_mac && command -v brew &>/dev/null && return 0
# In Linux, if Pyenv itself is installed with Homebrew,
# we assume the user wants to take dependencies from there as well by default
command -v brew &>/dev/null && [[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "$(brew --prefix 2>/dev/null ||true)")"/* ]] && return 0
return 1
local brew_prefix
command -v brew &>/dev/null && \
# tests can have non-functional `brew' stub aliased to `false'
# in Bash 3.2, var="$(cmd)" errexits on failure even if part of a conditional chain
brew_prefix="$(brew --prefix || true)" && [[ -n "$brew_prefix" ]] && \
[[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "${brew_prefix}")"/* ]] && \
{ lock_in homebrew; return 0; }
# do not check the same stuff multiple times
PYTHON_BUILD_SKIP_HOMEBREW=1; return 1
}
can_use_macports() {
if locked_in; then
locked_in macports && rc=$? || rc=$?; return $rc
fi
[[ -n "$PYTHON_BUILD_USE_MACPORTS" && -n "$PYTHON_BUILD_SKIP_MACPORTS" ]] && {
echo "error: mutually exclusive environment variables PYTHON_BUILD_USE_MACPORTS and PYTHON_BUILD_SKIP_MACPORTS are set" >&3
exit 1
}
[[ -n "$PYTHON_BUILD_USE_MACPORTS" ]] && return 0
[[ -n "$PYTHON_BUILD_SKIP_MACPORTS" ]] && return 1
is_mac && command -v port &>/dev/null && return 0
# do not check the same stuff multiple times
PYTHON_BUILD_SKIP_MACPORTS=1; return 1
}
locked_in() {
if [[ -z "$1" ]]; then
[[ -n $_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN ]]
else
[[ $_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN == "$1" ]]
fi
}
lock_in() {
_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN=${1:?}
}
# 9.1 -> 901
@ -140,7 +183,7 @@ can_use_homebrew() {
# 10.10 -> 1010
osx_version() {
local -a ver
IFS=. ver=( `sw_vers -productVersion` )
IFS=. ver=( ${_PYTHON_BUILD_CACHE_SW_VERS:=$(sw_vers -productVersion)} )
IFS="$OLDIFS"
echo $(( ${ver[0]}*100 + ${ver[1]} ))
}
@ -179,7 +222,7 @@ file_is_not_empty() {
num_cpu_cores() {
local num
case "$(uname -s)" in
case "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" in
Darwin | *BSD )
num="$(sysctl -n hw.ncpu 2>/dev/null || true)"
;;
@ -815,15 +858,35 @@ build_package_standard_build() {
local PACKAGE_LDFLAGS="${package_var_name}_LDFLAGS"
if [ "$package_var_name" = "PYTHON" ]; then
use_homebrew || true
use_custom_tcltk || use_homebrew_tcltk || true
use_homebrew_readline || use_freebsd_pkg || true
use_homebrew_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_homebrew_zlib || true
else
use_homebrew_zlib || true
if can_use_homebrew; then
use_custom_tcltk || use_homebrew_tcltk || true
use_homebrew_readline || true
use_homebrew_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_homebrew_zlib || true
else
use_homebrew_zlib || true
fi
fi
if can_use_macports; then
use_custom_tcltk || true
use_macports_readline || true
use_macports_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_macports_zlib || true
else
use_macports_zlib || true
fi
fi
if can_use_homebrew; then
use_homebrew || true
fi
if can_use_macports; then
use_macports || true
fi
use_freebsd_pkg || true
use_dsymutil || true
use_free_threading || true
fi
@ -971,7 +1034,7 @@ build_package_micropython() {
}
pypy_architecture() {
case "$(uname -s)" in
case "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" in
"Darwin" )
case "$(uname -m)" in
"arm64" ) echo "osarm64" ;;
@ -1003,7 +1066,7 @@ pypy_architecture() {
}
graalpy_architecture() {
case "$(uname -s)" in
case "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" in
"Darwin" )
case "$(uname -m)" in
"x86_64" ) echo "macos-amd64" ;;
@ -1084,7 +1147,7 @@ build_package_pypy_builder() {
}
activepython_architecture() {
case "$(uname -s)" in
case "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" in
"Darwin" ) echo "macosx10.9-i386-x86_64" ;;
"Linux" )
case "$(uname -m)" in
@ -1104,7 +1167,7 @@ build_package_activepython() {
}
anaconda_architecture() {
case "$(uname -s)" in
case "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" in
"Darwin" )
case "$(uname -m)" in
"arm64" ) echo "MacOSX-arm64" ;;
@ -1160,8 +1223,8 @@ setup_builtin_patches() {
cat >"${package_name}.patch"
HAS_PATCH=true
elif [[ -d "${package_patch_path}" ]]; then
{ find "${package_patch_path}" -maxdepth 1 -type f
} 2>/dev/null | sort | xargs cat 1>"${package_name}.patch"
{ find "${package_patch_path}" -maxdepth 1 -type f -print0
} 2>/dev/null | sort -z | xargs -0 cat 1>"${package_name}.patch"
HAS_PATCH=true
fi
}
@ -1381,7 +1444,7 @@ require_osx_version() {
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
local required_version="$@"
local osx_version="$(sw_vers -productVersion)"
local osx_version="${_PYTHON_BUILD_CACHE_SW_VERS:=$(sw_vers -productVersion)}"
if [[ $(version $osx_version) -ge $(version $required_version) ]]; then
return 0
fi
@ -1434,13 +1497,30 @@ use_homebrew() {
if [[ -n $brew_prefix && $brew_prefix != "/usr" && $brew_prefix != "/usr/local" ]]; then
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${brew_prefix}/include"
append_ldflags_libs "-L${brew_prefix}/lib -Wl,-rpath,${brew_prefix}/lib"
lock_in homebrew
fi
fi
}
use_macports() {
can_use_macports || return 1
local port_location="$(command -v port)"
if [ -n "$port_location" ]; then
local prefix="${port_location%/bin/port}"
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${prefix}/include"
append_ldflags_libs "-L${prefix}/lib -Wl,-rpath,${prefix}/lib"
lock_in macports
fi
}
needs_yaml() {
! configured_with_package_dir "python" "yaml.h" &&
! use_homebrew_yaml
if ! configured_with_package_dir "python" "yaml.h"; then
if can_use_homebrew; then
use_homebrew_yaml && return 1
elif can_use_macports; then
use_macports_yaml && return 1
fi
fi
}
use_homebrew_yaml() {
@ -1450,6 +1530,23 @@ use_homebrew_yaml() {
echo "python-build: use libyaml from homebrew"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ ${LDFLAGS% }}"
lock_in homebrew
else
return 1
fi
}
use_macports_yaml() {
can_use_macports || return 1
local prefix="$(port -q location libyaml 2>/dev/null || true)"
if [ -n "$prefix" ]; then
local libdir="$prefix/opt/local"
if [ -d "$libdir" ]; then
echo "python-build: use libyaml from MacPorts"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ ${LDFLAGS% }}"
lock_in macports
fi
else
return 1
fi
@ -1457,14 +1554,14 @@ use_homebrew_yaml() {
use_freebsd_pkg() {
# check if FreeBSD
if [ "FreeBSD" = "$(uname -s)" ]; then
if [ "FreeBSD" = "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" ]; then
# use openssl if installed from Ports Collection
if pkg info -e openssl; then
package_option python configure --with-openssl="/usr/local"
fi
# check if 11-R or later
release="$(uname -r)"
release="${_PYTHON_BUILD_CACHE_UNAME_R:=$(uname -r)}"
if [ "${release%%.*}" -ge 11 ]; then
# Use packages from Ports Collection.
#
@ -1488,9 +1585,16 @@ use_freebsd_pkg() {
has_broken_mac_readline() {
# Mac OS X 10.4 has broken readline.
# https://github.com/pyenv/pyenv/issues/23
is_mac &&
! configured_with_package_dir "python" "readline/rlconf.h" &&
! use_homebrew_readline
if ! is_mac || configured_with_package_dir "python" "readline/rlconf.h"; then
# Not applicable.
return 1
fi
if can_use_homebrew; then
use_homebrew_readline && return 1
fi
if can_use_macports; then
use_macports_readline && return 1
fi
}
use_homebrew_readline() {
@ -1501,6 +1605,25 @@ use_homebrew_readline() {
echo "python-build: use readline from homebrew"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
lock_in homebrew
else
return 1
fi
fi
}
use_macports_readline() {
can_use_macports || return 1
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
local prefix="$(port -q location readline 2>/dev/null || true)"
if [ -n "$prefix" ]; then
local libdir="$prefix/opt/local"
if [ -d "$libdir" ]; then
echo "python-build: use readline from MacPorts"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
lock_in macports
fi
else
return 1
fi
@ -1514,6 +1637,23 @@ use_homebrew_ncurses() {
echo "python-build: use ncurses from homebrew"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
lock_in homebrew
else
return 1
fi
}
use_macports_ncurses() {
can_use_macports || return 1
local prefix="$(port -q location ncurses 2>/dev/null || true)"
if [[ -n "$prefix" ]]; then
local libdir="$prefix/opt/local"
if [ -d "$libdir" ]; then
echo "python-build: use ncurses from MacPorts"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
lock_in macports
fi
else
return 1
fi
@ -1548,8 +1688,14 @@ build_package_mac_readline() {
has_broken_mac_openssl() {
is_mac || return 1
local openssl_version="$(/usr/bin/openssl version 2>/dev/null || true)"
[[ $openssl_version = "OpenSSL 0.9.8"?* || $openssl_version = "LibreSSL"* ]] &&
! use_homebrew_openssl
if [[ $openssl_version = "OpenSSL 0.9.8"?* || $openssl_version = "LibreSSL"* ]]; then
if can_use_homebrew; then
use_homebrew_openssl && return 1
fi
if can_use_macports; then
use_macports_openssl && return 1
fi
fi
}
use_homebrew_openssl() {
@ -1568,7 +1714,34 @@ use_homebrew_openssl() {
export LDFLAGS="-L$ssldir/lib${LDFLAGS:+ $LDFLAGS}"
fi
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
return
lock_in homebrew
return 0
fi
done
return 1
}
use_macports_openssl() {
can_use_macports || return 1
command -v port >/dev/null || return 1
for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do
local ssldir="$(port -q location "${openssl}" 2>/dev/null || true)"
if [ -n "$ssldir" ]; then
ssldir="${ssldir}/opt/local"
if [ -d "$ssldir" ]; then
echo "python-build: use ${openssl} from MacPorts"
if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
# configure script of newer CPython versions support `--with-openssl`
# https://bugs.python.org/issue21541
package_option python configure --with-openssl="${ssldir}"
else
export CPPFLAGS="-I$ssldir/include ${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$ssldir/lib${LDFLAGS:+ $LDFLAGS}"
fi
fi
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
lock_in macports
return 0
fi
done
return 1
@ -1668,6 +1841,7 @@ use_homebrew_zlib() {
if [ -d "$brew_zlib" ]; then
echo "python-build: use zlib from homebrew"
export CFLAGS="-I${brew_zlib} ${CFLAGS}"
lock_in homebrew
fi
}
@ -1687,6 +1861,22 @@ use_xcode_sdk_zlib() {
fi
}
use_macports_zlib() {
can_use_macports || return 1
local prefix="$(port -q location zlib 2>/dev/null || true)"
if [[ -n "$prefix" ]]; then
local libdir="$prefix/opt/local"
if [[ -d "$libdir" ]]; then
echo "python-build: use zlib from MacPorts"
export CPPFLAGS="-I$prefix/include ${CPPFLAGS}"
export LDFLAGS="-L$prefix/lib ${LDFLAGS}"
lock_in macports
fi
else
return 1
fi
}
use_homebrew_tcltk() {
can_use_homebrew || return 1
# Since https://github.com/Homebrew/homebrew-core/commit/f10e88617b41555193c22fdcba6109fe82155ee2 (10.11.2024),
@ -1711,6 +1901,7 @@ use_homebrew_tcltk() {
fi
fi
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
lock_in homebrew
return 0
fi
done
@ -2040,7 +2231,12 @@ build_package_verify_py313() {
# Post-install check for Python 3.14.x
build_package_verify_py314() {
build_package_verify_py313 "$1" "${2:-3.13}"
build_package_verify_py313 "$1" "${2:-3.14}"
}
# Post-install check for Python 3.15.x
build_package_verify_py315() {
build_package_verify_py314 "$1" "${2:-3.15}"
}
# Post-install check for Python 3.x rolling release scripts
@ -2251,11 +2447,13 @@ if [ -n "$noexec" ]; then
fi
if [ -z "$MAKE" ]; then
if [ "FreeBSD" = "$(uname -s)" ]; then
if [ "FreeBSD" = "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" ]; then
if [ "$(echo $1 | sed 's/-.*$//')" = "jruby" ]; then
export MAKE="gmake"
else
if [ "$(uname -r | sed 's/[^[:digit:]].*//')" -lt 10 ]; then
# var assignment inside $() does not propagate due to being in subshell
: "${_PYTHON_BUILD_CACHE_UNAME_R:=$(uname -r)}"
if [ "$(echo "$_PYTHON_BUILD_CACHE_UNAME_R" | sed 's/[^[:digit:]].*//')" -lt 10 ]; then
export MAKE="gmake"
else
export MAKE="make"
@ -2434,6 +2632,12 @@ if [ -z "${GET_PIP_URL}" ]; then
3.6 | 3.6.* | pypy3.6 | pypy3.6-* )
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.6/get-pip.py"
;;
3.7 | 3.7.* | pypy3.7 | pypy3.7-* )
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.7/get-pip.py"
;;
3.8 | 3.8.* | pypy3.8 | pypy3.8-* | pyston* )
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.8/get-pip.py"
;;
* )
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
;;
@ -2444,7 +2648,7 @@ fi
# Set MACOSX_DEPLOYMENT_TARGET from the product version of OS X (#219, #220)
if is_mac; then
if [ -z "${MACOSX_DEPLOYMENT_TARGET}" ]; then
MACOS_VERSION="$(sw_vers -productVersion 2>/dev/null || true)"
MACOS_VERSION="${_PYTHON_BUILD_CACHE_SW_VERS:=$(sw_vers -productVersion)}"
MACOS_VERSION_ARRAY=(${MACOS_VERSION//\./ })
if [ "${#MACOS_VERSION_ARRAY[@]}" -ge 2 ]; then
export MACOSX_DEPLOYMENT_TARGET="${MACOS_VERSION_ARRAY[0]}.${MACOS_VERSION_ARRAY[1]}"

View File

@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.2.4" "https://github.com/openssl/openssl/releases/download/openssl-3.2.4/openssl-3.2.4.tar.gz#b23ad7fd9f73e43ad1767e636040e88ba7c9e5775bfa5618436a0dd2c17c3716" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.10.18" "https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tar.xz#ae665bc678abd9ab6a6e1573d2481625a53719bc517e9a634ed2b9fefae3817f" standard verify_py310 copy_python_gdb ensurepip
else
install_package "Python-3.10.18" "https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tgz#1b19ab802518eb36a851f5ddef571862c7a31ece533109a99df6d5af0a1ceb99" standard verify_py310 copy_python_gdb ensurepip
fi

View File

@ -0,0 +1,10 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
install_package "openssl-3.2.4" "https://github.com/openssl/openssl/releases/download/openssl-3.2.4/openssl-3.2.4.tar.gz#b23ad7fd9f73e43ad1767e636040e88ba7c9e5775bfa5618436a0dd2c17c3716" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.11.13" "https://www.python.org/ftp/python/3.11.13/Python-3.11.13.tar.xz#8fb5f9fbc7609fa822cb31549884575db7fd9657cbffb89510b5d7975963a83a" standard verify_py311 copy_python_gdb ensurepip
else
install_package "Python-3.11.13" "https://www.python.org/ftp/python/3.11.13/Python-3.11.13.tgz#0f1a22f4dfd34595a29cf69ee7ea73b9eff8b1cc89d7ab29b3ab0ec04179dad8" standard verify_py311 copy_python_gdb ensurepip
fi

View File

@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.3.3" "https://github.com/openssl/openssl/releases/download/openssl-3.3.3/openssl-3.3.3.tar.gz#712590fd20aaa60ec75d778fe5b810d6b829ca7fb1e530577917a131f9105539" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.12.11" "https://www.python.org/ftp/python/3.12.11/Python-3.12.11.tar.xz#c30bb24b7f1e9a19b11b55a546434f74e739bb4c271a3e3a80ff4380d49f7adb" standard verify_py312 copy_python_gdb ensurepip
else
install_package "Python-3.12.11" "https://www.python.org/ftp/python/3.12.11/Python-3.12.11.tgz#7b8d59af8216044d2313de8120bfc2cc00a9bd2e542f15795e1d616c51faf3d6" standard verify_py312 copy_python_gdb ensurepip
fi

View File

@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.13.4" "https://www.python.org/ftp/python/3.13.4/Python-3.13.4.tar.xz#27b15a797562a2971dce3ffe31bb216042ce0b995b39d768cf15f784cc757365" standard verify_py313 copy_python_gdb ensurepip
else
install_package "Python-3.13.4" "https://www.python.org/ftp/python/3.13.4/Python-3.13.4.tgz#2666038f1521b7a8ec34bf2997b363778118d6f3979282c93723e872bcd464e0" standard verify_py313 copy_python_gdb ensurepip
fi

View File

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.4

View File

@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.13.5" "https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz#93e583f243454e6e9e4588ca2c2662206ad961659863277afcdb96801647d640" standard verify_py313 copy_python_gdb ensurepip
else
install_package "Python-3.13.5" "https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tgz#e6190f52699b534ee203d9f417bdbca05a92f23e35c19c691a50ed2942835385" standard verify_py313 copy_python_gdb ensurepip
fi

View File

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.5

View File

@ -4,4 +4,4 @@ export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
install_package "openssl-3.3.0" "https://www.openssl.org/source/openssl-3.3.0.tar.gz#53e66b043322a606abf0087e7699a0e033a37fa13feb9742df35c3a33b18fb02" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
install_git "Python-3.14-dev" "https://github.com/python/cpython" main standard verify_py314 copy_python_gdb ensurepip
install_git "Python-3.14-dev" "https://github.com/python/cpython" 3.14 standard verify_py314 copy_python_gdb ensurepip

View File

@ -1,2 +0,0 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0a7

View File

@ -3,7 +3,7 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.14.0a7" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a7.tar.xz#71adbcec3ac9edf93308e55cfb4184f2eb4b16fda2bb0a5a382929ed29c8386d" standard verify_py313 copy_python_gdb ensurepip
install_package "Python-3.14.0b2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b2.tar.xz#7ac9e84844bbc0a5a8f1f79a37a68b3b8caf2a58b4aa5999c49227cb36e70ea6" standard verify_py314 copy_python_gdb ensurepip
else
install_package "Python-3.14.0a7" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a7.tgz#381cc699c1dff5153ab76bff4c6d1f916069be39d0231ee20390f42785b9c046" standard verify_py313 copy_python_gdb ensurepip
install_package "Python-3.14.0b2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b2.tgz#395e0daf993ddd6010dddef9ac6851996f69c2681a88c20190fa0dfe3e633930" standard verify_py314 copy_python_gdb ensurepip
fi

View File

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0b2

View File

@ -0,0 +1,7 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
install_git "Python-3.15-dev" "https://github.com/python/cpython" main standard verify_py315 copy_python_gdb ensurepip

View File

@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.15-dev

View File

@ -0,0 +1,12 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
# Avoid a compilation error when linking against OpenSSL built with SSLv3 support (fixed in 3.10.0) (#2181)
export PYTHON_CFLAGS="-DOPENSSL_NO_SSL3${PYTHON_CFLAGS:+ $PYTHON_CFLAGS}"
install_package "openssl-3.0.16" "https://github.com/openssl/openssl/releases/download/openssl-3.0.16/openssl-3.0.16.tar.gz#57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.9.23" "https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz#61a42919e13d539f7673cf11d1c404380e28e540510860b9d242196e165709c9" standard verify_py39 copy_python_gdb ensurepip
else
install_package "Python-3.9.23" "https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tgz#9a69aad184dc1d06f6819930741da3a328d34875a41f8ba33875774dbfc51b51" standard verify_py39 copy_python_gdb ensurepip
fi

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='24.2.1'
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="55872af24819cb99efa2338db057aeda0c8f9dd412a4a6f5ea19b256ee82fd9e"
;;
"linux-aarch64" )
checksum="2a80800a76ee6b737d6458ba9ab30ce386dfdd5b2b2bec3ee6bc51fd8e51e7c2"
;;
"macos-amd64" )
checksum="4bc42b36117c9ab09c4f411ec5a7a85ed58521dd20b529d971bb0ed3d0b7c363"
;;
"macos-aarch64" )
checksum="61e11d5176d5bb709b919979ef3525f4db1e39c404b59aa54d887f56bf8fab44"
;;
* )
{ 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='24.2.1'
BUILD=''
graalpy_arch="$(graalpy_architecture 2>/dev/null || true)"
case "$graalpy_arch" in
"linux-amd64" )
checksum="96c1f332604f8425df0bb694d435d932cdf21c302e452cd10cf78a1626ba90a0"
;;
"linux-aarch64" )
checksum="676eefe6011a1a2c01997c7a3cea92817f0d9de7e608d561eb5255a1e5350eff"
;;
"macos-amd64" )
checksum="0d0a50cc93457bdebab992af287a275d0b364fcbd90b68cdf08ae9c64e3a1aca"
;;
"macos-aarch64" )
checksum="ec31fc1f024938e6dc193013a365c23ad3d532498c93c80c3af607a853964909"
;;
* )
{ 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

@ -0,0 +1,2 @@
src="https://micropython.org/resources/source/micropython-1.25.0.tar.xz#9fe99ad5808e66bb40d374f5cad187c32c7d1c49cf47f72b38fd453c28c2aebe"
install_package micropython-1.21.0 "$src" micropython

View File

@ -62,7 +62,7 @@ assert_build_log() {
cached_tarball "yaml-0.1.6"
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub brew false
stub_make_install
stub_make_install
@ -104,7 +104,7 @@ OUT
cached_tarball "yaml-0.1.6" "$yaml_configure"
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub brew false
stub_make_install
stub_make_install "$PYTHON_MAKE_INSTALL_TARGET"
@ -132,7 +132,7 @@ OUT
cached_tarball "yaml-0.1.6"
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub brew false
stub_make_install
stub_make_install
@ -162,7 +162,7 @@ OUT
cached_tarball "yaml-0.1.6"
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub brew false
stub_make_install
stub_make_install
@ -188,15 +188,49 @@ make install
OUT
}
@test "Homebrew and port are tried if both are present in PATH in MacOS" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
for i in {1..3}; do stub port false; done
stub_make_install
export PYENV_DEBUG=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub brew
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "homebrew with uncommon prefix is added to search path" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
mkdir -p "$BREW_PREFIX"
export PYTHON_BUILD_SKIP_MACPORTS=1
for i in {1..9}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub brew "--prefix : echo '$BREW_PREFIX'" false
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
run_inline_definition <<DEF
@ -204,6 +238,7 @@ install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.
DEF
assert_success
unstub brew
unstub uname
unstub sw_vers
unstub make
@ -216,14 +251,45 @@ make install
OUT
}
@test "Macports are used in MacOS if Homebrew was not picked" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..3}; do stub port false; done
stub_make_install
export PYTHON_BUILD_SKIP_HOMEBREW=1
PORT_PREFIX="$(which port)"
PORT_PREFIX="${PORT_PREFIX%/bin/port}"
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$PORT_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$PORT_PREFIX/lib -Wl,-rpath,$PORT_PREFIX/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "yaml is linked from Homebrew" {
cached_tarball "Python-3.6.2"
brew_libdir="$TMP/homebrew-yaml"
mkdir -p "$brew_libdir"
for i in {1..10}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew "--prefix libyaml : echo '$brew_libdir'"
for i in {1..6}; do stub brew false; done
stub_make_install
@ -249,11 +315,11 @@ OUT
readline_libdir="$TMP/homebrew-readline"
mkdir -p "$readline_libdir"
for i in {1..8}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
for i in {1..3}; do stub brew false; done
stub brew "--prefix readline : echo '$readline_libdir'"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..2}; do stub brew false; done
stub brew "--prefix readline : echo '$readline_libdir'"
for i in {1..3}; do stub brew false; done
stub_make_install
run_inline_definition <<DEF
@ -279,11 +345,11 @@ OUT
ncurses_libdir="$TMP/homebrew-ncurses"
mkdir -p "$ncurses_libdir"
for i in {1..9}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
for i in {1..4}; do stub brew false; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..3}; do stub brew false; done
stub brew "--prefix ncurses : echo '$ncurses_libdir'"
stub brew false
for i in {1..2}; do stub brew false; done
stub_make_install
run_inline_definition <<DEF
@ -304,12 +370,100 @@ make install
OUT
}
@test "yaml is linked from MacPorts" {
cached_tarball "Python-3.6.2"
yaml_libdir="$TMP/port-yaml"
mkdir -p "$yaml_libdir/opt/local"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub port "-q location libyaml : echo '$yaml_libdir'"
for i in {1..3}; do stub port false; done
stub_make_install
install_fixture definitions/needs-yaml
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$yaml_libdir/opt/local/include -I${TMP}/install/include -I${TMP}/include" LDFLAGS="-L$yaml_libdir/opt/local/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L${TMP}/lib -Wl,-rpath,${TMP}/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "readline is linked from MacPorts" {
cached_tarball "Python-3.6.2"
readline_libdir="$TMP/port-readline"
mkdir -p "$readline_libdir/opt/local"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub port "-q location readline : echo '$readline_libdir'"
for i in {1..2}; do stub port false; done
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$readline_libdir/opt/local/include -I${TMP}/install/include -I${TMP}/include" LDFLAGS="-L$readline_libdir/opt/local/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L${TMP}/lib -Wl,-rpath,${TMP}/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "ncurses is linked from MacPorts" {
cached_tarball "Python-3.6.2"
ncurses_libdir="$TMP/port-ncurses"
mkdir -p "$ncurses_libdir/opt/local"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub port false
stub port "-q location ncurses : echo '$ncurses_libdir'"
stub port false
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$ncurses_libdir/opt/local/include -I${TMP}/install/include -I${TMP}/include" LDFLAGS="-L$ncurses_libdir/opt/local/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L${TMP}/lib -Wl,-rpath,${TMP}/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "openssl is linked from Ports in FreeBSD if present" {
cached_tarball "Python-3.6.2"
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
stub uname '-s : echo FreeBSD'
stub uname '-r : echo 11.0-RELEASE'
for i in {1..3}; do stub uname '-s : echo FreeBSD'; done
stub sysctl '-n hw.ncpu : echo 1'
stub pkg "info -e openssl : true"
@ -341,9 +495,8 @@ OUT
for lib in readline sqlite3; do
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
stub uname '-s : echo FreeBSD'
stub uname '-r : echo 11.0-RELEASE'
for i in {1..3}; do stub uname '-s : echo FreeBSD'; done
stub sysctl '-n hw.ncpu : echo 1'
stub pkg false
@ -376,11 +529,13 @@ OUT
@test "homebrew is not touched if PYTHON_BUILD_SKIP_HOMEBREW is set" {
cached_tarball "Python-3.6.2"
for i in {1..4}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew true; brew
stub port false
stub_make_install
export PYTHON_BUILD_SKIP_HOMEBREW=1
export PYTHON_BUILD_SKIP_MACPORTS=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
@ -399,15 +554,94 @@ make install
OUT
}
@test "MacPorts is not touched if PYTHON_BUILD_SKIP_MACPORTS is set" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew false
stub port true; port
stub_make_install
export PYTHON_BUILD_SKIP_MACPORTS=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "MacPorts is not touched in Linux" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Linux'
stub port true; port
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "MacPorts is used in Linux if PYTHON_BUILD_USE_MACPORTS is set" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Linux'
stub brew false
for i in {1..3}; do stub port false; done
PORT_PREFIX="$(which port)"
PORT_PREFIX="${PORT_PREFIX%/bin/port}"
stub_make_install
export PYTHON_BUILD_USE_MACPORTS=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$PORT_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$PORT_PREFIX/lib -Wl,-rpath,$PORT_PREFIX/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "homebrew is used in Linux if PYTHON_BUILD_USE_HOMEBREW is set" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
mkdir -p "$BREW_PREFIX"
for i in {1..4}; do stub uname '-s : echo Linux'; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub uname '-s : echo Linux'
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
export PYTHON_BUILD_USE_HOMEBREW=1
@ -435,11 +669,11 @@ OUT
BREW_PREFIX="${BREW_PREFIX%/*}"
BREW_PREFIX="${BREW_PREFIX%/*}"
for i in {1..4}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub brew "--prefix : echo '$BREW_PREFIX'"
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
export PYTHON_BUILD_USE_HOMEBREW=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
@ -464,8 +698,8 @@ OUT
BREW_PREFIX="$TMP/homebrew-prefix"
mkdir -p "$BREW_PREFIX"
for i in {1..9}; do stub uname '-s : echo Linux'; done
for i in {1..5}; do stub brew "--prefix : echo '$BREW_PREFIX'"; done
stub uname '-s : echo Linux'
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
run_inline_definition <<DEF
@ -488,13 +722,12 @@ OUT
@test "readline is not linked from Homebrew when explicitly defined" {
cached_tarball "Python-3.6.2"
# python-build
readline_libdir="$TMP/custom"
mkdir -p "$readline_libdir/include/readline"
touch "$readline_libdir/include/readline/rlconf.h"
for i in {1..8}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..5}; do stub brew false; done
stub_make_install
@ -525,12 +758,11 @@ OUT
mkdir -p "$tcl_tk_libdir/lib"
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
for i in {1..9}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew false
stub brew "--prefix tcl-tk@8 : echo '$tcl_tk_libdir'"
for i in {1..3}; do stub brew false; done
for i in {1..4}; do stub brew false; done
stub_make_install
@ -559,8 +791,8 @@ OUT
tcl_tk_version_long="8.6.10"
tcl_tk_version="${tcl_tk_version_long%.*}"
for i in {1..8}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..4}; do stub brew false; done
stub_make_install
@ -587,15 +819,14 @@ OUT
@test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" {
cached_tarball "Python-3.6.2"
for i in {1..9}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
mkdir -p "$tcl_tk_libdir/lib"
stub brew false
stub brew "--prefix tcl-tk@8 : echo '${tcl_tk_libdir}'"
for i in {1..3}; do stub brew false; done
for i in {1..4}; do stub brew false; done
stub_make_install
@ -617,11 +848,12 @@ make -j 2
make install
OUT
}
@test "number of CPU cores defaults to 2" {
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub sysctl false
stub_make_install
@ -647,8 +879,8 @@ OUT
@test "number of CPU cores is detected on Mac" {
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub sysctl '-n hw.ncpu : echo 4'
stub_make_install
@ -675,9 +907,8 @@ OUT
@test "number of CPU cores is detected on FreeBSD" {
cached_tarball "Python-3.6.2"
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
stub uname '-s : echo FreeBSD'
stub uname '-r : echo 11.0-RELEASE'
for i in {1..3}; do stub uname '-s : echo FreeBSD'; done
for i in {1..3}; do stub pkg false; done
stub sysctl '-n hw.ncpu : echo 1'
@ -704,7 +935,7 @@ OUT
@test "setting PYTHON_MAKE_INSTALL_OPTS to a multi-word string" {
cached_tarball "Python-3.6.2"
for i in {1..9}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub_make_install
@ -728,7 +959,7 @@ OUT
@test "--enable-shared is not added if --disable-shared is passed" {
cached_tarball "Python-3.6.2"
for i in {1..9}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub_make_install
@ -752,8 +983,8 @@ OUT
@test "configuring with dSYM in MacOS" {
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..6}; do stub brew false; done
stub_make_install
@ -779,7 +1010,7 @@ OUT
@test "configuring with dSYM has no effect in non-MacOS" {
cached_tarball "Python-3.6.2"
for i in {1..10}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub_make_install
run_inline_definition <<DEF
@ -811,10 +1042,8 @@ OUT
@test "make on FreeBSD 9 defaults to gmake" {
cached_tarball "Python-3.6.2"
stub uname "-s : echo FreeBSD" "-r : echo 9.1"
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
stub uname "-s : echo FreeBSD"
stub uname "-r : echo 9.1"
for i in {1..3}; do stub uname "-s : echo FreeBSD"; done
MAKE=gmake stub_make_install
@ -828,10 +1057,8 @@ OUT
@test "make on FreeBSD 10" {
cached_tarball "Python-3.6.2"
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE"
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
stub uname "-s : echo FreeBSD"
stub uname "-r : echo 10.0-RELEASE"
for i in {1..3}; do stub uname "-s : echo FreeBSD"; done
stub_make_install
@ -844,10 +1071,8 @@ OUT
@test "make on FreeBSD 11" {
cached_tarball "Python-3.6.2"
stub uname "-s : echo FreeBSD" "-r : echo 11.0-RELEASE"
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
stub uname "-s : echo FreeBSD"
stub uname "-r : echo 11.0-RELEASE"
for i in {1..3}; do stub uname "-s : echo FreeBSD"; done
stub_make_install
@ -866,7 +1091,7 @@ apply -p1 -i /my/patch.diff
exec ./configure "\$@"
CONF
for i in {1..9}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub apply 'echo apply "$@" >> build.log'
stub_make_install

View File

@ -9,8 +9,8 @@ export -n PYTHON_CONFIGURE_OPTS
@test "require_gcc on OS X 10.9" {
for i in {1..3}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.9.5'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.9.5'
stub gcc '--version : echo 4.2.1'
@ -31,8 +31,8 @@ OUT
}
@test "require_gcc on OS X 10.10" {
for i in {1..3}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub gcc '--version : echo 4.2.1'
@ -69,8 +69,8 @@ DEF
mkdir -p "$INSTALL_ROOT"
cd "$INSTALL_ROOT"
for i in {1..10}; do stub uname '-s : echo Darwin'; done
for i in {1..3}; do stub sw_vers '-productVersion : echo 10.10'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub cc 'false'
stub brew 'false'

View File

@ -55,7 +55,7 @@ NUM_DEFINITIONS="$(find "$BATS_TEST_DIRNAME"/../share/python-build -maxdepth 1 -
echo true > "${TMP}/definitions/2.7.8-test"
mkdir -p "${TMP}/other"
echo false > "${TMP}/other/2.7.8-test"
run bin/python-build "2.7.8-test" "${TMP}/install"
run python-build "2.7.8-test" "${TMP}/install"
assert_success ""
}

View File

@ -144,7 +144,7 @@ OUT
echo "bar" | install_patch definitions/vanilla-python "Python-3.6.2/bar.patch"
echo "baz" | install_patch definitions/vanilla-python "Python-3.6.2/baz.patch"
for i in {1..2}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
assert_success
@ -171,7 +171,7 @@ OUT
" : echo \"$MAKE \$@\" >> build.log" \
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
for i in {1..4}; do stub uname '-s : echo Darwin'; done
stub uname '-s : echo Darwin'
PYTHON_MAKE_INSTALL_TARGET="altinstall" TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
assert_success
@ -253,7 +253,8 @@ OUT
done
unset framework_path executable
for i in {1..3}; do stub uname '-s : echo Darwin'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
PYTHON_CONFIGURE_OPTS="--enable-framework" TMPDIR="$TMP" run_inline_definition <<OUT
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
@ -274,7 +275,8 @@ EOS
@test "enable universalsdk" {
for i in {1..3}; do stub uname '-s : echo Darwin'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub arch "echo x86_64"
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
@ -292,7 +294,8 @@ EOS
@test "enable universalsdk on Apple Silicon" {
for i in {1..3}; do stub uname '-s : echo Darwin'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 11.7'
stub arch "echo arm64"
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
@ -310,7 +313,8 @@ EOS
@test "enable universalsdk with explicit archs argument" {
for i in {1..3}; do stub uname '-s : echo Darwin'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 11.7'
PYTHON_CONFIGURE_OPTS="--enable-universalsdk --with-universal-archs=foo" TMPDIR="$TMP" run_inline_definition <<OUT
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
@ -325,7 +329,7 @@ EOS
cached_tarball "Python-3.6.2"
for i in {1..4}; do stub brew false; done
for i in {1..8}; do stub uname '-s : echo Linux'; done
stub uname '-s : echo Linux'
stub "$MAKE" \
" : echo \"$MAKE \$@\" >> build.log" \
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
@ -346,8 +350,8 @@ OUT
@test "default MACOSX_DEPLOYMENT_TARGET" {
# yyuu/pyenv#257
for i in {1..3}; do stub uname '-s : echo Darwin'; done
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
TMPDIR="$TMP" run_inline_definition <<OUT
echo "\${MACOSX_DEPLOYMENT_TARGET}"

View File

@ -70,3 +70,12 @@ pyenv-version-without-stderr() {
3.3.3 (set by PYENV_VERSION environment variable)
OUT
}
@test "--bare prints just the name" {
create_version "3.3.3"
PYENV_VERSION=3.3.3 run pyenv-version --bare
assert_success
assert_output <<OUT
3.3.3
OUT
}