mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-10 12:33:48 -05:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ab9683e58 | ||
|
|
7fe647968d | ||
|
|
c8daaa3954 | ||
|
|
88be70722f | ||
|
|
47d88d2c5f | ||
|
|
6b758c8cf9 | ||
|
|
017b6d877e | ||
|
|
063aa457e4 | ||
|
|
fcd7806529 | ||
|
|
a3f0bddc2a | ||
|
|
f72c1712dc | ||
|
|
a7b181c3ca | ||
|
|
c8c324afb4 | ||
|
|
72c5b034ca | ||
|
|
446411dc64 | ||
|
|
9fe80f28e5 | ||
|
|
9248255f70 | ||
|
|
368e04f3fa | ||
|
|
76e93b073e | ||
|
|
e3fe82a9b1 | ||
|
|
dd60d5fae2 | ||
|
|
96828af31e | ||
|
|
c998eae677 | ||
|
|
c20fc7bd6a | ||
|
|
f1a1f59c87 | ||
|
|
b64b0ab5e2 | ||
|
|
1a0b555baf | ||
|
|
819e2b8f45 | ||
|
|
bd618ea9ef |
2
.github/workflows/macos_build.yml
vendored
2
.github/workflows/macos_build.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- "3.11"
|
- "3.11"
|
||||||
runs-on: macos-11
|
runs-on: macos-11
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
# Normally, we would use the superbly maintained...
|
# Normally, we would use the superbly maintained...
|
||||||
# - uses: actions/setup-python@v2
|
# - uses: actions/setup-python@v2
|
||||||
# with:
|
# with:
|
||||||
|
|||||||
6
.github/workflows/modified_scripts_build.yml
vendored
6
.github/workflows/modified_scripts_build.yml
vendored
@@ -6,7 +6,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
versions: ${{steps.modified-versions.outputs.versions}}
|
versions: ${{steps.modified-versions.outputs.versions}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- run: git fetch origin "$GITHUB_BASE_REF"
|
- run: git fetch origin "$GITHUB_BASE_REF"
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: >
|
run: >
|
||||||
@@ -30,7 +30,7 @@ jobs:
|
|||||||
os: ["macos-11", "macos-12"]
|
os: ["macos-11", "macos-12"]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- run: |
|
- run: |
|
||||||
#envvars
|
#envvars
|
||||||
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
os: ["ubuntu-20.04", "ubuntu-22.04"]
|
os: ["ubuntu-20.04", "ubuntu-22.04"]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- run: |
|
- run: |
|
||||||
#envvars
|
#envvars
|
||||||
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
||||||
|
|||||||
7
.github/workflows/pyenv_tests.yml
vendored
7
.github/workflows/pyenv_tests.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
- macos-11
|
- macos-11
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
# Normally, we would use the superbly maintained...
|
# Normally, we would use the superbly maintained...
|
||||||
# - uses: actions/setup-python@v2
|
# - uses: actions/setup-python@v2
|
||||||
# with:
|
# with:
|
||||||
@@ -42,3 +42,8 @@ jobs:
|
|||||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||||
- run: |
|
- run: |
|
||||||
make test
|
make test
|
||||||
|
- env:
|
||||||
|
PYENV_NATIVE_EXT: 1
|
||||||
|
run: |
|
||||||
|
(cd src; ./configure; make)
|
||||||
|
bats/bin/bats test/{pyenv,hooks,versions}.bats
|
||||||
2
.github/workflows/ubuntu_build.yml
vendored
2
.github/workflows/ubuntu_build.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- "3.11"
|
- "3.11"
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
# Normally, we would use the superbly maintained...
|
# Normally, we would use the superbly maintained...
|
||||||
# - uses: actions/setup-python@v2
|
# - uses: actions/setup-python@v2
|
||||||
# with:
|
# with:
|
||||||
|
|||||||
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,5 +1,23 @@
|
|||||||
# Version History
|
# Version History
|
||||||
|
|
||||||
|
## Release 2.3.13
|
||||||
|
|
||||||
|
* Fix pyenv-latest to ignore virtualenvs by @native-api in https://github.com/pyenv/pyenv/pull/2608
|
||||||
|
* Show symlink contents in non-bare `pyenv versions' by @native-api in https://github.com/pyenv/pyenv/pull/2609
|
||||||
|
* Ignore virtualenvs in `pyenv latest' in a clean way by @native-api in https://github.com/pyenv/pyenv/pull/2610
|
||||||
|
* Fix link resolving in pyenv-versions by @laggardkernel in https://github.com/pyenv/pyenv/pull/2612
|
||||||
|
* Add CPython 3.11.2 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/2615
|
||||||
|
* Add CPython 3.10.10 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/2616
|
||||||
|
* Add CPython 3.12.0a5 by @Afront in https://github.com/pyenv/pyenv/pull/2614
|
||||||
|
|
||||||
|
## Release 2.3.12
|
||||||
|
|
||||||
|
* Undefined name: do not forget self when accessing flavor by @cclauss in https://github.com/pyenv/pyenv/pull/2595
|
||||||
|
* Fix wrong libpython being linked to in MacOS by @native-api in https://github.com/pyenv/pyenv/pull/2596
|
||||||
|
* Fix `:latest` by @native-api in https://github.com/pyenv/pyenv/pull/2599
|
||||||
|
* Fix `pyenv which` to support auto-resolved prefixes by @native-api in https://github.com/pyenv/pyenv/pull/2601
|
||||||
|
* Add more recent build of nogil Python. by @colesbury in https://github.com/pyenv/pyenv/pull/2602
|
||||||
|
|
||||||
## Release 2.3.11
|
## Release 2.3.11
|
||||||
|
|
||||||
* Add CPython 3.12.0a4 by @Afront in https://github.com/pyenv/pyenv/pull/2590
|
* Add CPython 3.12.0a4 by @Afront in https://github.com/pyenv/pyenv/pull/2590
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
|||||||
* [Install Python build dependencies](#install-python-build-dependencies)
|
* [Install Python build dependencies](#install-python-build-dependencies)
|
||||||
* **[Usage](#usage)**
|
* **[Usage](#usage)**
|
||||||
* [Install additional Python versions](#install-additional-python-versions)
|
* [Install additional Python versions](#install-additional-python-versions)
|
||||||
* [Prefix auto-resolution](#prefix-auto-resolution)
|
* [Prefix auto-resolution to the latest version](#prefix-auto-resolution-to-the-latest-version)
|
||||||
* [Python versions with extended support](#python-versions-with-extended-support)
|
* [Python versions with extended support](#python-versions-with-extended-support)
|
||||||
* [Switch between Python versions](#switch-between-python-versions)
|
* [Switch between Python versions](#switch-between-python-versions)
|
||||||
* [Uninstall Python versions](#uninstall-python-versions)
|
* [Uninstall Python versions](#uninstall-python-versions)
|
||||||
@@ -412,7 +412,7 @@ please visit the wiki page about
|
|||||||
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
||||||
|
|
||||||
|
|
||||||
#### Prefix auto-resolution
|
#### Prefix auto-resolution to the latest version
|
||||||
|
|
||||||
All Pyenv subcommands except `uninstall` automatically resolve full prefixes to the latest version in the corresponding version line.
|
All Pyenv subcommands except `uninstall` automatically resolve full prefixes to the latest version in the corresponding version line.
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
version="2.3.11"
|
version="2.3.13"
|
||||||
git_revision=""
|
git_revision=""
|
||||||
|
|
||||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ exitcode=0
|
|||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|
||||||
if [[ -z $FROM_KNOWN ]]; then
|
if [[ -z $FROM_KNOWN ]]; then
|
||||||
DEFINITION_CANDIDATES=( $(pyenv-versions --bare) )
|
DEFINITION_CANDIDATES=( $(pyenv-versions --bare --skip-envs) )
|
||||||
else
|
else
|
||||||
DEFINITION_CANDIDATES=( $(python-build --definitions ) )
|
DEFINITION_CANDIDATES=( $(python-build --definitions ) )
|
||||||
fi
|
fi
|
||||||
@@ -50,7 +50,7 @@ IFS=$'\n'
|
|||||||
|
|
||||||
DEFINITION_CANDIDATES=(\
|
DEFINITION_CANDIDATES=(\
|
||||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
||||||
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(b|rc)[0-9]+$/d'));
|
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d'));
|
||||||
|
|
||||||
# Compose a sorting key, followed by | and original value
|
# Compose a sorting key, followed by | and original value
|
||||||
DEFINITION_CANDIDATES=(\
|
DEFINITION_CANDIDATES=(\
|
||||||
|
|||||||
@@ -1,23 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Summary: List all Python versions available to pyenv
|
# Summary: List all Python versions available to pyenv
|
||||||
# Usage: pyenv versions [--bare] [--skip-aliases]
|
# Usage: pyenv versions [--bare] [--skip-aliases] [--skip-envs]
|
||||||
#
|
#
|
||||||
# Lists all Python versions found in `$PYENV_ROOT/versions/*'.
|
# Lists all Python versions found in `$PYENV_ROOT/versions/*'.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
unset bare
|
unset bare skip_aliases skip_envs
|
||||||
unset skip_aliases
|
|
||||||
# Provide pyenv completions
|
# Provide pyenv completions
|
||||||
for arg; do
|
for arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--complete )
|
--complete )
|
||||||
echo --bare
|
echo --bare
|
||||||
echo --skip-aliases
|
echo --skip-aliases
|
||||||
|
echo --skip-envs
|
||||||
exit ;;
|
exit ;;
|
||||||
--bare ) bare=1 ;;
|
--bare ) bare=1 ;;
|
||||||
--skip-aliases ) skip_aliases=1 ;;
|
--skip-aliases ) skip_aliases=1 ;;
|
||||||
|
--skip-envs ) skip_envs=1 ;;
|
||||||
* )
|
* )
|
||||||
pyenv-help --usage versions >&2
|
pyenv-help --usage versions >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -70,8 +71,6 @@ else
|
|||||||
current_versions=()
|
current_versions=()
|
||||||
fi
|
fi
|
||||||
if [ -n "$bare" ]; then
|
if [ -n "$bare" ]; then
|
||||||
hit_prefix=""
|
|
||||||
miss_prefix=""
|
|
||||||
include_system=""
|
include_system=""
|
||||||
else
|
else
|
||||||
hit_prefix="* "
|
hit_prefix="* "
|
||||||
@@ -104,10 +103,23 @@ exists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_version() {
|
print_version() {
|
||||||
|
local version="${1:?}"
|
||||||
|
if [[ -n $bare ]]; then
|
||||||
|
echo "$version"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
local path="${2:?}"
|
||||||
|
if [[ -L "$path" ]]; then
|
||||||
|
# Only resolve the link itself for printing, do not resolve further.
|
||||||
|
# Doing otherwise would misinform the user of what the link contains.
|
||||||
|
version_repr="$version --> $(readlink "$path")"
|
||||||
|
else
|
||||||
|
version_repr="$version"
|
||||||
|
fi
|
||||||
if [[ ${BASH_VERSINFO[0]} -ge 4 && ${current_versions["$1"]} ]]; then
|
if [[ ${BASH_VERSINFO[0]} -ge 4 && ${current_versions["$1"]} ]]; then
|
||||||
echo "${hit_prefix}$1 (set by $(pyenv-version-origin))"
|
echo "${hit_prefix}${version_repr} (set by $(pyenv-version-origin))"
|
||||||
elif (( ${BASH_VERSINFO[0]} <= 3 )) && exists "$1" "${current_versions[@]}"; then
|
elif (( ${BASH_VERSINFO[0]} <= 3 )) && exists "$1" "${current_versions[@]}"; then
|
||||||
echo "${hit_prefix}$1 (set by $(pyenv-version-origin))"
|
echo "${hit_prefix}${version_repr} (set by $(pyenv-version-origin))"
|
||||||
else
|
else
|
||||||
echo "${miss_prefix}$1"
|
echo "${miss_prefix}$1"
|
||||||
fi
|
fi
|
||||||
@@ -119,7 +131,7 @@ if [ -n "$include_system" ] && \
|
|||||||
(PYENV_VERSION=system pyenv-which python >/dev/null 2>&1 || \
|
(PYENV_VERSION=system pyenv-which python >/dev/null 2>&1 || \
|
||||||
PYENV_VERSION=system pyenv-which python3 >/dev/null 2>&1 || \
|
PYENV_VERSION=system pyenv-which python3 >/dev/null 2>&1 || \
|
||||||
PYENV_VERSION=system pyenv-which python2 >/dev/null 2>&1) ; then
|
PYENV_VERSION=system pyenv-which python2 >/dev/null 2>&1) ; then
|
||||||
print_version system
|
print_version system "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
shopt -s dotglob nullglob
|
shopt -s dotglob nullglob
|
||||||
@@ -139,17 +151,19 @@ for path in "${versions_dir_entries[@]}"; do
|
|||||||
if [ -d "$path" ]; then
|
if [ -d "$path" ]; then
|
||||||
if [ -n "$skip_aliases" ] && [ -L "$path" ]; then
|
if [ -n "$skip_aliases" ] && [ -L "$path" ]; then
|
||||||
target="$(realpath "$path")"
|
target="$(realpath "$path")"
|
||||||
[ "${target%/*}" != "$versions_dir" ] || continue
|
[ "${target%/*}" == "$versions_dir" ] && continue
|
||||||
[ "${target%/*/envs/*}" != "$versions_dir" ] || continue
|
[ "${target%/*/envs/*}" == "$versions_dir" ] && continue
|
||||||
fi
|
fi
|
||||||
print_version "${path##*/}"
|
print_version "${path##*/}" "$path"
|
||||||
# virtual environments created by anaconda/miniconda
|
# virtual environments created by anaconda/miniconda/pyenv-virtualenv
|
||||||
|
if [[ -z $skip_envs ]]; then
|
||||||
for env_path in "${path}/envs/"*; do
|
for env_path in "${path}/envs/"*; do
|
||||||
if [ -d "${env_path}" ]; then
|
if [ -d "${env_path}" ]; then
|
||||||
print_version "${env_path#${PYENV_ROOT}/versions/}"
|
print_version "${env_path#${PYENV_ROOT}/versions/}" "${env_path}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
shopt -u dotglob nullglob
|
shopt -u dotglob nullglob
|
||||||
|
|
||||||
|
|||||||
@@ -47,12 +47,20 @@ OLDIFS="$IFS"
|
|||||||
IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name)})
|
IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name)})
|
||||||
IFS="$OLDIFS"
|
IFS="$OLDIFS"
|
||||||
|
|
||||||
|
declare -a nonexistent_versions
|
||||||
|
|
||||||
for version in "${versions[@]}" "$system"; do
|
for version in "${versions[@]}" "$system"; do
|
||||||
if [ "$version" = "system" ]; then
|
if [ "$version" = "system" ]; then
|
||||||
PATH="$(remove_from_path "${PYENV_ROOT}/shims")"
|
PATH="$(remove_from_path "${PYENV_ROOT}/shims")"
|
||||||
PYENV_COMMAND_PATH="$(command -v "$PYENV_COMMAND" || true)"
|
PYENV_COMMAND_PATH="$(command -v "$PYENV_COMMAND" || true)"
|
||||||
else
|
else
|
||||||
PYENV_COMMAND_PATH="${PYENV_ROOT}/versions/${version}/bin/${PYENV_COMMAND}"
|
# $version may be a prefix to be resolved by pyenv-latest
|
||||||
|
version_path="$(pyenv-prefix "${version}" 2>/dev/null)" || \
|
||||||
|
{ nonexistent_versions+=("$version"); continue; }
|
||||||
|
# resolve $version for hooks
|
||||||
|
version="$(basename "$version_path")"
|
||||||
|
PYENV_COMMAND_PATH="$version_path/bin/${PYENV_COMMAND}"
|
||||||
|
unset version_path
|
||||||
fi
|
fi
|
||||||
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||||
break
|
break
|
||||||
@@ -69,17 +77,10 @@ done
|
|||||||
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||||
echo "$PYENV_COMMAND_PATH"
|
echo "$PYENV_COMMAND_PATH"
|
||||||
else
|
else
|
||||||
any_not_installed=0
|
if (( ${#nonexistent_versions[@]} )); then
|
||||||
for version in "${versions[@]}"; do
|
for version in "${nonexistent_versions[@]}"; do
|
||||||
if [ "$version" = "system" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if ! [ -d "${PYENV_ROOT}/versions/${version}" ]; then
|
|
||||||
echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2
|
echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2
|
||||||
any_not_installed=1
|
done
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ "$any_not_installed" = 1 ]; then
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ unset VERSION_NAME
|
|||||||
# version is specified by pyenv. Show usage instructions if a local
|
# version is specified by pyenv. Show usage instructions if a local
|
||||||
# version is not specified.
|
# version is not specified.
|
||||||
DEFINITIONS=("${ARGUMENTS[@]}")
|
DEFINITIONS=("${ARGUMENTS[@]}")
|
||||||
[ -n "${DEFINITIONS[*]}" ] || DEFINITIONS=($(pyenv-local 2>/dev/null || true))
|
[[ "${#DEFINITIONS[*]}" -eq 0 ]] && DEFINITIONS=($(pyenv-local 2>/dev/null || true))
|
||||||
[ -n "${DEFINITIONS[*]}" ] || usage 1 >&2
|
[[ "${#DEFINITIONS[*]}" -eq 0 ]] && usage 1 >&2
|
||||||
|
|
||||||
# Define `before_install` and `after_install` functions that allow
|
# Define `before_install` and `after_install` functions that allow
|
||||||
# plugin hooks to register a string of code for execution before or
|
# plugin hooks to register a string of code for execution before or
|
||||||
@@ -151,7 +151,10 @@ IFS=$'\n' scripts=(`pyenv-hooks install`)
|
|||||||
IFS="$OLDIFS"
|
IFS="$OLDIFS"
|
||||||
for script in "${scripts[@]}"; do source "$script"; done
|
for script in "${scripts[@]}"; do source "$script"; done
|
||||||
|
|
||||||
for DEFINITION in "${DEFINITIONS[@]}";do
|
COMBINED_STATUS=0
|
||||||
|
for DEFINITION in "${DEFINITIONS[@]}"; do
|
||||||
|
STATUS=0
|
||||||
|
|
||||||
# Try to resolve a prefix if user indeed gave a prefix.
|
# Try to resolve a prefix if user indeed gave a prefix.
|
||||||
# We install the version under the resolved name
|
# We install the version under the resolved name
|
||||||
# and hooks also see the resolved name
|
# and hooks also see the resolved name
|
||||||
@@ -173,7 +176,7 @@ for DEFINITION in "${DEFINITIONS[@]}";do
|
|||||||
|
|
||||||
case "$REPLY" in
|
case "$REPLY" in
|
||||||
y | Y | yes | YES ) ;;
|
y | Y | yes | YES ) ;;
|
||||||
* ) exit 1 ;;
|
* ) { STATUS=1; [[ $STATUS -gt $COMBINED_STATUS ]] && COMBINED_STATUS=$STATUS; }; continue ;;
|
||||||
esac
|
esac
|
||||||
elif [ -n "$SKIP_EXISTING" ]; then
|
elif [ -n "$SKIP_EXISTING" ]; then
|
||||||
# Since we know the python version is already installed, and are opting to
|
# Since we know the python version is already installed, and are opting to
|
||||||
@@ -247,8 +250,8 @@ for DEFINITION in "${DEFINITIONS[@]}";do
|
|||||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||||
|
|
||||||
# Invoke `python-build` and record the exit status in $STATUS.
|
# Invoke `python-build` and record the exit status in $STATUS.
|
||||||
STATUS=0
|
python-build $KEEP $VERBOSE $HAS_PATCH $DEBUG "$DEFINITION" "$PREFIX" || \
|
||||||
python-build $KEEP $VERBOSE $HAS_PATCH $DEBUG "$DEFINITION" "$PREFIX" || STATUS="$?"
|
{ STATUS=$?; [[ $STATUS -gt $COMBINED_STATUS ]] && COMBINED_STATUS=$STATUS; }
|
||||||
|
|
||||||
# Display a more helpful message if the definition wasn't found.
|
# Display a more helpful message if the definition wasn't found.
|
||||||
if [ "$STATUS" == "2" ]; then
|
if [ "$STATUS" == "2" ]; then
|
||||||
@@ -279,13 +282,14 @@ for DEFINITION in "${DEFINITIONS[@]}";do
|
|||||||
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||||
|
|
||||||
# Run `pyenv-rehash` after a successful installation.
|
# Run `pyenv-rehash` after a successful installation.
|
||||||
if [ "$STATUS" == "0" ]; then
|
if [[ $STATUS -eq 0 ]]; then
|
||||||
pyenv-rehash
|
pyenv-rehash
|
||||||
else
|
else
|
||||||
break
|
|
||||||
cleanup
|
cleanup
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
exit "${STATUS:-0}"
|
|
||||||
|
exit "${COMBINED_STATUS}"
|
||||||
|
|||||||
@@ -1199,7 +1199,7 @@ require_gcc() {
|
|||||||
|
|
||||||
export CC="$gcc"
|
export CC="$gcc"
|
||||||
if is_mac -ge 1010; then
|
if is_mac -ge 1010; then
|
||||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-10.9}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1742,9 +1742,9 @@ apply_patch() {
|
|||||||
|
|
||||||
|
|
||||||
build_package_symlink_version_suffix() {
|
build_package_symlink_version_suffix() {
|
||||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
if [[ "${PYTHON_CONFIGURE_OPTS_ARRAY[*]} $CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||||
if [ -e "${PREFIX_PATH}/bin" ]; then
|
if [ -e "${PREFIX_PATH}/bin" ]; then
|
||||||
# Always create `bin` as symlink to framework path if the version was built with `--enable-frameowrk` (#590)
|
# Always create `bin` as symlink to framework path if the version was built with `--enable-framework` (#590)
|
||||||
rm -rf "${PREFIX_PATH}/bin.orig"
|
rm -rf "${PREFIX_PATH}/bin.orig"
|
||||||
mv -f "${PREFIX_PATH}/bin" "${PREFIX_PATH}/bin.orig"
|
mv -f "${PREFIX_PATH}/bin" "${PREFIX_PATH}/bin.orig"
|
||||||
fi
|
fi
|
||||||
@@ -2208,8 +2208,8 @@ package_option python configure --libdir="${PREFIX_PATH}/lib"
|
|||||||
# python-build: Set `RPATH` if `--enable-shared` was given (#65, #66, #82)
|
# python-build: Set `RPATH` if `--enable-shared` was given (#65, #66, #82)
|
||||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS ${PYTHON_CONFIGURE_OPTS_ARRAY[@]}" == *"--enable-shared"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS ${PYTHON_CONFIGURE_OPTS_ARRAY[@]}" == *"--enable-shared"* ]]; then
|
||||||
# The ld on Darwin embeds the full paths to each dylib by default
|
# The ld on Darwin embeds the full paths to each dylib by default
|
||||||
if [[ "$LDFLAGS" != *"-rpath="* ]] && ! is_mac; then
|
if [[ "$LDFLAGS" != *"-rpath="* ]] ; then
|
||||||
export LDFLAGS="-Wl,-rpath=${PREFIX_PATH}/lib${LDFLAGS:+ $LDFLAGS}"
|
export LDFLAGS="-Wl,-rpath,${PREFIX_PATH}/lib${LDFLAGS:+ $LDFLAGS}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -2219,6 +2219,7 @@ if [[ "$PYPY_OPTS" == *"--shared"* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Add support for framework installation (`--enable-framework`) of CPython (#55, #99)
|
# Add support for framework installation (`--enable-framework`) of CPython (#55, #99)
|
||||||
|
shopt -s extglob
|
||||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||||
if ! is_mac; then
|
if ! is_mac; then
|
||||||
echo "python-build: framework installation is not supported outside of MacOS." >&2
|
echo "python-build: framework installation is not supported outside of MacOS." >&2
|
||||||
@@ -2237,15 +2238,29 @@ if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; the
|
|||||||
create_framework_dirs "${DEFINITION_PATH##*/}"
|
create_framework_dirs "${DEFINITION_PATH##*/}"
|
||||||
# the `/Library/Frameworks` suffix makes CPython build install apps under prefix rather than into /Applications (#1003)
|
# the `/Library/Frameworks` suffix makes CPython build install apps under prefix rather than into /Applications (#1003)
|
||||||
package_option python configure --enable-framework="${PREFIX_PATH}/Library/Frameworks"
|
package_option python configure --enable-framework="${PREFIX_PATH}/Library/Frameworks"
|
||||||
|
|
||||||
|
#FIXME: doesn't properly handle paths with spaces. Fix by parsing *OPTS into arrays.
|
||||||
|
CONFIGURE_OPTS="${CONFIGURE_OPTS//--enable-framework?(=*([^ ]))?( )/}";
|
||||||
|
CONFIGURE_OPTS="${CONFIGURE_OPTS% }"
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//--enable-framework?(=*([^ ]))?( )/}";
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS% }"
|
||||||
fi
|
fi
|
||||||
|
shopt -u extglob
|
||||||
|
|
||||||
# Build against universal SDK
|
# Build against universal SDK
|
||||||
|
shopt -s extglob
|
||||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
||||||
if ! is_mac; then
|
if ! is_mac; then
|
||||||
echo "python-build: universal installation is not supported outside of MacOS." >&2
|
echo "python-build: universal installation is not supported outside of MacOS." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
package_option python configure --enable-universalsdk=/
|
package_option python configure --enable-universalsdk=/
|
||||||
|
#FIXME: doesn't properly handle paths with spaces. Fix by parsing *OPTS into arrays.
|
||||||
|
CONFIGURE_OPTS="${CONFIGURE_OPTS//--enable-universalsdk?(=*([^ ]))?( )/}"
|
||||||
|
CONFIGURE_OPTS="${CONFIGURE_OPTS% }"
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//--enable-universalsdk?(=*([^ ]))?( )/}"
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS% }"
|
||||||
|
|
||||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--with-universal-archs"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--with-universal-archs"* ]]; then
|
||||||
# in CPython's configure.ac, --with-universal-archs defaults to 'intel' which means i386 + x86_64
|
# in CPython's configure.ac, --with-universal-archs defaults to 'intel' which means i386 + x86_64
|
||||||
# since 2.7.5 and 3.3.0 -- i.e. in all non-EOL versions
|
# since 2.7.5 and 3.3.0 -- i.e. in all non-EOL versions
|
||||||
@@ -2255,6 +2270,7 @@ if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]];
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
shopt -u extglob
|
||||||
|
|
||||||
# Compile with `--enable-unicode=ucs4` by default (#257)
|
# Compile with `--enable-unicode=ucs4` by default (#257)
|
||||||
if [[ "$PYTHON_CONFIGURE_OPTS" != *"--enable-unicode="* ]]; then
|
if [[ "$PYTHON_CONFIGURE_OPTS" != *"--enable-unicode="* ]]; then
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ class CondaVersion(NamedTuple):
|
|||||||
return PyVersion.PY37
|
return PyVersion.PY37
|
||||||
return PyVersion.PY36
|
return PyVersion.PY36
|
||||||
|
|
||||||
raise ValueError(flavor)
|
raise ValueError(self.flavor)
|
||||||
|
|
||||||
|
|
||||||
class CondaSpec(NamedTuple):
|
class CondaSpec(NamedTuple):
|
||||||
|
|||||||
9
plugins/python-build/share/python-build/3.10.10
Normal file
9
plugins/python-build/share/python-build/3.10.10
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1o" "https://www.openssl.org/source/openssl-1.1.1o.tar.gz#9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f" 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.10" "https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tar.xz#0419e9085bf51b7a672009b3f50dbf1859acdf18ba725d0ec19aa5c8503f0ea3" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.10.10" "https://www.python.org/ftp/python/3.10.10/Python-3.10.10.tgz#fba64559dde21ebdc953e4565e731573bb61159de8e4d4cedee70fb1196f610d" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.11.2
Normal file
10
plugins/python-build/share/python-build/3.11.2
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||||
|
install_package "openssl-1.1.1s" "https://www.openssl.org/source/openssl-1.1.1s.tar.gz#c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" 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.2" "https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tar.xz#29e4b8f5f1658542a8c13e2dd277358c9c48f2b2f7318652ef1675e402b9d2af" standard verify_py311 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.11.2" "https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tgz#2411c74bda5bbcfcddaf4531f66d1adc73f247f529aee981b029513aefdbf849" standard verify_py311 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
@@ -3,7 +3,7 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
|||||||
install_package "openssl-1.1.1s" "https://www.openssl.org/source/openssl-1.1.1s.tar.gz#c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" mac_openssl --if has_broken_mac_openssl
|
install_package "openssl-1.1.1s" "https://www.openssl.org/source/openssl-1.1.1s.tar.gz#c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" 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_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
|
if has_tar_xz_support; then
|
||||||
install_package "Python-3.12.0a4" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a4.tar.xz#b9176c46b1cd21dbdcb31bbbab6169faa92da9acc5f35bd4a009879ac74cf6af" standard verify_py312 copy_python_gdb ensurepip
|
install_package "Python-3.12.0a5" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a5.tar.xz#d66ef7a342fe3a356f9cee3bb97adc1e5fb4840f6b6cff7de0ff7dd495f8323b" standard verify_py312 copy_python_gdb ensurepip
|
||||||
else
|
else
|
||||||
install_package "Python-3.12.0a4" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a4.tgz#d9d9cbebc745ecaf5cae6b4004a84692154183b729954d3a421fba3d2a541d59" standard verify_py312 copy_python_gdb ensurepip
|
install_package "Python-3.12.0a5" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a5.tgz#53bea5094887bba2fc4f429fa8abb4976b5c7cfe70d41923cf6aff0b4854c666" standard verify_py312 copy_python_gdb ensurepip
|
||||||
fi
|
fi
|
||||||
5
plugins/python-build/share/python-build/nogil-3.9.10-1
Normal file
5
plugins/python-build/share/python-build/nogil-3.9.10-1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" 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
|
||||||
|
install_package "nogil-3.9.10-1" "https://github.com/colesbury/nogil/archive/refs/tags/v3.9.10-nogil-2023-01-22.tar.gz#cbda308c7586745573d665cd53d71b50707fd6f85c1c5d7a9f5b092e869cc757" standard verify_py39 copy_python_gdb ensurepip
|
||||||
@@ -62,7 +62,7 @@ assert_build_log() {
|
|||||||
cached_tarball "yaml-0.1.6"
|
cached_tarball "yaml-0.1.6"
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew false
|
stub brew false
|
||||||
stub_make_install
|
stub_make_install
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -74,11 +74,11 @@ assert_build_log() {
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -89,7 +89,7 @@ OUT
|
|||||||
cached_tarball "yaml-0.1.6"
|
cached_tarball "yaml-0.1.6"
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew false
|
stub brew false
|
||||||
stub_make_install
|
stub_make_install
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -103,12 +103,12 @@ OUT
|
|||||||
unstub patch
|
unstub patch
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
patch -p0 --force -i $TMP/python-patch.XXX
|
patch -p0 --force -i $TMP/python-patch.XXX
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -119,7 +119,7 @@ OUT
|
|||||||
cached_tarball "yaml-0.1.6"
|
cached_tarball "yaml-0.1.6"
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew false
|
stub brew false
|
||||||
stub_make_install
|
stub_make_install
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -133,12 +133,12 @@ OUT
|
|||||||
unstub patch
|
unstub patch
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
patch -p1 --force -i $TMP/python-patch.XXX
|
patch -p1 --force -i $TMP/python-patch.XXX
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -151,7 +151,7 @@ OUT
|
|||||||
BREW_PREFIX="$TMP/homebrew-prefix"
|
BREW_PREFIX="$TMP/homebrew-prefix"
|
||||||
mkdir -p "$BREW_PREFIX"
|
mkdir -p "$BREW_PREFIX"
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
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..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
stub brew "--prefix : echo '$BREW_PREFIX'" false
|
stub brew "--prefix : echo '$BREW_PREFIX'" false
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -166,7 +166,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -179,7 +179,7 @@ OUT
|
|||||||
brew_libdir="$TMP/homebrew-yaml"
|
brew_libdir="$TMP/homebrew-yaml"
|
||||||
mkdir -p "$brew_libdir"
|
mkdir -p "$brew_libdir"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
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..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
stub brew "--prefix libyaml : echo '$brew_libdir'"
|
stub brew "--prefix libyaml : echo '$brew_libdir'"
|
||||||
for i in {1..4}; do stub brew false; done
|
for i in {1..4}; do stub brew false; done
|
||||||
@@ -194,7 +194,7 @@ OUT
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include" LDFLAGS="-L$brew_libdir/lib -L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include" LDFLAGS="-L$brew_libdir/lib -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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -205,7 +205,7 @@ OUT
|
|||||||
cached_tarball "yaml-0.1.6"
|
cached_tarball "yaml-0.1.6"
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew true; brew
|
stub brew true; brew
|
||||||
stub_make_install
|
stub_make_install
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -218,11 +218,11 @@ OUT
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
yaml-0.1.6: --prefix=${TMP}/install
|
yaml-0.1.6: --prefix=${TMP}/install
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -234,7 +234,7 @@ OUT
|
|||||||
|
|
||||||
readline_libdir="$TMP/homebrew-readline"
|
readline_libdir="$TMP/homebrew-readline"
|
||||||
mkdir -p "$readline_libdir"
|
mkdir -p "$readline_libdir"
|
||||||
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
for i in {1..7}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
for i in {1..2}; do stub brew false; done
|
for i in {1..2}; do stub brew false; done
|
||||||
stub brew "--prefix readline : echo '$readline_libdir'"
|
stub brew "--prefix readline : echo '$readline_libdir'"
|
||||||
@@ -252,7 +252,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include" LDFLAGS="-L$readline_libdir/lib -L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include" LDFLAGS="-L$readline_libdir/lib -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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -264,7 +264,7 @@ OUT
|
|||||||
|
|
||||||
for lib in readline sqlite3; do
|
for lib in readline sqlite3; do
|
||||||
|
|
||||||
for i in {1..8}; do stub uname '-s : echo FreeBSD'; done
|
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
|
||||||
stub uname '-r : echo 11.0-RELEASE'
|
stub uname '-r : echo 11.0-RELEASE'
|
||||||
for i in {1..2}; do stub uname '-s : echo FreeBSD'; done
|
for i in {1..2}; do stub uname '-s : echo FreeBSD'; done
|
||||||
stub sysctl '-n hw.ncpu : echo 1'
|
stub sysctl '-n hw.ncpu : echo 1'
|
||||||
@@ -286,7 +286,7 @@ DEF
|
|||||||
unstub sysctl
|
unstub sysctl
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I/usr/local/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I/usr/local/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 1
|
make -j 1
|
||||||
make install
|
make install
|
||||||
@@ -298,7 +298,7 @@ OUT
|
|||||||
@test "no library searches performed during normal operation touch homebrew in non-MacOS" {
|
@test "no library searches performed during normal operation touch homebrew in non-MacOS" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew true; brew
|
stub brew true; brew
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -322,7 +322,7 @@ OUT
|
|||||||
@test "no library searches performed during normal operation touch homebrew if envvar is set" {
|
@test "no library searches performed during normal operation touch homebrew if envvar is set" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..5}; do stub uname '-s : echo Darwin'; done
|
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
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
stub brew true; brew
|
stub brew true; brew
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -338,7 +338,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -353,7 +353,7 @@ OUT
|
|||||||
mkdir -p "$readline_libdir/include/readline"
|
mkdir -p "$readline_libdir/include/readline"
|
||||||
touch "$readline_libdir/include/readline/rlconf.h"
|
touch "$readline_libdir/include/readline/rlconf.h"
|
||||||
|
|
||||||
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
for i in {1..7}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
|
|
||||||
for i in {1..3}; do stub brew false; done
|
for i in {1..3}; do stub brew false; done
|
||||||
@@ -371,7 +371,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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 CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -385,7 +385,7 @@ OUT
|
|||||||
mkdir -p "$tcl_tk_libdir/lib"
|
mkdir -p "$tcl_tk_libdir/lib"
|
||||||
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
|
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
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..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
|
|
||||||
stub brew false
|
stub brew false
|
||||||
@@ -405,7 +405,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
||||||
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib --with-tcltk-libs=-L${TMP}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version --with-tcltk-includes=-I${TMP}/homebrew-tcl-tk/include
|
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib --with-tcltk-libs=-L${TMP}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version --with-tcltk-includes=-I${TMP}/homebrew-tcl-tk/include
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -419,7 +419,7 @@ OUT
|
|||||||
tcl_tk_version_long="8.6.10"
|
tcl_tk_version_long="8.6.10"
|
||||||
tcl_tk_version="${tcl_tk_version_long%.*}"
|
tcl_tk_version="${tcl_tk_version_long%.*}"
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
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..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
|
|
||||||
for i in {1..4}; do stub brew false; done
|
for i in {1..4}; do stub brew false; done
|
||||||
@@ -437,7 +437,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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 --with-tcltk-libs=-L${TMP}/custom-tcl-tk/lib -ltcl8.6 -ltk8.6
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --with-tcltk-libs=-L${TMP}/custom-tcl-tk/lib -ltcl8.6 -ltk8.6
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -447,7 +447,7 @@ OUT
|
|||||||
@test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" {
|
@test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
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..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
|
|
||||||
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
||||||
@@ -471,7 +471,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
||||||
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib
|
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -480,7 +480,7 @@ OUT
|
|||||||
@test "number of CPU cores defaults to 2" {
|
@test "number of CPU cores defaults to 2" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
||||||
|
|
||||||
stub sysctl false
|
stub sysctl false
|
||||||
@@ -497,7 +497,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -507,7 +507,7 @@ OUT
|
|||||||
@test "number of CPU cores is detected on Mac" {
|
@test "number of CPU cores is detected on Mac" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
||||||
|
|
||||||
stub sysctl '-n hw.ncpu : echo 4'
|
stub sysctl '-n hw.ncpu : echo 4'
|
||||||
@@ -525,7 +525,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 4
|
make -j 4
|
||||||
make install
|
make install
|
||||||
@@ -535,7 +535,7 @@ OUT
|
|||||||
@test "number of CPU cores is detected on FreeBSD" {
|
@test "number of CPU cores is detected on FreeBSD" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..8}; do stub uname '-s : echo FreeBSD'; done
|
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
|
||||||
stub uname '-r : echo 11.0-RELEASE'
|
stub uname '-r : echo 11.0-RELEASE'
|
||||||
for i in {1..2}; do stub uname '-s : echo FreeBSD'; done
|
for i in {1..2}; do stub uname '-s : echo FreeBSD'; done
|
||||||
for i in {1..2}; do stub pkg false; done
|
for i in {1..2}; do stub pkg false; done
|
||||||
@@ -554,7 +554,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 1
|
make -j 1
|
||||||
make install
|
make install
|
||||||
@@ -564,7 +564,7 @@ OUT
|
|||||||
@test "setting PYTHON_MAKE_INSTALL_OPTS to a multi-word string" {
|
@test "setting PYTHON_MAKE_INSTALL_OPTS to a multi-word string" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||||
|
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
@@ -578,7 +578,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install DOGE="such wow"
|
make install DOGE="such wow"
|
||||||
@@ -588,7 +588,7 @@ OUT
|
|||||||
@test "(PYTHON_)CONFIGURE_OPTS and (PYTHON_)MAKE_OPTS take priority over automatically added options" {
|
@test "(PYTHON_)CONFIGURE_OPTS and (PYTHON_)MAKE_OPTS take priority over automatically added options" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||||
|
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
@@ -606,7 +606,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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 --custom-configure --custom-python-configure
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --custom-configure --custom-python-configure
|
||||||
make -j 2 --custom-make --custom-python-make
|
make -j 2 --custom-make --custom-python-make
|
||||||
make install --custom-make-install
|
make install --custom-make-install
|
||||||
@@ -640,7 +640,7 @@ OUT
|
|||||||
@test "configuring with dSYM in MacOS" {
|
@test "configuring with dSYM in MacOS" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
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..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
for i in {1..4}; do stub brew false; done
|
for i in {1..4}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -657,7 +657,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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=${TMP}/install/lib --with-dsymutil
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib --with-dsymutil
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -667,7 +667,7 @@ OUT
|
|||||||
@test "configuring with dSYM has no effect in non-MacOS" {
|
@test "configuring with dSYM has no effect in non-MacOS" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
@@ -680,7 +680,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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=${TMP}/install/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -700,7 +700,7 @@ OUT
|
|||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
stub uname "-s : echo FreeBSD" "-r : echo 9.1"
|
stub uname "-s : echo FreeBSD" "-r : echo 9.1"
|
||||||
for i in {1..7}; do stub uname "-s : echo FreeBSD"; done
|
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
||||||
stub uname "-r : echo 9.1"
|
stub uname "-r : echo 9.1"
|
||||||
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
||||||
|
|
||||||
@@ -717,7 +717,7 @@ OUT
|
|||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE"
|
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE"
|
||||||
for i in {1..7}; do stub uname "-s : echo FreeBSD"; done
|
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
||||||
stub uname "-r : echo 10.0-RELEASE"
|
stub uname "-r : echo 10.0-RELEASE"
|
||||||
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
||||||
|
|
||||||
@@ -733,7 +733,7 @@ OUT
|
|||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
stub uname "-s : echo FreeBSD" "-r : echo 11.0-RELEASE"
|
stub uname "-s : echo FreeBSD" "-r : echo 11.0-RELEASE"
|
||||||
for i in {1..7}; do stub uname "-s : echo FreeBSD"; done
|
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
||||||
stub uname "-r : echo 11.0-RELEASE"
|
stub uname "-r : echo 11.0-RELEASE"
|
||||||
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
||||||
|
|
||||||
@@ -754,7 +754,7 @@ apply -p1 -i /my/patch.diff
|
|||||||
exec ./configure "\$@"
|
exec ./configure "\$@"
|
||||||
CONF
|
CONF
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||||
stub apply 'echo apply "$@" >> build.log'
|
stub apply 'echo apply "$@" >> build.log'
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
@@ -770,7 +770,7 @@ DEF
|
|||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
apply -p1 -i /my/patch.diff
|
apply -p1 -i /my/patch.diff
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: 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
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
|
|||||||
@@ -8,13 +8,11 @@ export -n CC
|
|||||||
export -n PYTHON_CONFIGURE_OPTS
|
export -n PYTHON_CONFIGURE_OPTS
|
||||||
|
|
||||||
@test "require_gcc on OS X 10.9" {
|
@test "require_gcc on OS X 10.9" {
|
||||||
# pyenv/pyenv#1026
|
|
||||||
stub uname false '-s : echo Darwin'
|
|
||||||
stub sw_vers '-productVersion : echo 10.9.5'
|
|
||||||
|
|
||||||
stub uname '-s : echo Darwin'
|
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||||
stub sw_vers '-productVersion : echo 10.9.5'
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.9.5'; done
|
||||||
stub gcc '--version : echo 4.2.1' '--version : echo 4.2.1'
|
|
||||||
|
stub gcc '--version : echo 4.2.1'
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
require_gcc
|
require_gcc
|
||||||
@@ -26,22 +24,28 @@ DEF
|
|||||||
CC=${TMP}/bin/gcc
|
CC=${TMP}/bin/gcc
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.9
|
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
|
unstub uname
|
||||||
|
unstub sw_vers
|
||||||
|
unstub gcc
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "require_gcc on OS X 10.10" {
|
@test "require_gcc on OS X 10.10" {
|
||||||
# pyenv/pyenv#1026
|
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||||
stub uname false '-s : echo Darwin'
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
||||||
stub sw_vers '-productVersion : echo 10.10'
|
|
||||||
|
|
||||||
stub uname '-s : echo Darwin'
|
stub gcc '--version : echo 4.2.1'
|
||||||
stub sw_vers '-productVersion : echo 10.10'
|
|
||||||
stub gcc '--version : echo 4.2.1' '--version : echo 4.2.1'
|
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
require_gcc
|
require_gcc
|
||||||
echo CC=\$CC
|
echo CC=\$CC
|
||||||
echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
|
echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
|
||||||
DEF
|
DEF
|
||||||
|
|
||||||
|
unstub uname
|
||||||
|
unstub sw_vers
|
||||||
|
unstub gcc
|
||||||
|
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
CC=${TMP}/bin/gcc
|
CC=${TMP}/bin/gcc
|
||||||
@@ -50,20 +54,22 @@ OUT
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "require_gcc silences warnings" {
|
@test "require_gcc silences warnings" {
|
||||||
stub gcc '--version : echo warning >&2; echo 4.2.1' '--version : echo warning >&2; echo 4.2.1'
|
stub gcc '--version : echo warning >&2; echo 4.2.1'
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
require_gcc
|
require_gcc
|
||||||
echo \$CC
|
echo \$CC
|
||||||
DEF
|
DEF
|
||||||
assert_success "${TMP}/bin/gcc"
|
assert_success "${TMP}/bin/gcc"
|
||||||
|
|
||||||
|
unstub gcc
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "CC=clang by default on OS X 10.10" {
|
@test "CC=clang by default on OS X 10.10" {
|
||||||
mkdir -p "$INSTALL_ROOT"
|
mkdir -p "$INSTALL_ROOT"
|
||||||
cd "$INSTALL_ROOT"
|
cd "$INSTALL_ROOT"
|
||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..3}; do stub sw_vers '-productVersion : echo 10.10'; done
|
for i in {1..3}; do stub sw_vers '-productVersion : echo 10.10'; done
|
||||||
|
|
||||||
stub cc 'false'
|
stub cc 'false'
|
||||||
@@ -85,10 +91,6 @@ exec 4<&1
|
|||||||
build_package_standard python
|
build_package_standard python
|
||||||
DEF
|
DEF
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
unstub uname
|
|
||||||
unstub sw_vers
|
|
||||||
|
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
./configure --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib
|
./configure --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib
|
||||||
CC=clang
|
CC=clang
|
||||||
@@ -96,13 +98,16 @@ CFLAGS=no
|
|||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
|
unstub uname
|
||||||
|
unstub sw_vers
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "passthrough CFLAGS_EXTRA to micropython compiler" {
|
@test "passthrough CFLAGS_EXTRA to micropython compiler" {
|
||||||
mkdir -p "$INSTALL_ROOT/mpy-cross"
|
mkdir -p "$INSTALL_ROOT/mpy-cross"
|
||||||
mkdir -p "$INSTALL_ROOT/ports/unix"
|
mkdir -p "$INSTALL_ROOT/ports/unix"
|
||||||
mkdir -p "$INSTALL_ROOT/bin"
|
mkdir -p "$INSTALL_ROOT/bin"
|
||||||
# touch "$INSTALL_ROOT/bin/python"
|
|
||||||
cd "$INSTALL_ROOT"
|
cd "$INSTALL_ROOT"
|
||||||
|
|
||||||
stub make true true '(for a in "$@"; do echo $a; done)|grep -E "^CFLAGS_EXTRA="' true
|
stub make true true '(for a in "$@"; do echo $a; done)|grep -E "^CFLAGS_EXTRA="' true
|
||||||
@@ -113,7 +118,7 @@ exec 4<&1
|
|||||||
CFLAGS_EXTRA='-Wno-floating-conversion' build_package_micropython
|
CFLAGS_EXTRA='-Wno-floating-conversion' build_package_micropython
|
||||||
DEF
|
DEF
|
||||||
|
|
||||||
#assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
CFLAGS_EXTRA=-DMICROPY_PY_SYS_PATH_DEFAULT='".frozen:${TMP}/install/lib/micropython"' -Wno-floating-conversion
|
CFLAGS_EXTRA=-DMICROPY_PY_SYS_PATH_DEFAULT='".frozen:${TMP}/install/lib/micropython"' -Wno-floating-conversion
|
||||||
OUT
|
OUT
|
||||||
|
|||||||
@@ -5,31 +5,36 @@ export PYENV_ROOT="${TMP}/pyenv"
|
|||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
stub pyenv-hooks 'install : true'
|
stub pyenv-hooks 'install : true'
|
||||||
stub pyenv-rehash 'true'
|
stub pyenv-rehash true
|
||||||
|
}
|
||||||
|
|
||||||
|
stub_python_build_lib() {
|
||||||
|
stub python-build "--lib : $BATS_TEST_DIRNAME/../bin/python-build --lib" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
stub_python_build_no_latest() {
|
||||||
|
stub python-build "${@:-echo python-build \"\$@\"}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stub_python_build() {
|
stub_python_build() {
|
||||||
stub python-build "--lib : $BATS_TEST_DIRNAME/../bin/python-build --lib" "$@"
|
stub_python_build_no_latest "$@"
|
||||||
stub pyenv-latest ": false"
|
stub pyenv-latest false
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "install proper" {
|
@test "install a single version" {
|
||||||
stub_python_build 'echo python-build "$@"'
|
stub_python_build_lib
|
||||||
|
stub_python_build
|
||||||
|
|
||||||
run pyenv-install 3.4.2
|
run pyenv-install 3.4.2
|
||||||
assert_success "python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2"
|
assert_success "python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2"
|
||||||
|
|
||||||
unstub python-build
|
unstub python-build
|
||||||
unstub pyenv-hooks
|
|
||||||
unstub pyenv-rehash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "install proper multi versions" {
|
@test "install multiple versions" {
|
||||||
#stub python-build "--lib : $BATS_TEST_DIRNAME/../bin/python-build --lib" 'echo python-build "$@"' 'echo python-build "$@"'
|
stub_python_build_lib
|
||||||
#stub pyenv-latest ": false" ": false"
|
stub_python_build
|
||||||
stub_python_build 'echo python-build "$@"' 'echo python-build "$@"'
|
stub_python_build
|
||||||
stub pyenv-latest ": false"
|
|
||||||
stub pyenv-rehash 'true'
|
|
||||||
|
|
||||||
run pyenv-install 3.4.1 3.4.2
|
run pyenv-install 3.4.1 3.4.2
|
||||||
assert_success
|
assert_success
|
||||||
@@ -40,61 +45,72 @@ OUT
|
|||||||
|
|
||||||
unstub python-build
|
unstub python-build
|
||||||
unstub pyenv-latest
|
unstub pyenv-latest
|
||||||
unstub pyenv-hooks
|
|
||||||
unstub pyenv-rehash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "install resolves a prefix" {
|
@test "install multiple versions, some fail" {
|
||||||
stub_python_build 'echo python-build "$@"'
|
stub_python_build_lib
|
||||||
stub pyenv-latest '-q -k 3.4 : echo 3.4.2'
|
stub_python_build 'echo "fail: python-build" "$@"; false'
|
||||||
pyenv-latest || true # pass through the stub entry added by stub_python_build
|
|
||||||
|
|
||||||
run pyenv-install 3.4
|
run pyenv-install 3.4.1 3.4.2
|
||||||
assert_success "python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2"
|
assert_failure
|
||||||
|
assert_output <<OUT
|
||||||
|
fail: python-build 3.4.1 ${TMP}/pyenv/versions/3.4.1
|
||||||
|
OUT
|
||||||
|
|
||||||
unstub python-build
|
unstub python-build
|
||||||
unstub pyenv-hooks
|
|
||||||
unstub pyenv-rehash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "install resolves a prefix with multi versions" {
|
|
||||||
stub_python_build 'echo python-build "$@"' 'echo python-build "$@"'
|
|
||||||
stub pyenv-latest '-q -k 3.4 : echo 3.4.2' '-q -k 3.5 : echo 3.5.2'
|
|
||||||
stub pyenv-rehash 'true'
|
|
||||||
pyenv-latest || true # pass through the stub entry added by stub_python_build
|
|
||||||
|
|
||||||
run pyenv-install 3.4 3.5
|
@test "install resolves a prefix" {
|
||||||
|
stub_python_build_lib
|
||||||
|
for i in {1..3}; do stub_python_build_no_latest; done
|
||||||
|
stub pyenv-latest \
|
||||||
|
'-q -k 3.4 : echo 3.4.2' \
|
||||||
|
'-q -k 3.5.1 : false' \
|
||||||
|
'-q -k 3.5 : echo 3.5.2'
|
||||||
|
|
||||||
|
run pyenv-install 3.4 3.5.1 3.5
|
||||||
assert_success <<OUT
|
assert_success <<OUT
|
||||||
python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2
|
python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2
|
||||||
|
python-build 3.5.1 ${PYENV_ROOT}/versions/3.5.1
|
||||||
python-build 3.5.2 ${PYENV_ROOT}/versions/3.5.2
|
python-build 3.5.2 ${PYENV_ROOT}/versions/3.5.2
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
|
|
||||||
unstub python-build
|
unstub python-build
|
||||||
unstub pyenv-hooks
|
|
||||||
unstub pyenv-rehash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "install pyenv local version by default" {
|
|
||||||
stub_python_build 'echo python-build "$1"'
|
|
||||||
stub pyenv-local 'echo 3.4.2'
|
|
||||||
|
|
||||||
run pyenv-install
|
@test "install resolves :latest" {
|
||||||
assert_success "python-build 3.4.2"
|
stub_python_build_lib
|
||||||
|
for i in {1..2}; do stub_python_build '--definitions : echo -e 3.4.2\\n3.5.1\\n3.5.2'; done
|
||||||
|
for i in {1..2}; do stub_python_build; done
|
||||||
|
|
||||||
|
pyenv-hooks install; unstub pyenv-hooks
|
||||||
|
PYENV_INSTALL_ROOT="$BATS_TEST_DIRNAME/../../.."
|
||||||
|
export PYENV_HOOK_PATH="$PYENV_INSTALL_ROOT/pyenv.d"
|
||||||
|
[[ -d "$PYENV_INSTALL_ROOT/libexec" ]] || skip "python-build is installed separately from pyenv"
|
||||||
|
export PATH="$PATH:$PYENV_INSTALL_ROOT/libexec"
|
||||||
|
|
||||||
|
run pyenv-install 3.4:latest 3:latest
|
||||||
|
assert_success <<!
|
||||||
|
python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2
|
||||||
|
python-build 3.5.2 ${PYENV_ROOT}/versions/3.5.2
|
||||||
|
!
|
||||||
|
|
||||||
unstub python-build
|
unstub python-build
|
||||||
unstub pyenv-local
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "install pyenv local multi versions by default" {
|
@test "install installs local versions by default" {
|
||||||
stub_python_build 'echo python-build "$1"' 'echo python-build "$1"'
|
stub_python_build_lib
|
||||||
stub pyenv-local 'printf "%s\n%s\n" 3.4.2 3.4.1'
|
stub_python_build
|
||||||
stub pyenv-latest ": false"
|
stub_python_build
|
||||||
|
stub pyenv-local 'echo 3.4.2; echo 3.4.1'
|
||||||
|
|
||||||
run pyenv-install
|
run pyenv-install
|
||||||
assert_success <<OUT
|
assert_success <<OUT
|
||||||
python-build 3.4.2"
|
python-build 3.4.2
|
||||||
python-build 3.4.1"
|
python-build 3.4.1
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
unstub python-build
|
unstub python-build
|
||||||
@@ -102,8 +118,8 @@ OUT
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "list available versions" {
|
@test "list available versions" {
|
||||||
stub_python_build \
|
stub_python_build_lib
|
||||||
"--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
stub_python_build "--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
||||||
|
|
||||||
run pyenv-install --list
|
run pyenv-install --list
|
||||||
assert_success
|
assert_success
|
||||||
@@ -118,10 +134,11 @@ OUT
|
|||||||
unstub python-build
|
unstub python-build
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "nonexistent version" {
|
@test "upgrade instructions given for a nonexistent version" {
|
||||||
stub brew false
|
stub brew false
|
||||||
stub_python_build 'echo ERROR >&2 && exit 2' \
|
stub_python_build_lib
|
||||||
"--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
stub_python_build 'echo ERROR >&2 && exit 2'
|
||||||
|
stub_python_build "--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
||||||
|
|
||||||
run pyenv-install 2.7.9
|
run pyenv-install 2.7.9
|
||||||
assert_failure
|
assert_failure
|
||||||
@@ -142,8 +159,9 @@ OUT
|
|||||||
unstub python-build
|
unstub python-build
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Homebrew upgrade instructions" {
|
@test "homebrew upgrade instructions given when pyenv is homebrew-installed" {
|
||||||
stub brew "--prefix : echo '${BATS_TEST_DIRNAME%/*}'"
|
stub brew "--prefix : echo '${BATS_TEST_DIRNAME%/*}'"
|
||||||
|
stub_python_build_lib
|
||||||
stub_python_build 'echo ERROR >&2 && exit 2' \
|
stub_python_build 'echo ERROR >&2 && exit 2' \
|
||||||
"--definitions : true"
|
"--definitions : true"
|
||||||
|
|
||||||
@@ -165,15 +183,19 @@ OUT
|
|||||||
|
|
||||||
@test "no build definitions from plugins" {
|
@test "no build definitions from plugins" {
|
||||||
assert [ ! -e "${PYENV_ROOT}/plugins" ]
|
assert [ ! -e "${PYENV_ROOT}/plugins" ]
|
||||||
|
stub_python_build_lib
|
||||||
stub_python_build 'echo $PYTHON_BUILD_DEFINITIONS'
|
stub_python_build 'echo $PYTHON_BUILD_DEFINITIONS'
|
||||||
|
|
||||||
run pyenv-install 3.4.2
|
run pyenv-install 3.4.2
|
||||||
assert_success ""
|
assert_success ""
|
||||||
|
|
||||||
|
unstub python-build
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "some build definitions from plugins" {
|
@test "some build definitions from plugins" {
|
||||||
mkdir -p "${PYENV_ROOT}/plugins/foo/share/python-build"
|
mkdir -p "${PYENV_ROOT}/plugins/foo/share/python-build"
|
||||||
mkdir -p "${PYENV_ROOT}/plugins/bar/share/python-build"
|
mkdir -p "${PYENV_ROOT}/plugins/bar/share/python-build"
|
||||||
|
stub_python_build_lib
|
||||||
stub_python_build "echo \$PYTHON_BUILD_DEFINITIONS | tr ':' $'\\n'"
|
stub_python_build "echo \$PYTHON_BUILD_DEFINITIONS | tr ':' $'\\n'"
|
||||||
|
|
||||||
run pyenv-install 3.4.2
|
run pyenv-install 3.4.2
|
||||||
@@ -183,11 +205,14 @@ OUT
|
|||||||
${PYENV_ROOT}/plugins/bar/share/python-build
|
${PYENV_ROOT}/plugins/bar/share/python-build
|
||||||
${PYENV_ROOT}/plugins/foo/share/python-build
|
${PYENV_ROOT}/plugins/foo/share/python-build
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
|
unstub python-build
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "list build definitions from plugins" {
|
@test "list build definitions from plugins" {
|
||||||
mkdir -p "${PYENV_ROOT}/plugins/foo/share/python-build"
|
mkdir -p "${PYENV_ROOT}/plugins/foo/share/python-build"
|
||||||
mkdir -p "${PYENV_ROOT}/plugins/bar/share/python-build"
|
mkdir -p "${PYENV_ROOT}/plugins/bar/share/python-build"
|
||||||
|
stub_python_build_lib
|
||||||
stub_python_build "--definitions : echo \$PYTHON_BUILD_DEFINITIONS | tr ':' $'\\n'"
|
stub_python_build "--definitions : echo \$PYTHON_BUILD_DEFINITIONS | tr ':' $'\\n'"
|
||||||
|
|
||||||
run pyenv-install --list
|
run pyenv-install --list
|
||||||
@@ -198,12 +223,14 @@ Available versions:
|
|||||||
${PYENV_ROOT}/plugins/bar/share/python-build
|
${PYENV_ROOT}/plugins/bar/share/python-build
|
||||||
${PYENV_ROOT}/plugins/foo/share/python-build
|
${PYENV_ROOT}/plugins/foo/share/python-build
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
|
unstub python-build
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "completion results include build definitions from plugins" {
|
@test "completion results include build definitions from plugins" {
|
||||||
mkdir -p "${PYENV_ROOT}/plugins/foo/share/python-build"
|
mkdir -p "${PYENV_ROOT}/plugins/foo/share/python-build"
|
||||||
mkdir -p "${PYENV_ROOT}/plugins/bar/share/python-build"
|
mkdir -p "${PYENV_ROOT}/plugins/bar/share/python-build"
|
||||||
stub python-build "--definitions : echo \$PYTHON_BUILD_DEFINITIONS | tr ':' $'\\n'"
|
stub_python_build "--definitions : echo \$PYTHON_BUILD_DEFINITIONS | tr ':' $'\\n'"
|
||||||
|
|
||||||
run pyenv-install --complete
|
run pyenv-install --complete
|
||||||
assert_success
|
assert_success
|
||||||
@@ -220,10 +247,12 @@ OUT
|
|||||||
${PYENV_ROOT}/plugins/bar/share/python-build
|
${PYENV_ROOT}/plugins/bar/share/python-build
|
||||||
${PYENV_ROOT}/plugins/foo/share/python-build
|
${PYENV_ROOT}/plugins/foo/share/python-build
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
|
unstub python-build
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "not enough arguments for pyenv-install if no local version" {
|
@test "not enough arguments for pyenv-install if no local version" {
|
||||||
stub_python_build
|
stub_python_build_lib
|
||||||
stub pyenv-help 'install : true'
|
stub pyenv-help 'install : true'
|
||||||
|
|
||||||
run pyenv-install
|
run pyenv-install
|
||||||
@@ -232,17 +261,7 @@ OUT
|
|||||||
assert_output ""
|
assert_output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "multi arguments for pyenv-install" {
|
|
||||||
stub_python_build
|
|
||||||
stub pyenv-help 'install : true'
|
|
||||||
|
|
||||||
run pyenv-install 3.4.1 3.4.2
|
|
||||||
assert_success
|
|
||||||
assert_output ""
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "show help for pyenv-install" {
|
@test "show help for pyenv-install" {
|
||||||
stub_python_build
|
|
||||||
stub pyenv-help 'install : true'
|
stub pyenv-help 'install : true'
|
||||||
|
|
||||||
run pyenv-install -h
|
run pyenv-install -h
|
||||||
@@ -263,7 +282,7 @@ OUT
|
|||||||
unstub pyenv-help
|
unstub pyenv-help
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "more than one argument for pyenv-uninstall" {
|
@test "multiple arguments for pyenv-uninstall" {
|
||||||
mkdir -p "${PYENV_ROOT}/versions/3.4.1"
|
mkdir -p "${PYENV_ROOT}/versions/3.4.1"
|
||||||
mkdir -p "${PYENV_ROOT}/versions/3.4.2"
|
mkdir -p "${PYENV_ROOT}/versions/3.4.2"
|
||||||
run pyenv-uninstall -f 3.4.1 3.4.2
|
run pyenv-uninstall -f 3.4.1 3.4.2
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ run_inline_definition_with_name() {
|
|||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
patch -p0 --force -i $TMP/python-patch.XXX
|
patch -p0 --force -i $TMP/python-patch.XXX
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib"
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib"
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -153,7 +153,7 @@ OUT
|
|||||||
patch: bar
|
patch: bar
|
||||||
patch: baz
|
patch: baz
|
||||||
patch: foo
|
patch: foo
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib"
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib"
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -177,7 +177,7 @@ OUT
|
|||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib"
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib"
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make altinstall
|
make altinstall
|
||||||
@@ -245,25 +245,27 @@ OUT
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "enable framework" {
|
@test "enable framework" {
|
||||||
mkdir -p "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin"
|
framework_path="${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin"
|
||||||
touch "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3"
|
mkdir -p "$framework_path"
|
||||||
chmod +x "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3"
|
for executable in python3{,.4}{,-config}; do
|
||||||
touch "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3.4"
|
touch "$framework_path/$executable"
|
||||||
chmod +x "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3.4"
|
chmod +x "$framework_path/$executable"
|
||||||
touch "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3-config"
|
done
|
||||||
chmod +x "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3-config"
|
unset framework_path executable
|
||||||
touch "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3.4-config"
|
|
||||||
chmod +x "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3.4-config"
|
|
||||||
|
|
||||||
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||||
|
|
||||||
PYTHON_CONFIGURE_OPTS="--enable-framework" TMPDIR="$TMP" run_inline_definition <<OUT
|
PYTHON_CONFIGURE_OPTS="--enable-framework" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||||
|
echo "PYTHON_CONFIGURE_OPTS=(\${PYTHON_CONFIGURE_OPTS})"
|
||||||
|
echo "CONFIGURE_OPTS=(\${CONFIGURE_OPTS})"
|
||||||
verify_python python3.4
|
verify_python python3.4
|
||||||
OUT
|
OUT
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<EOS
|
assert_output <<EOS
|
||||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-framework=${TMP}/install/Library/Frameworks)
|
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-framework=${TMP}/install/Library/Frameworks)
|
||||||
|
PYTHON_CONFIGURE_OPTS=()
|
||||||
|
CONFIGURE_OPTS=()
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
[ -L "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python" ]
|
[ -L "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python" ]
|
||||||
@@ -277,10 +279,14 @@ EOS
|
|||||||
|
|
||||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||||
|
echo "PYTHON_CONFIGURE_OPTS=(\${PYTHON_CONFIGURE_OPTS})"
|
||||||
|
echo "CONFIGURE_OPTS=(\${CONFIGURE_OPTS})"
|
||||||
OUT
|
OUT
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<EOS
|
assert_output <<EOS
|
||||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/)
|
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||||
|
PYTHON_CONFIGURE_OPTS=()
|
||||||
|
CONFIGURE_OPTS=()
|
||||||
EOS
|
EOS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,10 +297,14 @@ EOS
|
|||||||
|
|
||||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||||
|
echo "PYTHON_CONFIGURE_OPTS=(\${PYTHON_CONFIGURE_OPTS})"
|
||||||
|
echo "CONFIGURE_OPTS=(\${CONFIGURE_OPTS})"
|
||||||
OUT
|
OUT
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<EOS
|
assert_output <<EOS
|
||||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=universal2)
|
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=universal2)
|
||||||
|
PYTHON_CONFIGURE_OPTS=()
|
||||||
|
CONFIGURE_OPTS=()
|
||||||
EOS
|
EOS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,7 +325,7 @@ EOS
|
|||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
for i in {1..4}; do stub brew false; done
|
for i in {1..4}; do stub brew false; done
|
||||||
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
for i in {1..7}; do stub uname '-s : echo Linux'; done
|
||||||
stub "$MAKE" \
|
stub "$MAKE" \
|
||||||
" : echo \"$MAKE \$@\" >> build.log" \
|
" : echo \"$MAKE \$@\" >> build.log" \
|
||||||
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||||
@@ -324,7 +334,7 @@ EOS
|
|||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib"
|
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib"
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs2
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --enable-unicode=ucs2
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
DEFINITION_PREFIX="${DEFINITION%%:*}"
|
pyenv_install_resolve_latest() {
|
||||||
DEFINITION_TYPE="${DEFINITION_PREFIX%%-*}" # TODO: support non-CPython versions
|
local DEFINITION_PREFIX DEFINITION_TYPE
|
||||||
if [[ "${DEFINITION}" != "${DEFINITION_PREFIX}" ]]; then
|
local -a DEFINITION_CANDIDATES
|
||||||
DEFINITION_CANDIDATES=(\
|
local DEFINITION="$1"
|
||||||
$(python-build --definitions | \
|
|
||||||
grep -F "${DEFINITION_PREFIX}" | \
|
DEFINITION_PREFIX="${DEFINITION%%:*}"
|
||||||
grep "^${DEFINITION_TYPE}" | \
|
DEFINITION_TYPE="${DEFINITION_PREFIX%%-*}" # TODO: support non-CPython versions
|
||||||
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/(b|rc)[0-9]+$/d' | \
|
if [[ "${DEFINITION}" != "${DEFINITION_PREFIX}" ]]; then
|
||||||
sort -t. -k1,1r -k 2,2nr -k 3,3nr \
|
DEFINITION_CANDIDATES=(\
|
||||||
|| true))
|
$(python-build --definitions | \
|
||||||
DEFINITION="${DEFINITION_CANDIDATES}"
|
grep -F "${DEFINITION_PREFIX}" | \
|
||||||
VERSION_NAME="${DEFINITION##*/}"
|
grep "^${DEFINITION_TYPE}" | \
|
||||||
fi
|
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/(b|rc)[0-9]+$/d' | \
|
||||||
|
sort -t. -k1,1r -k 2,2nr -k 3,3nr \
|
||||||
|
|| true))
|
||||||
|
DEFINITION="${DEFINITION_CANDIDATES}"
|
||||||
|
fi
|
||||||
|
echo "$DEFINITION"
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in ${!DEFINITIONS[*]}; do
|
||||||
|
DEFINITIONS[$i]="$(pyenv_install_resolve_latest "${DEFINITIONS[$i]}")"
|
||||||
|
done
|
||||||
|
|
||||||
|
unset pyenv_install_resolve_latest
|
||||||
|
|||||||
@@ -93,3 +93,22 @@ echo 3.10.6
|
|||||||
3.10.8
|
3.10.8
|
||||||
!
|
!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "ignores rolling releases, branch tips, alternative srcs, prereleases and virtualenvs" {
|
||||||
|
create_executable pyenv-versions <<!
|
||||||
|
#!$BASH
|
||||||
|
echo 3.8.5-dev
|
||||||
|
echo 3.8.5-src
|
||||||
|
echo 3.8.5-latest
|
||||||
|
echo 3.8.5a2
|
||||||
|
echo 3.8.5b3
|
||||||
|
echo 3.8.5rc2
|
||||||
|
echo 3.8.1
|
||||||
|
echo 3.8.1/envs/foo
|
||||||
|
!
|
||||||
|
run pyenv-latest 3.8
|
||||||
|
assert_success
|
||||||
|
assert_output <<!
|
||||||
|
3.8.1
|
||||||
|
!
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ create_version() {
|
|||||||
mkdir -p "${PYENV_ROOT}/versions/$1"
|
mkdir -p "${PYENV_ROOT}/versions/$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_alias() {
|
||||||
|
mkdir -p "${PYENV_ROOT}/versions"
|
||||||
|
ln -s "$2" "${PYENV_ROOT}/versions/$1"
|
||||||
|
}
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
mkdir -p "$PYENV_TEST_DIR"
|
mkdir -p "$PYENV_TEST_DIR"
|
||||||
cd "$PYENV_TEST_DIR"
|
cd "$PYENV_TEST_DIR"
|
||||||
@@ -61,18 +66,38 @@ OUT
|
|||||||
assert_success "3.3"
|
assert_success "3.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "multiple versions" {
|
@test "multiple versions and envs" {
|
||||||
stub_system_python
|
stub_system_python
|
||||||
create_version "2.7.6"
|
create_version "2.7.6"
|
||||||
create_version "3.3.3"
|
|
||||||
create_version "3.4.0"
|
create_version "3.4.0"
|
||||||
|
create_version "3.4.0/envs/foo"
|
||||||
|
create_version "3.4.0/envs/bar"
|
||||||
|
create_version "3.5.2"
|
||||||
run pyenv-versions
|
run pyenv-versions
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
* system (set by ${PYENV_ROOT}/version)
|
* system (set by ${PYENV_ROOT}/version)
|
||||||
2.7.6
|
2.7.6
|
||||||
|
3.4.0
|
||||||
|
3.4.0/envs/bar
|
||||||
|
3.4.0/envs/foo
|
||||||
|
3.5.2
|
||||||
|
OUT
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "skips envs with --skip-envs" {
|
||||||
|
create_version "3.3.3"
|
||||||
|
create_version "3.4.0"
|
||||||
|
create_version "3.4.0/envs/foo"
|
||||||
|
create_version "3.4.0/envs/bar"
|
||||||
|
create_version "3.5.0"
|
||||||
|
|
||||||
|
run pyenv-versions --skip-envs
|
||||||
|
assert_success <<OUT
|
||||||
|
* system (set by ${PYENV_ROOT}/version)
|
||||||
3.3.3
|
3.3.3
|
||||||
3.4.0
|
3.4.0
|
||||||
|
3.5.0
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +163,7 @@ OUT
|
|||||||
|
|
||||||
@test "lists symlinks under versions" {
|
@test "lists symlinks under versions" {
|
||||||
create_version "2.7.8"
|
create_version "2.7.8"
|
||||||
ln -s "2.7.8" "${PYENV_ROOT}/versions/2.7"
|
create_alias "2.7" "2.7.8"
|
||||||
|
|
||||||
run pyenv-versions --bare
|
run pyenv-versions --bare
|
||||||
assert_success
|
assert_success
|
||||||
@@ -150,9 +175,9 @@ OUT
|
|||||||
|
|
||||||
@test "doesn't list symlink aliases when --skip-aliases" {
|
@test "doesn't list symlink aliases when --skip-aliases" {
|
||||||
create_version "1.8.7"
|
create_version "1.8.7"
|
||||||
ln -s "1.8.7" "${PYENV_ROOT}/versions/1.8"
|
create_alias "1.8" "1.8.7"
|
||||||
mkdir moo
|
mkdir moo
|
||||||
ln -s "${PWD}/moo" "${PYENV_ROOT}/versions/1.9"
|
create_alias "1.9" "${PWD}/moo"
|
||||||
|
|
||||||
run pyenv-versions --bare --skip-aliases
|
run pyenv-versions --bare --skip-aliases
|
||||||
assert_success
|
assert_success
|
||||||
@@ -210,3 +235,14 @@ SH
|
|||||||
1.9.0
|
1.9.0
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "non-bare output shows symlink contents" {
|
||||||
|
create_version "1.9.0"
|
||||||
|
create_alias "link" "foo/bar"
|
||||||
|
|
||||||
|
run pyenv-versions
|
||||||
|
assert_success <<OUT
|
||||||
|
1.9.0
|
||||||
|
link --> foo/bar
|
||||||
|
OUT
|
||||||
|
}
|
||||||
|
|||||||
@@ -136,3 +136,22 @@ SH
|
|||||||
PYENV_VERSION= run pyenv-which python
|
PYENV_VERSION= run pyenv-which python
|
||||||
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
|
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "resolves pyenv-latest prefixes" {
|
||||||
|
create_executable "3.4.2" "python"
|
||||||
|
|
||||||
|
PYENV_VERSION=3.4 run pyenv-which python
|
||||||
|
assert_success "${PYENV_ROOT}/versions/3.4.2/bin/python"
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "hooks get resolved version name" {
|
||||||
|
create_hook which echo.bash <<!
|
||||||
|
echo version=\$version
|
||||||
|
exit
|
||||||
|
!
|
||||||
|
|
||||||
|
create_executable "3.4.2" "python"
|
||||||
|
|
||||||
|
PYENV_VERSION=3.4 run pyenv-which python
|
||||||
|
assert_success "version=3.4.2"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user