mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-10 12:33:48 -05:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1edb81e8e | ||
|
|
5f7892f728 | ||
|
|
86be59a6d5 | ||
|
|
dc873cf568 | ||
|
|
aef6a2a6d0 | ||
|
|
527d8fab3e | ||
|
|
fc0e27c24b | ||
|
|
a2ad48aa40 | ||
|
|
d04a081dcb | ||
|
|
cb83169098 | ||
|
|
3bdb9bd1e7 | ||
|
|
cc40a3f965 | ||
|
|
25e70b2c80 | ||
|
|
4c90a3147f | ||
|
|
ee84e89ef1 | ||
|
|
a39449bc50 | ||
|
|
3bc0d858cc |
120
.github/workflows/modified_scripts_build.yml
vendored
120
.github/workflows/modified_scripts_build.yml
vendored
@@ -82,6 +82,67 @@ jobs:
|
|||||||
pyenv global system
|
pyenv global system
|
||||||
rm -f "$(pyenv root)"/shims/*
|
rm -f "$(pyenv root)"/shims/*
|
||||||
|
|
||||||
|
macos_build_bundled_dependencies:
|
||||||
|
needs: discover_modified_scripts
|
||||||
|
if: needs.discover_modified_scripts.outputs.versions != '[""]'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ${{fromJson(needs.discover_modified_scripts.outputs.versions)}}
|
||||||
|
os: ["macos-13", "macos-14"]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: |
|
||||||
|
#envvars
|
||||||
|
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
||||||
|
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
|
||||||
|
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||||
|
- run: |
|
||||||
|
#prerequisites
|
||||||
|
brew install sqlite3 xz zlib
|
||||||
|
"$GITHUB_WORKSPACE/.github/workflows/scripts/brew-uninstall-cascade.sh" openssl@3 openssl@1.1 readline
|
||||||
|
if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then
|
||||||
|
export PYENV_BOOTSTRAP_VERSION=pypy2.7-7
|
||||||
|
echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV
|
||||||
|
pyenv install $PYENV_BOOTSTRAP_VERSION
|
||||||
|
fi
|
||||||
|
- run: |
|
||||||
|
#build
|
||||||
|
pyenv --debug install ${{ matrix.python-version }}
|
||||||
|
pyenv global ${{ matrix.python-version }}
|
||||||
|
# Micropython doesn't support --version
|
||||||
|
- run: |
|
||||||
|
#print version
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
python -c 'import sys; print(sys.version)'
|
||||||
|
else
|
||||||
|
python --version
|
||||||
|
python -m pip --version
|
||||||
|
fi
|
||||||
|
# Micropython doesn't support sys.executable, os.path, older versions even os
|
||||||
|
- env:
|
||||||
|
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||||
|
run: |
|
||||||
|
#check
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
|
||||||
|
python -c 'import sys; assert sys.implementation.name == "micropython"'
|
||||||
|
else
|
||||||
|
python -c 'if True:
|
||||||
|
import os, sys, os.path
|
||||||
|
correct_dir = os.path.join(
|
||||||
|
os.environ["PYENV_ROOT"],
|
||||||
|
"versions",
|
||||||
|
os.environ["EXPECTED_PYTHON"],
|
||||||
|
"bin")
|
||||||
|
assert os.path.dirname(sys.executable) == correct_dir'
|
||||||
|
fi
|
||||||
|
# bundled executables in some Anaconda releases cause the post-run step to hang in MacOS
|
||||||
|
- run: |
|
||||||
|
pyenv global system
|
||||||
|
rm -f "$(pyenv root)"/shims/*
|
||||||
|
|
||||||
ubuntu_build:
|
ubuntu_build:
|
||||||
needs: discover_modified_scripts
|
needs: discover_modified_scripts
|
||||||
if: needs.discover_modified_scripts.outputs.versions != '[""]'
|
if: needs.discover_modified_scripts.outputs.versions != '[""]'
|
||||||
@@ -140,3 +201,62 @@ jobs:
|
|||||||
"bin")
|
"bin")
|
||||||
assert os.path.dirname(sys.executable) == correct_dir'
|
assert os.path.dirname(sys.executable) == correct_dir'
|
||||||
fi
|
fi
|
||||||
|
ubuntu_build_tar_gz:
|
||||||
|
needs: discover_modified_scripts
|
||||||
|
if: needs.discover_modified_scripts.outputs.versions != '[""]'
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ${{fromJson(needs.discover_modified_scripts.outputs.versions)}}
|
||||||
|
os: ["ubuntu-20.04", "ubuntu-22.04"]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: |
|
||||||
|
#envvars
|
||||||
|
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
||||||
|
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
|
||||||
|
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||||
|
echo "_PYTHON_BUILD_FORCE_SKIP_XZ=1" >> $GITHUB_PATH
|
||||||
|
- run: |
|
||||||
|
#prerequisites
|
||||||
|
sudo apt-get update -q; sudo apt-get install -yq make build-essential \
|
||||||
|
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
|
||||||
|
curl llvm libncurses5-dev libncursesw5-dev \
|
||||||
|
xz-utils tk-dev libffi-dev liblzma-dev
|
||||||
|
if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then
|
||||||
|
export PYENV_BOOTSTRAP_VERSION=pypy2.7-7
|
||||||
|
echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV
|
||||||
|
pyenv install $PYENV_BOOTSTRAP_VERSION
|
||||||
|
fi
|
||||||
|
- run: |
|
||||||
|
#build
|
||||||
|
pyenv install -v ${{ matrix.python-version }}
|
||||||
|
pyenv global ${{ matrix.python-version }}
|
||||||
|
# Micropython doesn't support --version
|
||||||
|
- run: |
|
||||||
|
#print version
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
python -c 'import sys; print(sys.version)'
|
||||||
|
else
|
||||||
|
python --version
|
||||||
|
python -m pip --version
|
||||||
|
fi
|
||||||
|
# Micropython doesn't support sys.executable, os.path, older versions even os
|
||||||
|
- env:
|
||||||
|
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||||
|
run: |
|
||||||
|
#check
|
||||||
|
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||||
|
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
|
||||||
|
python -c 'import sys; assert sys.implementation.name == "micropython"'
|
||||||
|
else
|
||||||
|
python -c 'if True:
|
||||||
|
import os, sys, os.path
|
||||||
|
correct_dir = os.path.join(
|
||||||
|
os.environ["PYENV_ROOT"],
|
||||||
|
"versions",
|
||||||
|
os.environ["EXPECTED_PYTHON"],
|
||||||
|
"bin")
|
||||||
|
assert os.path.dirname(sys.executable) == correct_dir'
|
||||||
|
fi
|
||||||
|
|||||||
11
.github/workflows/scripts/brew-uninstall-cascade.sh
vendored
Executable file
11
.github/workflows/scripts/brew-uninstall-cascade.sh
vendored
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
declare -a packages rdepends
|
||||||
|
packages=("$@")
|
||||||
|
|
||||||
|
# have to try one by one, otherwise `brew uses` would only print
|
||||||
|
# packages that require them all rather than any of them
|
||||||
|
for package in "${packages[@]}"; do
|
||||||
|
rdepends+=($(brew uses --installed --include-build --include-test --include-optional --recursive "$package"))
|
||||||
|
done
|
||||||
|
brew uninstall "${packages[@]}" "${rdepends[@]}"
|
||||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,5 +1,22 @@
|
|||||||
# Version History
|
# Version History
|
||||||
|
|
||||||
|
## Release v2.4.23
|
||||||
|
* README: explain using multiple versions by @Finkregh in https://github.com/pyenv/pyenv/pull/3126
|
||||||
|
* Support PACKAGE_CPPFLAGS and PACKAGE_LDFLAGS by @native-api in https://github.com/pyenv/pyenv/pull/3130
|
||||||
|
* Adjust suggested shell startup code to support Pyenv with Pyenv-Win in WSL by @native-api in https://github.com/pyenv/pyenv/pull/3132
|
||||||
|
* Support nonexistent versions being present and set in a local .python-version by @native-api in https://github.com/pyenv/pyenv/pull/3134
|
||||||
|
* Add CPython 3.14.0a3 by @nedbat in https://github.com/pyenv/pyenv/pull/3135
|
||||||
|
|
||||||
|
## Release v2.4.22
|
||||||
|
* Speed up building bundled OpenSSL by @native-api in https://github.com/pyenv/pyenv/pull/3124
|
||||||
|
* CI: add building modified scripts with bundled MacOS dependencies by @native-api in https://github.com/pyenv/pyenv/pull/3123
|
||||||
|
* CL: + test modified scripts with tar.gz source by @native-api in https://github.com/pyenv/pyenv/pull/3125
|
||||||
|
* Fix 404 for openssl-3.4.0 release in build 3.13.1 by @dlamblin in https://github.com/pyenv/pyenv/pull/3122
|
||||||
|
|
||||||
|
## Release v2.4.21
|
||||||
|
* Add CPython 3.13.1t by @makukha in https://github.com/pyenv/pyenv/pull/3120
|
||||||
|
* Prefer tcl-tk@8 from Homebrew due to release of Tcl/Tk 9 with which only 3.12+ are compatible by @native-api in https://github.com/pyenv/pyenv/pull/3118
|
||||||
|
|
||||||
## Release v2.4.20
|
## Release v2.4.20
|
||||||
* README: Fix Markdown in "Notes about python releases" by @noelleleigh in https://github.com/pyenv/pyenv/pull/3112
|
* README: Fix Markdown in "Notes about python releases" by @noelleleigh in https://github.com/pyenv/pyenv/pull/3112
|
||||||
* README: correct link to shell setup instructions by @shortcuts in https://github.com/pyenv/pyenv/pull/3113
|
* README: correct link to shell setup instructions by @shortcuts in https://github.com/pyenv/pyenv/pull/3113
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ or, if you prefer 3.3.3 over 2.7.6,
|
|||||||
Python 3.3.3
|
Python 3.3.3
|
||||||
|
|
||||||
|
|
||||||
|
You can use the `-f/--force` flag to force setting versions even if some aren't installed.
|
||||||
|
This is mainly useful in special cases like provisioning scripts.
|
||||||
|
|
||||||
|
|
||||||
## `pyenv global`
|
## `pyenv global`
|
||||||
|
|
||||||
Sets the global version of Python to be used in all shells by writing
|
Sets the global version of Python to be used in all shells by writing
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -51,6 +51,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
|||||||
* [Install additional Python versions](#install-additional-python-versions)
|
* [Install additional Python versions](#install-additional-python-versions)
|
||||||
* [Prefix auto-resolution to the latest version](#prefix-auto-resolution-to-the-latest-version)
|
* [Prefix auto-resolution to the latest version](#prefix-auto-resolution-to-the-latest-version)
|
||||||
* [Switch between Python versions](#switch-between-python-versions)
|
* [Switch between Python versions](#switch-between-python-versions)
|
||||||
|
* [Making multiple versions available](#making-multiple-versions-available)
|
||||||
* [Uninstall Python versions](#uninstall-python-versions)
|
* [Uninstall Python versions](#uninstall-python-versions)
|
||||||
* [Other operations](#other-operations)
|
* [Other operations](#other-operations)
|
||||||
* [Upgrading](#upgrading)
|
* [Upgrading](#upgrading)
|
||||||
@@ -189,7 +190,7 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
||||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
||||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||||
```
|
```
|
||||||
3. Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
3. Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
||||||
@@ -198,7 +199,7 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
|||||||
* to add to `~/.profile`:
|
* to add to `~/.profile`:
|
||||||
``` bash
|
``` bash
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||||
echo 'eval "$(pyenv init -)"' >> ~/.profile
|
echo 'eval "$(pyenv init -)"' >> ~/.profile
|
||||||
```
|
```
|
||||||
* to add to `~/.bash_profile`:
|
* to add to `~/.bash_profile`:
|
||||||
@@ -389,6 +390,20 @@ for more details on how the selection works and more information on its usage.
|
|||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
#### Making multiple versions available
|
||||||
|
|
||||||
|
You can select multiple Python versions at the same time by specifying multiple arguments.
|
||||||
|
E.g. if you wish to use the latest installed CPython 3.11 and 3.12:
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
pyenv global 3.11 3.12
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Whenever you run a command provided by a Python installation, these versions will be searched for it in the specified order.
|
||||||
|
[Due to the shims' fall-through behavior]((#understanding-python-version-selection)), `system` is always implicitly searched afterwards.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
### Uninstall Python versions
|
### Uninstall Python versions
|
||||||
|
|
||||||
As time goes on, you will accumulate Python versions in your
|
As time goes on, you will accumulate Python versions in your
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
version="2.4.20"
|
version="2.4.23"
|
||||||
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
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if [ "$1" = "--complete" ]; then
|
|||||||
exec pyenv-shims --short
|
exec pyenv-shims --short
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYENV_VERSION="$(pyenv-version-name)"
|
PYENV_VERSION="$(pyenv-version-name -f)"
|
||||||
PYENV_COMMAND="$1"
|
PYENV_COMMAND="$1"
|
||||||
|
|
||||||
if [ -z "$PYENV_COMMAND" ]; then
|
if [ -z "$PYENV_COMMAND" ]; then
|
||||||
@@ -29,9 +29,9 @@ if [ -z "$PYENV_COMMAND" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PYENV_VERSION
|
|
||||||
PYENV_COMMAND_PATH="$(pyenv-which "$PYENV_COMMAND")"
|
PYENV_COMMAND_PATH="$(pyenv-which "$PYENV_COMMAND")"
|
||||||
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
|
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
|
||||||
|
export PYENV_VERSION
|
||||||
|
|
||||||
OLDIFS="$IFS"
|
OLDIFS="$IFS"
|
||||||
IFS=$'\n' scripts=(`pyenv-hooks exec`)
|
IFS=$'\n' scripts=(`pyenv-hooks exec`)
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
#
|
#
|
||||||
# Summary: Set or show the local application-specific Python version(s)
|
# Summary: Set or show the local application-specific Python version(s)
|
||||||
#
|
#
|
||||||
# Usage: pyenv local <version> <version2> <..>
|
# Usage: pyenv local [-f|--force] [<version> [...]]
|
||||||
# pyenv local --unset
|
# pyenv local --unset
|
||||||
#
|
#
|
||||||
|
# -f/--force Do not verify that the versions being set exist
|
||||||
|
#
|
||||||
# Sets the local application-specific Python version(s) by writing the
|
# Sets the local application-specific Python version(s) by writing the
|
||||||
# version name to a file named `.python-version'.
|
# version name to a file named `.python-version'.
|
||||||
#
|
#
|
||||||
@@ -36,12 +38,25 @@ if [ "$1" = "--complete" ]; then
|
|||||||
exec pyenv-versions --bare
|
exec pyenv-versions --bare
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-f|--force)
|
||||||
|
FORCE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
versions=("$@")
|
versions=("$@")
|
||||||
|
|
||||||
if [ "$versions" = "--unset" ]; then
|
if [ "$versions" = "--unset" ]; then
|
||||||
rm -f .python-version
|
rm -f .python-version
|
||||||
elif [ -n "$versions" ]; then
|
elif [ -n "$versions" ]; then
|
||||||
pyenv-version-file-write .python-version "${versions[@]}"
|
pyenv-version-file-write ${FORCE:+-f }.python-version "${versions[@]}"
|
||||||
else
|
else
|
||||||
if version_file="$(pyenv-version-file "$PWD")"; then
|
if version_file="$(pyenv-version-file "$PWD")"; then
|
||||||
IFS=: versions=($(pyenv-version-file-read "$version_file"))
|
IFS=: versions=($(pyenv-version-file-read "$version_file"))
|
||||||
|
|||||||
@@ -1,9 +1,25 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Usage: pyenv version-file-write <file> <version>
|
# Usage: pyenv version-file-write [-f|--force] <file> <version> [...]
|
||||||
|
#
|
||||||
|
# -f/--force Don't verify that the versions exist
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-f|--force)
|
||||||
|
FORCE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
PYENV_VERSION_FILE="$1"
|
PYENV_VERSION_FILE="$1"
|
||||||
shift || true
|
shift || true
|
||||||
versions=("$@")
|
versions=("$@")
|
||||||
@@ -14,7 +30,7 @@ if [ -z "$versions" ] || [ -z "$PYENV_VERSION_FILE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure the specified version is installed.
|
# Make sure the specified version is installed.
|
||||||
pyenv-prefix "${versions[@]}" >/dev/null
|
[[ -z $FORCE ]] && pyenv-prefix "${versions[@]}" >/dev/null
|
||||||
|
|
||||||
# Write the version out to disk.
|
# Write the version out to disk.
|
||||||
# Create an empty file. Using "rm" might cause a permission error.
|
# Create an empty file. Using "rm" might cause a permission error.
|
||||||
|
|||||||
@@ -1,8 +1,25 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Summary: Show the current Python version
|
# Summary: Show the current Python version
|
||||||
|
#
|
||||||
|
# -f/--force (Internal) If a version doesn't exist, print it as is rather than produce an error
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-f|--force)
|
||||||
|
FORCE=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$PYENV_VERSION" ]; then
|
if [ -z "$PYENV_VERSION" ]; then
|
||||||
PYENV_VERSION_FILE="$(pyenv-version-file)"
|
PYENV_VERSION_FILE="$(pyenv-version-file)"
|
||||||
PYENV_VERSION="$(pyenv-version-file-read "$PYENV_VERSION_FILE" || true)"
|
PYENV_VERSION="$(pyenv-version-file-read "$PYENV_VERSION_FILE" || true)"
|
||||||
@@ -33,17 +50,21 @@ OLDIFS="$IFS"
|
|||||||
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
||||||
normalised_version="${version#python-}"
|
normalised_version="${version#python-}"
|
||||||
if version_exists "${version}" || [ "$version" = "system" ]; then
|
if version_exists "${version}" || [ "$version" = "system" ]; then
|
||||||
versions=("${versions[@]}" "${version}")
|
versions+=("${version}")
|
||||||
elif version_exists "${normalised_version}"; then
|
elif version_exists "${normalised_version}"; then
|
||||||
versions=("${versions[@]}" "${normalised_version}")
|
versions+=("${normalised_version}")
|
||||||
elif resolved_version="$(pyenv-latest -b "${version}")"; then
|
elif resolved_version="$(pyenv-latest -b "${version}")"; then
|
||||||
versions=("${versions[@]}" "${resolved_version}")
|
versions+=("${resolved_version}")
|
||||||
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
||||||
versions=("${versions[@]}" "${resolved_version}")
|
versions+=("${resolved_version}")
|
||||||
|
else
|
||||||
|
if [[ -n $FORCE ]]; then
|
||||||
|
versions+=("${normalised_version}")
|
||||||
else
|
else
|
||||||
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
|
any_not_installed=1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
IFS="$OLDIFS"
|
IFS="$OLDIFS"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ if [ -z "$PYENV_COMMAND" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
OLDIFS="$IFS"
|
OLDIFS="$IFS"
|
||||||
IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name)})
|
IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name -f)})
|
||||||
IFS="$OLDIFS"
|
IFS="$OLDIFS"
|
||||||
|
|
||||||
declare -a nonexistent_versions
|
declare -a nonexistent_versions
|
||||||
@@ -96,7 +96,6 @@ else
|
|||||||
for version in "${nonexistent_versions[@]}"; do
|
for version in "${nonexistent_versions[@]}"; do
|
||||||
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
|
||||||
done
|
done
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "pyenv: $PYENV_COMMAND: command not found" >&2
|
echo "pyenv: $PYENV_COMMAND: command not found" >&2
|
||||||
|
|||||||
@@ -169,16 +169,14 @@ You can set certain environment variables to control the build process.
|
|||||||
* `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get
|
* `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get
|
||||||
additionally searched when looking up build definitions.
|
additionally searched when looking up build definitions.
|
||||||
* `CC` sets the path to the C compiler.
|
* `CC` sets the path to the C compiler.
|
||||||
* `PYTHON_CFLAGS` lets you pass additional options to the default `CFLAGS`. Use
|
|
||||||
this to override, for instance, the `-O3` option.
|
|
||||||
* `CONFIGURE_OPTS` lets you pass additional options to `./configure`.
|
* `CONFIGURE_OPTS` lets you pass additional options to `./configure`.
|
||||||
* `MAKE` lets you override the command to use for `make`. Useful for specifying
|
* `MAKE` lets you override the command to use for `make`. Useful for specifying
|
||||||
GNU make (`gmake`) on some systems.
|
GNU make (`gmake`) on some systems.
|
||||||
* `MAKE_OPTS` (or `MAKEOPTS`) lets you pass additional options to `make`.
|
* `MAKE_OPTS` (or `MAKEOPTS`) lets you pass additional options to `make`.
|
||||||
* `MAKE_INSTALL_OPTS` lets you pass additional options to `make install`.
|
* `MAKE_INSTALL_OPTS` lets you pass additional options to `make install`.
|
||||||
* `PYTHON_CONFIGURE_OPTS` and `PYTHON_MAKE_OPTS` and `PYTHON_MAKE_INSTALL_OPTS` allow
|
* `<PACKAGE>_CFLAGS`, `<PACKAGE>_CPPFLAGS`, `<PACKAGE>_LDFLAGS` let you pass additional options to `CFLAGS`/`CPPFLAGS`/`LDFLAGS` specifically for building `<package>` (Python itself or a dependency library) from source as part of the build script. `<PACKAGE>` should be a capitalized name of the package without version (technically, capitalized first argument to `install_package` without version). E.g. for CPython, it's "`PYTHON`", for Readline, "`READLINE`", for PyPy (only applies when building it from source), "`PYPY`". Check the source of the build script you're using if unsure.
|
||||||
you to specify configure and make options for building CPython. These variables
|
* `<PACKAGE>_CONFIGURE_OPTS`, `<PACKAGE>_MAKE_OPTS`, `<PACKAGE>_MAKE_INSTALL_OPTS`, `<PACKAGE>_MAKE_INSTALL_TARGET` allow
|
||||||
will be passed to Python only, not any dependent packages (e.g. libyaml).
|
you to specify configure and make options for building `<package>` (same as above). "Make install target" would replace "`install`" in the `make install` invocation.
|
||||||
|
|
||||||
### Applying patches to Python before compiling
|
### Applying patches to Python before compiling
|
||||||
|
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ download_tarball() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
has_tar_xz_support() {
|
has_tar_xz_support() {
|
||||||
tar Jcf - /dev/null 1>/dev/null 2>&1
|
[[ -z $_PYTHON_BUILD_FORCE_SKIP_XZ ]] && tar Jcf - /dev/null 1>/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_git() {
|
fetch_git() {
|
||||||
@@ -811,10 +811,12 @@ build_package_standard_build() {
|
|||||||
local PACKAGE_MAKE_OPTS="${package_var_name}_MAKE_OPTS"
|
local PACKAGE_MAKE_OPTS="${package_var_name}_MAKE_OPTS"
|
||||||
local PACKAGE_MAKE_OPTS_ARRAY="${package_var_name}_MAKE_OPTS_ARRAY[@]"
|
local PACKAGE_MAKE_OPTS_ARRAY="${package_var_name}_MAKE_OPTS_ARRAY[@]"
|
||||||
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
||||||
|
local PACKAGE_CPPFLAGS="${package_var_name}_CPPFLAGS"
|
||||||
|
local PACKAGE_LDFLAGS="${package_var_name}_LDFLAGS"
|
||||||
|
|
||||||
if [ "$package_var_name" = "PYTHON" ]; then
|
if [ "$package_var_name" = "PYTHON" ]; then
|
||||||
use_homebrew || true
|
use_homebrew || true
|
||||||
use_tcltk || true
|
use_custom_tcltk || use_homebrew_tcltk || true
|
||||||
use_homebrew_readline || use_freebsd_pkg || true
|
use_homebrew_readline || use_freebsd_pkg || true
|
||||||
use_homebrew_ncurses || true
|
use_homebrew_ncurses || true
|
||||||
if is_mac -ge 1014; then
|
if is_mac -ge 1014; then
|
||||||
@@ -826,8 +828,14 @@ build_package_standard_build() {
|
|||||||
use_free_threading || true
|
use_free_threading || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
|
( if [[ -n "${!PACKAGE_CFLAGS}" ]]; then
|
||||||
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
|
export CFLAGS="${CFLAGS:+$CFLAGS }${!PACKAGE_CFLAGS}"
|
||||||
|
fi
|
||||||
|
if [[ -n "${!PACKAGE_CPPFLAGS}" ]]; then
|
||||||
|
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }${!PACKAGE_CPPFLAGS}"
|
||||||
|
fi
|
||||||
|
if [[ -n "${!PACKAGE_LDFLAGS}" ]]; then
|
||||||
|
export LDFLAGS="${LDFLAGS:+$LDFLAGS }${!PACKAGE_LDFLAGS}"
|
||||||
fi
|
fi
|
||||||
if [ -z "$CC" ] && is_mac -ge 1010; then
|
if [ -z "$CC" ] && is_mac -ge 1010; then
|
||||||
export CC=clang
|
export CC=clang
|
||||||
@@ -1594,11 +1602,7 @@ build_package_mac_openssl() {
|
|||||||
[[ "$1" != openssl-1.0.* ]] || nokerberos=1
|
[[ "$1" != openssl-1.0.* ]] || nokerberos=1
|
||||||
|
|
||||||
# Compile a shared lib with zlib dynamically linked.
|
# Compile a shared lib with zlib dynamically linked.
|
||||||
package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5}
|
package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5} no-docs no-apps no-tests
|
||||||
|
|
||||||
# Default MAKE_OPTS are -j 2 which can confuse the build. Thankfully, make
|
|
||||||
# gives precedence to the last -j option, so we can override that.
|
|
||||||
package_option openssl make -j 1
|
|
||||||
|
|
||||||
build_package_standard "$@"
|
build_package_standard "$@"
|
||||||
|
|
||||||
@@ -1671,8 +1675,12 @@ use_xcode_sdk_zlib() {
|
|||||||
|
|
||||||
use_homebrew_tcltk() {
|
use_homebrew_tcltk() {
|
||||||
can_use_homebrew || return 1
|
can_use_homebrew || return 1
|
||||||
# get the version from the folder that homebrew versions
|
# Since https://github.com/Homebrew/homebrew-core/commit/f10e88617b41555193c22fdcba6109fe82155ee2 (10.11.2024),
|
||||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
# tcl-tk is 9.0 which is not compatible with CPython as of this writing
|
||||||
|
# but we'll keep it as backup for cases like non-updated Homebrew
|
||||||
|
local tcltk
|
||||||
|
for tcltk in "tcl-tk@8" "tcl-tk"; do
|
||||||
|
local tcltk_libdir="$(brew --prefix "${tcltk}" 2>/dev/null || true)"
|
||||||
if [ -d "$tcltk_libdir" ]; then
|
if [ -d "$tcltk_libdir" ]; then
|
||||||
echo "python-build: use tcl-tk from homebrew"
|
echo "python-build: use tcl-tk from homebrew"
|
||||||
if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
|
if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
|
||||||
@@ -1689,13 +1697,21 @@ use_homebrew_tcltk() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# FIXME: this function is a workaround for #1125
|
# FIXME: this function is a workaround for #1125
|
||||||
# once fixed, it should be removed.
|
# once fixed, it should be removed.
|
||||||
|
# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk
|
||||||
use_custom_tcltk() {
|
use_custom_tcltk() {
|
||||||
local tcltk_ops="$1"
|
local tcltk_ops="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")"
|
||||||
|
|
||||||
|
if [[ -z "$tcltk_ops" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
local tcltk_ops_flag="--with-tcltk-libs="
|
local tcltk_ops_flag="--with-tcltk-libs="
|
||||||
# get tcltk libs
|
# get tcltk libs
|
||||||
local tcltk_libs="${tcltk_ops//$tcltk_ops_flag/}"
|
local tcltk_libs="${tcltk_ops//$tcltk_ops_flag/}"
|
||||||
@@ -1738,21 +1754,6 @@ get_tcltk_flag_from() {
|
|||||||
IFS="$OLDIFS"
|
IFS="$OLDIFS"
|
||||||
}
|
}
|
||||||
|
|
||||||
use_tcltk() {
|
|
||||||
if can_use_homebrew; then
|
|
||||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
|
||||||
fi
|
|
||||||
local tcl_tk_libs="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")"
|
|
||||||
|
|
||||||
# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk
|
|
||||||
# otherwise default to homebrew-installed tcl-tk, if installed
|
|
||||||
if [[ -n "$tcl_tk_libs" ]]; then
|
|
||||||
use_custom_tcltk "$tcl_tk_libs"
|
|
||||||
elif [ -d "$tcltk_libdir" ]; then
|
|
||||||
use_homebrew_tcltk
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Since 3.12, CPython can add DWARF debug information in MacOS
|
# Since 3.12, CPython can add DWARF debug information in MacOS
|
||||||
# using Apple's nonstandard way, `dsymutil', that creates a "dSYM bundle"
|
# using Apple's nonstandard way, `dsymutil', that creates a "dSYM bundle"
|
||||||
# that's supposed to be installed alongside executables
|
# that's supposed to be installed alongside executables
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
prefer_openssl3
|
prefer_openssl3
|
||||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
install_package "openssl-3.4.0" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.4.0.tar.gz#e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf" mac_openssl --if has_broken_mac_openssl
|
install_package "openssl-3.4.0" "https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz#e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf" 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.13.1" "https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz#9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9" standard verify_py313 copy_python_gdb ensurepip
|
install_package "Python-3.13.1" "https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz#9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9" standard verify_py313 copy_python_gdb ensurepip
|
||||||
|
|||||||
2
plugins/python-build/share/python-build/3.13.1t
Normal file
2
plugins/python-build/share/python-build/3.13.1t
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export PYTHON_BUILD_FREE_THREADING=1
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.1
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export PYTHON_BUILD_FREE_THREADING=1
|
|
||||||
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0a2
|
|
||||||
@@ -3,7 +3,7 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
|||||||
install_package "openssl-3.3.2" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz#2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" mac_openssl --if has_broken_mac_openssl
|
install_package "openssl-3.3.2" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz#2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" 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.14.0a2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a2.tar.xz#2ff9e10147342b3efd69f5cd9cc06ec46250f2a046587599d18e2cac69c05920" standard verify_py313 copy_python_gdb ensurepip
|
install_package "Python-3.14.0a3" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a3.tar.xz#94349df207456a575a8867c20b4ca434f870e1920dcdcc8fdf797e1af49abe90" standard verify_py313 copy_python_gdb ensurepip
|
||||||
else
|
else
|
||||||
install_package "Python-3.14.0a2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a2.tgz#b038eab7823e8a1c0500e3a26c95265656c2b8dd0bfa098aa341e9812be8f89c" standard verify_py313 copy_python_gdb ensurepip
|
install_package "Python-3.14.0a3" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a3.tgz#6ecc4203d8de18c7295c4cdd012e4a4acff83261f8a99bdf15318af9bb1cc811" standard verify_py313 copy_python_gdb ensurepip
|
||||||
fi
|
fi
|
||||||
2
plugins/python-build/share/python-build/3.14.0a3t
Normal file
2
plugins/python-build/share/python-build/3.14.0a3t
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export PYTHON_BUILD_FREE_THREADING=1
|
||||||
|
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0a3
|
||||||
@@ -30,12 +30,12 @@ cached_tarball() {
|
|||||||
tarball() {
|
tarball() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local path="$PWD/$name"
|
local path="$PWD/$name"
|
||||||
local configure="$path/configure"
|
local configure="$path/${2:-configure}"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
executable "$configure" <<OUT
|
executable "$configure" <<OUT
|
||||||
#!$BASH
|
#!$BASH
|
||||||
echo "$name: CPPFLAGS=\\"\$CPPFLAGS\\" LDFLAGS=\\"\$LDFLAGS\\" PKG_CONFIG_PATH=\\"\$PKG_CONFIG_PATH\\"" >> build.log
|
echo "$name: CFLAGS=\\"\$CFLAGS\\" CPPFLAGS=\\"\$CPPFLAGS\\" LDFLAGS=\\"\$LDFLAGS\\" PKG_CONFIG_PATH=\\"\$PKG_CONFIG_PATH\\"" >> build.log
|
||||||
echo "$name: \$@" \${PYTHONOPT:+PYTHONOPT=\$PYTHONOPT} >> build.log
|
echo "$name: \$@" \${PYTHONOPT:+PYTHONOPT=\$PYTHONOPT} >> build.log
|
||||||
OUT
|
OUT
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ OUT
|
|||||||
stub_make_install() {
|
stub_make_install() {
|
||||||
stub "$MAKE" \
|
stub "$MAKE" \
|
||||||
" : echo \"$MAKE \$@\" >> build.log" \
|
" : echo \"$MAKE \$@\" >> build.log" \
|
||||||
"install : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
"${1:-install} : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_build_log() {
|
assert_build_log() {
|
||||||
@@ -74,17 +74,60 @@ 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: CFLAGS="" 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "apply global and package-specific flags, package flags come later to have precedence" {
|
||||||
|
local yaml_configure="yaml_configure"
|
||||||
|
|
||||||
|
export YAML_CONFIGURE="./$yaml_configure"
|
||||||
|
export YAML_PREFIX_PATH=yaml_prefix_path
|
||||||
|
export YAML_CONFIGURE_OPTS="yaml_configure_opt1 yaml_configure_opt2"
|
||||||
|
export YAML_MAKE_OPTS="yaml_make_opt1 yaml_make_opt2"
|
||||||
|
export YAML_CFLAGS="yaml_cflag1 yaml_cflag2"
|
||||||
|
export YAML_CPPFLAGS="yaml_cppflag1 yaml_cppflag2"
|
||||||
|
export YAML_LDFLAGS="yaml_ldflag1 yaml_ldflag2"
|
||||||
|
export CONFIGURE_OPTS="configure_opt1 configure_opt2"
|
||||||
|
export MAKE_OPTS="make_opt1 make_opt2"
|
||||||
|
export MAKE_INSTALL_OPTS="make_install_opt1 make_install_opt2"
|
||||||
|
export PYTHON_MAKE_INSTALL_OPTS="python_make_install_opt1 python_make_install_opt2"
|
||||||
|
export PYTHON_MAKE_INSTALL_TARGET="python_make_install_target"
|
||||||
|
|
||||||
|
cached_tarball "yaml-0.1.6" "$yaml_configure"
|
||||||
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
|
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
||||||
|
stub brew false
|
||||||
|
stub_make_install
|
||||||
|
stub_make_install "$PYTHON_MAKE_INSTALL_TARGET"
|
||||||
|
|
||||||
|
|
||||||
|
install_fixture definitions/needs-yaml
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
unstub uname
|
||||||
|
unstub make
|
||||||
|
|
||||||
|
assert_build_log <<OUT
|
||||||
|
yaml-0.1.6: CFLAGS="yaml_cflag1 yaml_cflag2" CPPFLAGS="-I${TMP}/install/include yaml_cppflag1 yaml_cppflag2" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib yaml_ldflag1 yaml_ldflag2" PKG_CONFIG_PATH=""
|
||||||
|
yaml-0.1.6: --prefix=yaml_prefix_path configure_opt1 configure_opt2 yaml_configure_opt1 yaml_configure_opt2
|
||||||
|
make make_opt1 make_opt2 yaml_make_opt1 yaml_make_opt2
|
||||||
|
make install make_install_opt1 make_install_opt2
|
||||||
|
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib configure_opt1 configure_opt2
|
||||||
|
make make_opt1 make_opt2
|
||||||
|
make python_make_install_target make_install_opt1 make_install_opt2 python_make_install_opt1 python_make_install_opt2
|
||||||
|
OUT
|
||||||
|
}
|
||||||
|
|
||||||
@test "apply python patch before building" {
|
@test "apply python patch before building" {
|
||||||
cached_tarball "yaml-0.1.6"
|
cached_tarball "yaml-0.1.6"
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
@@ -103,12 +146,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: CFLAGS="" 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -133,12 +176,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: CFLAGS="" 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -166,7 +209,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 -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -182,7 +225,7 @@ OUT
|
|||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
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..5}; do stub brew false; done
|
for i in {1..6}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
install_fixture definitions/needs-yaml
|
install_fixture definitions/needs-yaml
|
||||||
@@ -194,7 +237,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 -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CFLAGS="" 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
|
||||||
@@ -208,7 +251,7 @@ OUT
|
|||||||
mkdir -p "$readline_libdir"
|
mkdir -p "$readline_libdir"
|
||||||
for i in {1..8}; 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..2}; do stub brew false; done
|
for i in {1..3}; do stub brew false; done
|
||||||
stub brew "--prefix readline : echo '$readline_libdir'"
|
stub brew "--prefix readline : echo '$readline_libdir'"
|
||||||
for i in {1..2}; do stub brew false; done
|
for i in {1..2}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -224,7 +267,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 -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CFLAGS="" 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
|
||||||
@@ -238,7 +281,7 @@ OUT
|
|||||||
mkdir -p "$ncurses_libdir"
|
mkdir -p "$ncurses_libdir"
|
||||||
for i in {1..9}; 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..3}; do stub brew false; done
|
for i in {1..4}; do stub brew false; done
|
||||||
stub brew "--prefix ncurses : echo '$ncurses_libdir'"
|
stub brew "--prefix ncurses : echo '$ncurses_libdir'"
|
||||||
stub brew false
|
stub brew false
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -254,7 +297,7 @@ DEF
|
|||||||
unstub make
|
unstub make
|
||||||
|
|
||||||
assert_build_log <<OUT
|
assert_build_log <<OUT
|
||||||
Python-3.6.2: CPPFLAGS="-I$ncurses_libdir/include -I${TMP}/install/include" LDFLAGS="-L$ncurses_libdir/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$ncurses_libdir/include -I${TMP}/install/include" LDFLAGS="-L$ncurses_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
|
||||||
@@ -286,7 +329,7 @@ DEF
|
|||||||
unstub sysctl
|
unstub sysctl
|
||||||
|
|
||||||
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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --with-openssl=/usr/local
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --with-openssl=/usr/local
|
||||||
make -j 1
|
make -j 1
|
||||||
make install
|
make install
|
||||||
@@ -321,7 +364,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: CFLAGS="" 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
|
||||||
@@ -349,7 +392,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -364,7 +407,7 @@ OUT
|
|||||||
|
|
||||||
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew "--prefix : echo '$BREW_PREFIX'"
|
stub brew "--prefix : echo '$BREW_PREFIX'"
|
||||||
for i in {1..4}; do stub brew false; done
|
for i in {1..5}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
export PYTHON_BUILD_USE_HOMEBREW=1
|
export PYTHON_BUILD_USE_HOMEBREW=1
|
||||||
|
|
||||||
@@ -378,7 +421,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 -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -394,7 +437,7 @@ OUT
|
|||||||
|
|
||||||
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
||||||
stub brew "--prefix : echo '$BREW_PREFIX'"
|
stub brew "--prefix : echo '$BREW_PREFIX'"
|
||||||
for i in {1..4}; do stub brew false; done
|
for i in {1..5}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
export PYTHON_BUILD_USE_HOMEBREW=1
|
export PYTHON_BUILD_USE_HOMEBREW=1
|
||||||
|
|
||||||
@@ -408,7 +451,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 -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -435,7 +478,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -453,7 +496,7 @@ OUT
|
|||||||
for i in {1..8}; 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..5}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib"
|
export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib"
|
||||||
@@ -468,7 +511,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib 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
|
||||||
@@ -482,11 +525,11 @@ 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
|
||||||
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'"; done
|
stub brew "--prefix tcl-tk@8 : echo '$tcl_tk_libdir'"
|
||||||
for i in {1..3}; do stub brew false; done
|
for i in {1..3}; do stub brew false; done
|
||||||
|
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -502,7 +545,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="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
Python-3.6.2: CFLAGS="" 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
|
||||||
@@ -516,10 +559,10 @@ 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..5}; do stub brew false; done
|
for i in {1..4}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
export PYTHON_CONFIGURE_OPTS="--with-tcltk-libs='-L${TMP}/custom-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version'"
|
export PYTHON_CONFIGURE_OPTS="--with-tcltk-libs='-L${TMP}/custom-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version'"
|
||||||
@@ -534,7 +577,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --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
|
||||||
@@ -544,14 +587,14 @@ 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"
|
||||||
mkdir -p "$tcl_tk_libdir/lib"
|
mkdir -p "$tcl_tk_libdir/lib"
|
||||||
|
|
||||||
stub brew false
|
stub brew false
|
||||||
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '${tcl_tk_libdir}'"; done
|
stub brew "--prefix tcl-tk@8 : echo '${tcl_tk_libdir}'"
|
||||||
for i in {1..3}; do stub brew false; done
|
for i in {1..3}; do stub brew false; done
|
||||||
|
|
||||||
stub_make_install
|
stub_make_install
|
||||||
@@ -568,7 +611,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="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
Python-3.6.2: CFLAGS="" 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
|
||||||
@@ -594,7 +637,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -622,7 +665,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 4
|
make -j 4
|
||||||
make install
|
make install
|
||||||
@@ -651,7 +694,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 1
|
make -j 1
|
||||||
make install
|
make install
|
||||||
@@ -675,41 +718,13 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
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"
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(PYTHON_)CONFIGURE_OPTS and (PYTHON_)MAKE_OPTS take priority over automatically added options" {
|
|
||||||
cached_tarball "Python-3.6.2"
|
|
||||||
|
|
||||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
|
||||||
|
|
||||||
stub_make_install
|
|
||||||
|
|
||||||
export CONFIGURE_OPTS="--custom-configure"
|
|
||||||
export PYTHON_CONFIGURE_OPTS='--custom-python-configure'
|
|
||||||
export MAKE_OPTS="${MAKE_OPTS:+$MAKE_OPTS }--custom-make"
|
|
||||||
export PYTHON_MAKE_OPTS="--custom-python-make"
|
|
||||||
export PYTHON_MAKE_INSTALL_OPTS="--custom-make-install"
|
|
||||||
run_inline_definition <<DEF
|
|
||||||
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
|
||||||
DEF
|
|
||||||
assert_success
|
|
||||||
|
|
||||||
unstub uname
|
|
||||||
unstub make
|
|
||||||
|
|
||||||
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: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --custom-configure --custom-python-configure
|
|
||||||
make -j 2 --custom-make --custom-python-make
|
|
||||||
make install --custom-make-install
|
|
||||||
OUT
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "--enable-shared is not added if --disable-shared is passed" {
|
@test "--enable-shared is not added if --disable-shared is passed" {
|
||||||
cached_tarball "Python-3.6.2"
|
cached_tarball "Python-3.6.2"
|
||||||
|
|
||||||
@@ -727,7 +742,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --disable-shared
|
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --disable-shared
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
@@ -739,7 +754,7 @@ OUT
|
|||||||
|
|
||||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||||
for i in {1..5}; do stub brew false; done
|
for i in {1..6}; do stub brew false; done
|
||||||
stub_make_install
|
stub_make_install
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
@@ -754,7 +769,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${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
|
||||||
@@ -777,7 +792,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${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
|
||||||
@@ -867,7 +882,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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
|
||||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||||
make -j 2
|
make -j 2
|
||||||
make install
|
make install
|
||||||
|
|||||||
@@ -16,16 +16,22 @@ create_executable() {
|
|||||||
|
|
||||||
@test "fails with invalid version" {
|
@test "fails with invalid version" {
|
||||||
export PYENV_VERSION="3.4"
|
export PYENV_VERSION="3.4"
|
||||||
run pyenv-exec python -V
|
run pyenv-exec nonexistent
|
||||||
assert_failure "pyenv: version \`3.4' is not installed (set by PYENV_VERSION environment variable)"
|
assert_failure <<EOF
|
||||||
|
pyenv: version \`3.4' is not installed (set by PYENV_VERSION environment variable)
|
||||||
|
pyenv: nonexistent: command not found
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "fails with invalid version set from file" {
|
@test "fails with invalid version set from file" {
|
||||||
mkdir -p "$PYENV_TEST_DIR"
|
mkdir -p "$PYENV_TEST_DIR"
|
||||||
cd "$PYENV_TEST_DIR"
|
cd "$PYENV_TEST_DIR"
|
||||||
echo 2.7 > .python-version
|
echo 2.7 > .python-version
|
||||||
run pyenv-exec rspec
|
run pyenv-exec nonexistent
|
||||||
assert_failure "pyenv: version \`2.7' is not installed (set by $PWD/.python-version)"
|
assert_failure <<EOF
|
||||||
|
pyenv: version \`2.7' is not installed (set by $PWD/.python-version)
|
||||||
|
pyenv: nonexistent: command not found
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "completes with names of executables" {
|
@test "completes with names of executables" {
|
||||||
|
|||||||
@@ -41,6 +41,18 @@ setup() {
|
|||||||
assert [ "$(cat .python-version)" = "1.2.3" ]
|
assert [ "$(cat .python-version)" = "1.2.3" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "fails to set a nonexistent local version" {
|
||||||
|
run pyenv-local 1.2.3
|
||||||
|
assert_failure "pyenv: version \`1.2.3' not installed"
|
||||||
|
assert [ ! -e .python-version ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "sets a nonexistent local version with --force" {
|
||||||
|
run pyenv-local -f 1.2.3
|
||||||
|
assert_success ""
|
||||||
|
assert [ "$(cat .python-version)" = "1.2.3" ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "changes local version" {
|
@test "changes local version" {
|
||||||
echo "1.0-pre" > .python-version
|
echo "1.0-pre" > .python-version
|
||||||
mkdir -p "${PYENV_ROOT}/versions/1.2.3"
|
mkdir -p "${PYENV_ROOT}/versions/1.2.3"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ setup() {
|
|||||||
|
|
||||||
@test "invocation without 2 arguments prints usage" {
|
@test "invocation without 2 arguments prints usage" {
|
||||||
run pyenv-version-file-write
|
run pyenv-version-file-write
|
||||||
assert_failure "Usage: pyenv version-file-write <file> <version>"
|
assert_failure "Usage: pyenv version-file-write [-f|--force] <file> <version> [...]"
|
||||||
run pyenv-version-file-write "one" ""
|
run pyenv-version-file-write "one" ""
|
||||||
assert_failure
|
assert_failure
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,13 @@ setup() {
|
|||||||
assert [ ! -e ".python-version" ]
|
assert [ ! -e ".python-version" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "setting nonexistent version succeeds with force" {
|
||||||
|
assert [ ! -e ".python-version" ]
|
||||||
|
run pyenv-version-file-write --force ".python-version" "2.7.6"
|
||||||
|
assert_success
|
||||||
|
assert [ -e ".python-version" ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "writes value to arbitrary file" {
|
@test "writes value to arbitrary file" {
|
||||||
mkdir -p "${PYENV_ROOT}/versions/2.7.6"
|
mkdir -p "${PYENV_ROOT}/versions/2.7.6"
|
||||||
assert [ ! -e "my-version" ]
|
assert [ ! -e "my-version" ]
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ SH
|
|||||||
assert_failure "pyenv: version \`1.2' is not installed (set by PYENV_VERSION environment variable)"
|
assert_failure "pyenv: version \`1.2' is not installed (set by PYENV_VERSION environment variable)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "missing version with --force" {
|
||||||
|
PYENV_VERSION=1.2 run pyenv-version-name -f
|
||||||
|
assert_success "1.2"
|
||||||
|
}
|
||||||
|
|
||||||
@test "one missing version (second missing)" {
|
@test "one missing version (second missing)" {
|
||||||
create_version "3.5.1"
|
create_version "3.5.1"
|
||||||
PYENV_VERSION="3.5.1:1.2" run pyenv-version-name
|
PYENV_VERSION="3.5.1:1.2" run pyenv-version-name
|
||||||
|
|||||||
@@ -71,7 +71,16 @@ create_executable() {
|
|||||||
@test "version not installed" {
|
@test "version not installed" {
|
||||||
create_executable "3.4" "py.test"
|
create_executable "3.4" "py.test"
|
||||||
PYENV_VERSION=3.3 run pyenv-which py.test
|
PYENV_VERSION=3.3 run pyenv-which py.test
|
||||||
assert_failure "pyenv: version \`3.3' is not installed (set by PYENV_VERSION environment variable)"
|
assert_failure <<OUT
|
||||||
|
pyenv: version \`3.3' is not installed (set by PYENV_VERSION environment variable)
|
||||||
|
pyenv: py.test: command not found
|
||||||
|
|
||||||
|
The \`py.test' command exists in these Python versions:
|
||||||
|
3.4
|
||||||
|
|
||||||
|
Note: See 'pyenv help global' for tips on allowing both
|
||||||
|
python2 and python3 to be found.
|
||||||
|
OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "versions not installed" {
|
@test "versions not installed" {
|
||||||
@@ -80,6 +89,13 @@ create_executable() {
|
|||||||
assert_failure <<OUT
|
assert_failure <<OUT
|
||||||
pyenv: version \`2.7' is not installed (set by PYENV_VERSION environment variable)
|
pyenv: version \`2.7' is not installed (set by PYENV_VERSION environment variable)
|
||||||
pyenv: version \`3.3' is not installed (set by PYENV_VERSION environment variable)
|
pyenv: version \`3.3' is not installed (set by PYENV_VERSION environment variable)
|
||||||
|
pyenv: py.test: command not found
|
||||||
|
|
||||||
|
The \`py.test' command exists in these Python versions:
|
||||||
|
3.4
|
||||||
|
|
||||||
|
Note: See 'pyenv help global' for tips on allowing both
|
||||||
|
python2 and python3 to be found.
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,6 +153,21 @@ SH
|
|||||||
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
|
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "tolerates nonexistent versions from pyenv-version-name" {
|
||||||
|
mkdir -p "$PYENV_ROOT"
|
||||||
|
cat > "${PYENV_ROOT}/version" <<EOF
|
||||||
|
2.7
|
||||||
|
3.4
|
||||||
|
EOF
|
||||||
|
create_executable "3.4" "python"
|
||||||
|
|
||||||
|
mkdir -p "$PYENV_TEST_DIR"
|
||||||
|
cd "$PYENV_TEST_DIR"
|
||||||
|
|
||||||
|
PYENV_VERSION= run pyenv-which python
|
||||||
|
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
|
||||||
|
}
|
||||||
|
|
||||||
@test "resolves pyenv-latest prefixes" {
|
@test "resolves pyenv-latest prefixes" {
|
||||||
create_executable "3.4.2" "python"
|
create_executable "3.4.2" "python"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user