Compare commits

...

7 Commits

Author SHA1 Message Date
Lysandros Nikolaou
9f036f5681
Merge 15e49d444f into fdde91269b 2025-11-19 17:15:20 +01:00
Ivan Pozdeev
fdde91269b
2.6.13
Some checks failed
macos_build / macos_build (3.10) (push) Has been cancelled
macos_build / macos_build (3.11) (push) Has been cancelled
macos_build / macos_build (3.12) (push) Has been cancelled
macos_build / macos_build (3.13) (push) Has been cancelled
macos_build / macos_build (3.9) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-14) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-15-intel) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-24.04) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.10) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.11) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.12) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.13) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.9) (push) Has been cancelled
2025-11-19 14:30:40 +03:00
Ned Batchelder
fa741b861a
Add CPython 3.15.0a2 (#3359) 2025-11-19 14:28:31 +03:00
Lysandros Nikolaou
15e49d444f
Merge branch 'master' into pixi-deps 2025-10-31 12:10:40 +01:00
Lysandros Nikolaou
c26bc24557
Update README 2025-10-23 15:59:23 +02:00
Lysandros Nikolaou
260a51a598
Factor out function for configuring tcltk flags 2025-10-23 15:51:37 +02:00
Lysandros Nikolaou
f434db24cd
Add support for recognizing pixi-installed dependencies
This commit adds support for using pixi as a package manager alongside
Homebrew and MacPorts on macOS. When pixi is detected and Homebrew/MacPorts
are not available (or skipped), python-build will automatically use
dependencies from pixi's `python-deps` environment.

Key changes:
- Add `can_use_pixi()` and `pixi_env_prefix()` helper functions to detect
  and configure pixi environments
- Add `use_pixi_*()` functions for yaml, readline, ncurses, openssl, zlib,
  and tcl-tk to link against pixi-provided dependencies
- Support `PYTHON_BUILD_SKIP_PIXI` environment variable to disable pixi
- Support `PYTHON_BUILD_PIXI_ENV` to specify a custom pixi environment name
  (defaults to "python-deps")

The pixi integration follows the same pattern as Homebrew and MacPorts,
checking for package availability via `pixi global list` and using the
environment directory from `pixi info`.
2025-10-22 12:24:23 +02:00
7 changed files with 430 additions and 35 deletions

View File

@ -1,5 +1,10 @@
# Version History
## Release v2.6.13
* CI: Replace macos-13 with macos-15-intel by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3356
* Add Miniconda3-25.9.1-1 by @binbjz in https://github.com/pyenv/pyenv/pull/3357
* Add CPython 3.15.0a2 by @nedbat in https://github.com/pyenv/pyenv/pull/3359
## Release v2.6.12
* Add graalpy-25.0.1 by @msimacek in https://github.com/pyenv/pyenv/pull/3350
* Add CPython 3.9.25 by @nedbat in https://github.com/pyenv/pyenv/pull/3355

View File

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

View File

@ -144,10 +144,19 @@ MacPorts Homebrew is used to find dependency packages if `port` is found on `PAT
Set `PYTHON_BUILD_USE_MACPORTS` or `PYTHON_BUILD_SKIP_MACPORTS` to override this default.
###### Interaction with Homebrew
##### Pixi
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.
Pixi is used to find dependency packages if `pixi` is found on `PATH` in both MacOS and Linux.
Set `PYTHON_BUILD_USE_PIXI` or `PYTHON_BUILD_SKIP_PIXI` to override this default.
By default, python-build looks for dependencies in a Pixi global environment named `python-deps`.
You can override this by setting `PYTHON_BUILD_PIXI_ENV` to a different environment name.
##### Interaction between Homebrew, MacPorts and pixi
If more than once package ecosystems are installed, Homebrew takes preference, then MacPorts, then pixi.
The first ecosystem where any of the required dependency packages is found is used.
##### Portage
@ -178,6 +187,9 @@ You can set certain environment variables to control the build process.
* `PYTHON_BUILD_TCLTK_FORMULA`, override the Homebrew Tcl/Tk 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_SKIP_PIXI`, if set, will not search for libraries installed by pixi when it would normally will.
* `PYTHON_BUILD_USE_PIXI`, if set, will search for libraries installed by pixi when it would normally not.
* `PYTHON_BUILD_PIXI_ENV`, override the Pixi global environment to use (defaults to `python-deps`).
* `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

@ -14,7 +14,7 @@
# -g/--debug Build a debug version
#
PYTHON_BUILD_VERSION="2.6.12"
PYTHON_BUILD_VERSION="2.6.13"
OLDIFS="$IFS"
@ -166,6 +166,60 @@ can_use_macports() {
PYTHON_BUILD_SKIP_MACPORTS=1; return 1
}
can_use_pixi() {
if locked_in; then
locked_in pixi && rc=$? || rc=$?; return $rc
fi
[[ -n "$PYTHON_BUILD_USE_PIXI" && -n "$PYTHON_BUILD_SKIP_PIXI" ]] && {
echo "error: mutually exclusive environment variables PYTHON_BUILD_USE_PIXI and PYTHON_BUILD_SKIP_PIXI are set" >&3
exit 1
}
[[ -n "$PYTHON_BUILD_USE_PIXI" ]] && return 0
[[ -n "$PYTHON_BUILD_SKIP_PIXI" ]] && return 1
# Return cached result if already checked
[[ -n "$PYTHON_BUILD_PIXI_ENVS_DIR" ]] && return 0
# Check if pixi exists and cache the environment directory
local envs_dir
command -v pixi &>/dev/null && \
envs_dir="$(pixi info 2>/dev/null | grep 'Environment dir:' | awk '{print $3}')" && \
[[ -n "$envs_dir" ]] && { export PYTHON_BUILD_PIXI_ENVS_DIR="$envs_dir"; return 0; }
# do not check the same stuff multiple times
PYTHON_BUILD_SKIP_PIXI=1; return 1
}
pixi_env_prefix() {
# Return cached value if available
if [[ -n "${PYTHON_BUILD_PIXI_PREFIX:-}" ]]; then
echo "$PYTHON_BUILD_PIXI_PREFIX"
return 0
fi
# Use PYTHON_BUILD_PIXI_ENV if set, otherwise default to "python-deps"
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
# Use cached envs_dir if available, otherwise get it from pixi info
local envs_dir="${PYTHON_BUILD_PIXI_ENVS_DIR:-}"
if [ -z "$envs_dir" ]; then
envs_dir="$(pixi info 2>/dev/null | grep 'Environment dir:' | awk '{print $3}')"
if [ -z "$envs_dir" ]; then
return 1
fi
export PYTHON_BUILD_PIXI_ENVS_DIR="$envs_dir"
fi
local prefix="${envs_dir}/${env_name}"
# Check if the environment exists
if [ -d "$prefix" ]; then
# Cache the prefix for subsequent calls
export PYTHON_BUILD_PIXI_PREFIX="$prefix"
echo "$prefix"
return 0
fi
return 1
}
locked_in() {
if [[ -z "$1" ]]; then
[[ -n $_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN ]]
@ -889,13 +943,28 @@ build_package_standard_build() {
use_macports_zlib || true
fi
fi
if can_use_pixi; then
use_custom_tcltk || use_pixi_tcltk || true
use_pixi_readline || true
use_pixi_ncurses || true
if is_mac -ge 1014; then
# While XCode SDK is "always available",
# still need a fallback in case we are using an alternate compiler
use_xcode_sdk_zlib || use_pixi_zlib || true
else
use_pixi_zlib || true
fi
fi
if can_use_homebrew; then
use_homebrew || true
fi
if can_use_macports; then
use_macports || true
fi
if is_mac -ge 1014 && ! can_use_homebrew && ! can_use_macports; then
if can_use_pixi; then
use_pixi || true
fi
if is_mac -ge 1014 && ! can_use_homebrew && ! can_use_macports && ! can_use_pixi; then
use_xcode_sdk_zlib || true
fi
@ -1530,12 +1599,25 @@ use_macports() {
fi
}
use_pixi() {
can_use_pixi || return 1
if command -v pixi &>/dev/null; then
local prefix="$(pixi_env_prefix)" || return 1
export CPPFLAGS="-I${prefix}/include${CPPFLAGS:+ $CPPFLAGS}"
prepend_ldflags_libs "-L${prefix}/lib -Wl,-rpath,${prefix}/lib"
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
lock_in pixi
fi
}
needs_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
elif can_use_pixi; then
use_pixi_yaml && return 1
fi
fi
}
@ -1563,6 +1645,17 @@ use_macports_yaml() {
fi
}
use_pixi_yaml() {
can_use_pixi || return 1
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
if pixi global list --environment "$env_name" 2>/dev/null | grep -q "^yaml"; then
echo "python-build: use libyaml from pixi (${env_name})"
lock_in pixi
else
return 1
fi
}
use_freebsd_pkg() {
# check if FreeBSD
if [ "FreeBSD" = "${_PYTHON_BUILD_CACHE_UNAME_S:=$(uname -s)}" ]; then
@ -1606,6 +1699,9 @@ has_broken_mac_readline() {
if can_use_macports; then
use_macports_readline && return 1
fi
if can_use_pixi; then
use_pixi_readline && return 1
fi
return 0
}
@ -1636,6 +1732,19 @@ use_macports_readline() {
fi
}
use_pixi_readline() {
can_use_pixi || return 1
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
if pixi global list --environment "$env_name" 2>/dev/null | grep -q "^readline"; then
echo "python-build: use readline from pixi (${env_name})"
lock_in pixi
else
return 1
fi
fi
}
use_homebrew_ncurses() {
can_use_homebrew || return 1
local libdir="$(brew --prefix ncurses 2>/dev/null || true)"
@ -1659,6 +1768,17 @@ use_macports_ncurses() {
fi
}
use_pixi_ncurses() {
can_use_pixi || return 1
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
if pixi global list --environment "$env_name" 2>/dev/null | grep -q "^ncurses"; then
echo "python-build: use ncurses from pixi (${env_name})"
lock_in pixi
else
return 1
fi
}
prefer_openssl11() {
# Allow overriding the preference of OpenSSL version per definition basis (#1302, #1325, #1326)
PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA="${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl@1.1 openssl}"
@ -1695,6 +1815,9 @@ has_broken_mac_openssl() {
if can_use_macports; then
use_macports_openssl && return 1
fi
if can_use_pixi; then
use_pixi_openssl && return 1
fi
fi
return 0
}
@ -1742,6 +1865,26 @@ use_macports_openssl() {
return 1
}
use_pixi_openssl() {
can_use_pixi || return 1
command -v pixi >/dev/null || return 1
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
if pixi global list --environment "$env_name" 2>/dev/null | grep -q "^openssl"; then
echo "python-build: use openssl from pixi (${env_name})"
if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
# configure script of newer CPython versions support `--with-openssl`
# https://bugs.python.org/issue21541
local prefix="$(pixi_env_prefix)" || return 1
package_option python configure --with-openssl="${prefix}"
fi
lock_in pixi
return 0
fi
return 1
}
build_package_mac_openssl() {
# Install to a subdirectory since we don't want shims for bin/openssl.
OPENSSL_PREFIX_PATH="${PREFIX_PATH}/openssl"
@ -1878,6 +2021,46 @@ use_macports_zlib() {
fi
}
use_pixi_zlib() {
can_use_pixi || return 1
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
if pixi global list --environment "$env_name" 2>/dev/null | grep -q "^zlib"; then
echo "python-build: use zlib from pixi (${env_name})"
lock_in pixi
else
return 1
fi
}
configure_tcltk_flags() {
local prefix="$1"
# In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir.
local tcltk_includes="$(sh -c 'cd '"$prefix"'/lib; . ./tclConfig.sh; . ./tkConfig.sh; echo "$TCL_INCLUDE_SPEC $TK_INCLUDE_SPEC"')"
# Homebrew Tcl/Tk 9 is built with external libtommath. CPython's build as of 3.14.0 does not detect that and fails to link to tommath symbols
local tcltk_cflags=""
if sh -c '. '"$prefix"'/lib/tclConfig.sh; echo "$TCL_DEFS"' | grep -qwFe '-DTCL_WITH_EXTERNAL_TOMMATH=1'; then
tcltk_cflags="-DTCL_WITH_EXTERNAL_TOMMATH=1"
fi
# For some reason, keg-only tcl-tk@8 successfully links with Tkinter without specifying rpath, with `/opt' rpath
# so no need to translate /Cellar path to /opt path
local tcltk_libs="$(sh -c 'cd '"$prefix"'/lib; . ./tclConfig.sh; . ./tkConfig.sh; echo "$TCL_LIB_SPEC $TK_LIB_SPEC"')"
# Since 2.7.6, 3.3.3, 3.4.0 (Issue #1584): --with-tcltk-includes + --with-tcltk-libs Configure options
# Since 3.11.0 (bpo-45847): `pkg-config` call, TCLTK_CFLAGS + TCLTK_LIBS override
if [[ -n "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
# pkg-config is not present out of the box in MacOS.
# There's no way to provide a fallback only if it's is not present
# and Configure's logic of detecting if it's present is complicated.
# So we just override it always
export TCLTK_CFLAGS="$tcltk_includes${tcltk_cflags:+ $tcltk_cflags}"
export TCLTK_LIBS="$tcltk_libs"
else
package_option python configure --with-tcltk-includes="$tcltk_includes"
package_option python configure --with-tcltk-libs="$tcltk_libs"
[[ -n $tcltk_cflags ]] && export CFLAGS="${tcltk_cflags}${CFLAGS:+ $CFLAGS}"
fi
}
use_homebrew_tcltk() {
can_use_homebrew || return 1
local tcltk_formula
@ -1888,33 +2071,9 @@ use_homebrew_tcltk() {
local tcltk_prefix="$(brew --prefix "${tcltk_formula}" 2>/dev/null || true)"
if [ -d "$tcltk_prefix" ]; then
echo "python-build: use ${tcltk_formula} from homebrew"
# In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir.
local tcltk_includes="$(sh -c 'cd '"$tcltk_prefix"'/lib; . ./tclConfig.sh; . ./tkConfig.sh; echo "$TCL_INCLUDE_SPEC $TK_INCLUDE_SPEC"')"
# Homebrew Tcl/Tk 9 is built with external libtommath. CPython's build as of 3.14.0 does not detect that and fails to link to tommath symbols
local tcltk_cflags
if sh -c '. '"$tcltk_prefix"'/lib/tclConfig.sh; echo "$TCL_DEFS"' | grep -qwFe '-DTCL_WITH_EXTERNAL_TOMMATH=1'; then
tcltk_cflags="-DTCL_WITH_EXTERNAL_TOMMATH=1"
fi
# For some reason, keg-only tcl-tk@8 successfully links with Tkinter without specifying rpath, with `/opt' rpath
# so no need to translate /Cellar path to /opt path
local tcltk_libs="$(sh -c 'cd '"$tcltk_prefix"'/lib; . ./tclConfig.sh; . ./tkConfig.sh; echo "$TCL_LIB_SPEC $TK_LIB_SPEC"')"
# Since 2.7.6, 3.3.3, 3.4.0 (Issue #1584): --with-tcltk-includes + --with-tcltk-libs Configure options
# Since 3.11.0 (bpo-45847): `pkg-config` call, TCLTK_CFLAGS + TCLTK_LIBS override
if [[ -n "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
# pkg-config is not present out of the box in MacOS.
# There's no way to provide a fallback only if it's is not present
# and Configure's logic of detecting if it's present is complicated.
# So we just override it always
export TCLTK_CFLAGS="$tcltk_includes${tcltk_cflags:+ $tcltk_cflags}"
export TCLTK_LIBS="$tcltk_libs"
else
package_option python configure --with-tcltk-includes="$tcltk_includes"
package_option python configure --with-tcltk-libs="$tcltk_libs"
[[ -n $tcltk_cflags ]] && export CFLAGS="${tcltk_cflags}${CFLAGS:+ $CFLAGS}"
fi
#set in either case as a failsafe
configure_tcltk_flags "$tcltk_prefix"
# set PKG_CONFIG_PATH as a failsafe
export PKG_CONFIG_PATH="${tcltk_prefix}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
lock_in homebrew
return 0
fi
@ -1922,6 +2081,22 @@ use_homebrew_tcltk() {
return 1
}
use_pixi_tcltk() {
can_use_pixi || return 1
local env_name="${PYTHON_BUILD_PIXI_ENV:-python-deps}"
# Check if tk is actually installed there
if pixi global list --environment "$env_name" 2>/dev/null | grep -q "^tk"; then
echo "python-build: use tk from pixi (${env_name})"
local prefix="$(pixi_env_prefix)" || return 1
configure_tcltk_flags "$prefix"
lock_in pixi
return 0
fi
return 1
}
# FIXME: this function is a workaround for #1125
# once fixed, it should be removed.
# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk

View File

@ -4,7 +4,7 @@ export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
install_package "openssl-3.6.0" "https://github.com/openssl/openssl/releases/download/openssl-3.6.0/openssl-3.6.0.tar.gz#b6a5f44b7eb69e3fa35dbf15524405b44837a481d43d81daddde3ff21fcbb8e9" mac_openssl --if has_broken_mac_openssl
install_package "readline-8.3" "https://ftpmirror.gnu.org/readline/readline-8.3.tar.gz#fe5383204467828cd495ee8d1d3c037a7eba1389c22bc6a041f627976f9061cc" mac_readline --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.15.0a1" "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a1.tar.xz#3194939d488eeaeefdcf990d35542d9ad1ce788789c4e2305a2060eb7058e5a4" standard verify_py314 copy_python_gdb ensurepip
install_package "Python-3.15.0a2" "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a2.tar.xz#d8a0a2f4a7f3d7090cf195e81814efe95f70554955557f40e149d8694a662751" standard verify_py315 copy_python_gdb ensurepip
else
install_package "Python-3.15.0a1" "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a1.tgz#d70f3895c97db60d058bbdfa3a55fadd385bcb1c1269e686040858e3c109c993" standard verify_py314 copy_python_gdb ensurepip
install_package "Python-3.15.0a2" "https://www.python.org/ftp/python/3.15.0/Python-3.15.0a2.tgz#484924d5f963f3d4215ca50c13634b6a7067e9f273893145a6209fe7c93b78ff" standard verify_py315 copy_python_gdb ensurepip
fi

View File

@ -212,16 +212,19 @@ make install
OUT
}
@test "Homebrew and port are tried if both are present in PATH in MacOS" {
@test "Homebrew, port, and pixi are tried if all are present in PATH in MacOS" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$BATS_TEST_TMPDIR/homebrew-prefix"
PIXI_PREFIX="$BATS_TEST_TMPDIR/pixi-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 pixi "info : echo 'Environment dir: $PIXI_PREFIX'"
for i in {1..4}; do stub pixi false; done
stub_make_install
export PYENV_DEBUG=1
@ -234,6 +237,7 @@ DEF
unstub sw_vers
unstub brew
unstub port
unstub pixi
unstub make
assert_build_log <<OUT
@ -306,6 +310,38 @@ make install
OUT
}
@test "pixi is used if Homebrew and MacPorts were not picked" {
cached_tarball "Python-3.6.2"
PIXI_ENV_DIR="$BATS_TEST_TMPDIR/pixi-envs"
mkdir -p "$PIXI_ENV_DIR/python-deps"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub pixi "info : echo 'Environment dir: $PIXI_ENV_DIR'"
for i in {1..4}; do stub pixi false; done
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"
DEF
assert_success
unstub uname
unstub sw_vers
unstub pixi
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${PIXI_ENV_DIR}/python-deps/include -I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${PIXI_ENV_DIR}/python-deps/lib -Wl,-rpath,${PIXI_ENV_DIR}/python-deps/lib -L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${PIXI_ENV_DIR}/python-deps/lib/pkgconfig"
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"
@ -483,6 +519,107 @@ make install
OUT
}
@test "yaml is linked from pixi" {
cached_tarball "Python-3.6.2"
PIXI_ENV_DIR="$BATS_TEST_TMPDIR/pixi-envs"
mkdir -p "$PIXI_ENV_DIR/python-deps"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub pixi "info : echo 'Environment dir: $PIXI_ENV_DIR'"
stub pixi "global list --environment python-deps : echo yaml"
for i in {1..4}; do stub pixi false; done
stub_make_install
export PYTHON_BUILD_SKIP_HOMEBREW=1
export PYTHON_BUILD_SKIP_MACPORTS=1
install_fixture definitions/needs-yaml
assert_success
unstub uname
unstub sw_vers
unstub pixi
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${PIXI_ENV_DIR}/python-deps/include -I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${PIXI_ENV_DIR}/python-deps/lib -Wl,-rpath,${PIXI_ENV_DIR}/python-deps/lib -L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${PIXI_ENV_DIR}/python-deps/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "readline is linked from pixi" {
cached_tarball "Python-3.6.2"
PIXI_ENV_DIR="$BATS_TEST_TMPDIR/pixi-envs"
mkdir -p "$PIXI_ENV_DIR/python-deps"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub pixi "info : echo 'Environment dir: $PIXI_ENV_DIR'"
stub pixi false
stub pixi "global list --environment python-deps : echo readline"
stub pixi false
stub pixi 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"
DEF
assert_success
unstub uname
unstub sw_vers
unstub pixi
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${PIXI_ENV_DIR}/python-deps/include -I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${PIXI_ENV_DIR}/python-deps/lib -Wl,-rpath,${PIXI_ENV_DIR}/python-deps/lib -L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${PIXI_ENV_DIR}/python-deps/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "ncurses is linked from pixi" {
cached_tarball "Python-3.6.2"
PIXI_ENV_DIR="$BATS_TEST_TMPDIR/pixi-envs"
mkdir -p "$PIXI_ENV_DIR/python-deps"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub pixi "info : echo 'Environment dir: $PIXI_ENV_DIR'"
stub pixi false
stub pixi false
stub pixi "global list --environment python-deps : echo ncurses"
stub pixi 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"
DEF
assert_success
unstub uname
unstub sw_vers
unstub pixi
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${PIXI_ENV_DIR}/python-deps/include -I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${PIXI_ENV_DIR}/python-deps/lib -Wl,-rpath,${PIXI_ENV_DIR}/python-deps/lib -L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${PIXI_ENV_DIR}/python-deps/lib/pkgconfig"
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"
@ -605,6 +742,36 @@ make install
OUT
}
@test "pixi is not touched if PYTHON_BUILD_SKIP_PIXI is set" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew false
stub port false
stub pixi true; pixi
stub_make_install
export PYTHON_BUILD_SKIP_HOMEBREW=1
export PYTHON_BUILD_SKIP_MACPORTS=1
export PYTHON_BUILD_SKIP_PIXI=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 pixi
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/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"
@ -1001,6 +1168,42 @@ make install
OUT
}
@test "tcl-tk is linked from pixi via --with-tcl-*" {
cached_tarball "Python-3.6.2"
PIXI_ENV_DIR="$BATS_TEST_TMPDIR/pixi-envs"
mkdir -p "$PIXI_ENV_DIR/python-deps"
stub_tcltk "$PIXI_ENV_DIR/python-deps"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub pixi "info : echo 'Environment dir: $PIXI_ENV_DIR'"
stub pixi "global list --environment python-deps : echo tk"
stub pixi false
stub pixi false
stub pixi 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"
DEF
assert_success
unstub uname
unstub sw_vers
unstub pixi
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${PIXI_ENV_DIR}/python-deps/include -I${BATS_TEST_TMPDIR}/install/include" LDFLAGS="-L${PIXI_ENV_DIR}/python-deps/lib -Wl,-rpath,${PIXI_ENV_DIR}/python-deps/lib -L${BATS_TEST_TMPDIR}/install/lib -Wl,-rpath,${BATS_TEST_TMPDIR}/install/lib" PKG_CONFIG_PATH="${PIXI_ENV_DIR}/python-deps/lib/pkgconfig"
Python-3.6.2: --prefix=${BATS_TEST_TMPDIR}/install --enable-shared --libdir=${BATS_TEST_TMPDIR}/install/lib --with-tcltk-includes=-I${PIXI_ENV_DIR}/python-deps/include -I${PIXI_ENV_DIR}/python-deps/include --with-tcltk-libs=-L${PIXI_ENV_DIR}/python-deps/lib -ltclX.Y -L${PIXI_ENV_DIR}/python-deps/lib -ltkX.Y
make -j 2
make install
OUT
}
@test "number of CPU cores defaults to 2" {
cached_tarball "Python-3.6.2"