Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pyenv for openSUSE:Factory checked in at 2024-12-19 21:41:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pyenv (Old) and /work/SRC/openSUSE:Factory/.pyenv.new.29675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pyenv" Thu Dec 19 21:41:29 2024 rev:54 rq:1232037 version:2.4.23 Changes: -------- --- /work/SRC/openSUSE:Factory/pyenv/pyenv.changes 2024-12-05 17:11:15.616174999 +0100 +++ /work/SRC/openSUSE:Factory/.pyenv.new.29675/pyenv.changes 2024-12-19 21:41:30.906881180 +0100 @@ -1,0 +2,27 @@ +Thu Dec 19 08:25:43 UTC 2024 - Thomas Schraitle <[email protected]> - 2.4.23 + +- Update 2.4.23 + * README: explain using multiple versions by @Finkregh in #3126 + * Support PACKAGE_CPPFLAGS and PACKAGE_LDFLAGS by @native-api in #3130 + * Adjust suggested shell startup code to support Pyenv with Pyenv-Win in WSL by @native-api in #3132 + * Support nonexistent versions being present and set in a local .python-version by @native-api in #3134 + * Add CPython 3.14.0a3 by @nedbat in #3135 + +------------------------------------------------------------------- +Sun Dec 8 08:50:38 UTC 2024 - Thomas Schraitle <[email protected]> - 2.4.22 + +- Update 2.4.22 + * Speed up building bundled OpenSSL by @native-api in #3124 + * CI: add building modified scripts with bundled MacOS dependencies by @native-api in #3123 + * CL: + test modified scripts with tar.gz source by @native-api in #3125 + * Fix 404 for openssl-3.4.0 release in build 3.13.1 by @dlamblin in #3122 + +------------------------------------------------------------------- +Sun Dec 8 08:50:00 UTC 2024 - Thomas Schraitle <[email protected]> - 2.4.21 + +- Update 2.4.21 + * Add CPython 3.13.1t by @makukha in #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 #3118 + +------------------------------------------------------------------- Old: ---- pyenv-2.4.20.tar.gz New: ---- pyenv-2.4.23.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pyenv.spec ++++++ --- /var/tmp/diff_new_pack.PqD1e4/_old 2024-12-19 21:41:31.634911355 +0100 +++ /var/tmp/diff_new_pack.PqD1e4/_new 2024-12-19 21:41:31.638911521 +0100 @@ -19,7 +19,7 @@ %define pyenv_dir %{_libexecdir}/pyenv # Name: pyenv -Version: 2.4.20 +Version: 2.4.23 Release: 0 Summary: Python Version Management License: MIT ++++++ pyenv-2.4.20.tar.gz -> pyenv-2.4.23.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/.github/workflows/modified_scripts_build.yml new/pyenv-2.4.23/.github/workflows/modified_scripts_build.yml --- old/pyenv-2.4.20/.github/workflows/modified_scripts_build.yml 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/.github/workflows/modified_scripts_build.yml 2024-12-18 08:13:13.000000000 +0100 @@ -82,6 +82,67 @@ pyenv global system 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 [email protected] 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: needs: discover_modified_scripts if: needs.discover_modified_scripts.outputs.versions != '[""]' @@ -101,6 +162,65 @@ - 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 + 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/.github/workflows/scripts/brew-uninstall-cascade.sh new/pyenv-2.4.23/.github/workflows/scripts/brew-uninstall-cascade.sh --- old/pyenv-2.4.20/.github/workflows/scripts/brew-uninstall-cascade.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/pyenv-2.4.23/.github/workflows/scripts/brew-uninstall-cascade.sh 2024-12-18 08:13:13.000000000 +0100 @@ -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[@]}" \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/CHANGELOG.md new/pyenv-2.4.23/CHANGELOG.md --- old/pyenv-2.4.20/CHANGELOG.md 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/CHANGELOG.md 2024-12-18 08:13:13.000000000 +0100 @@ -1,5 +1,22 @@ # 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 * 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/COMMANDS.md new/pyenv-2.4.23/COMMANDS.md --- old/pyenv-2.4.20/COMMANDS.md 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/COMMANDS.md 2024-12-18 08:13:13.000000000 +0100 @@ -91,6 +91,10 @@ 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` Sets the global version of Python to be used in all shells by writing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/README.md new/pyenv-2.4.23/README.md --- old/pyenv-2.4.20/README.md 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/README.md 2024-12-18 08:13:13.000000000 +0100 @@ -51,6 +51,7 @@ * [Install additional Python versions](#install-additional-python-versions) * [Prefix auto-resolution to the latest version](#prefix-auto-resolution-to-the-latest-version) * [Switch between Python versions](#switch-between-python-versions) + * [Making multiple versions available](#making-multiple-versions-available) * [Uninstall Python versions](#uninstall-python-versions) * [Other operations](#other-operations) * [Upgrading](#upgrading) @@ -189,7 +190,7 @@ ```bash 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 ``` 3. Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well. @@ -198,7 +199,7 @@ * to add to `~/.profile`: ``` bash 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 ``` * to add to `~/.bash_profile`: @@ -389,6 +390,20 @@ ---- +#### 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 As time goes on, you will accumulate Python versions in your diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/libexec/pyenv---version new/pyenv-2.4.23/libexec/pyenv---version --- old/pyenv-2.4.20/libexec/pyenv---version 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/libexec/pyenv---version 2024-12-18 08:13:13.000000000 +0100 @@ -12,7 +12,7 @@ set -e [ -n "$PYENV_DEBUG" ] && set -x -version="2.4.20" +version="2.4.23" git_revision="" if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/libexec/pyenv-exec new/pyenv-2.4.23/libexec/pyenv-exec --- old/pyenv-2.4.20/libexec/pyenv-exec 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/libexec/pyenv-exec 2024-12-18 08:13:13.000000000 +0100 @@ -21,7 +21,7 @@ exec pyenv-shims --short fi -PYENV_VERSION="$(pyenv-version-name)" +PYENV_VERSION="$(pyenv-version-name -f)" PYENV_COMMAND="$1" if [ -z "$PYENV_COMMAND" ]; then @@ -29,9 +29,9 @@ exit 1 fi -export PYENV_VERSION PYENV_COMMAND_PATH="$(pyenv-which "$PYENV_COMMAND")" PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}" +export PYENV_VERSION OLDIFS="$IFS" IFS=$'\n' scripts=(`pyenv-hooks exec`) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/libexec/pyenv-local new/pyenv-2.4.23/libexec/pyenv-local --- old/pyenv-2.4.20/libexec/pyenv-local 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/libexec/pyenv-local 2024-12-18 08:13:13.000000000 +0100 @@ -2,9 +2,11 @@ # # 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 # +# -f/--force Do not verify that the versions being set exist +# # Sets the local application-specific Python version(s) by writing the # version name to a file named `.python-version'. # @@ -36,12 +38,25 @@ exec pyenv-versions --bare fi +while [[ $# -gt 0 ]] +do + case "$1" in + -f|--force) + FORCE=1 + shift + ;; + *) + break + ;; + esac +done + versions=("$@") if [ "$versions" = "--unset" ]; then rm -f .python-version elif [ -n "$versions" ]; then - pyenv-version-file-write .python-version "${versions[@]}" + pyenv-version-file-write ${FORCE:+-f }.python-version "${versions[@]}" else if version_file="$(pyenv-version-file "$PWD")"; then IFS=: versions=($(pyenv-version-file-read "$version_file")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/libexec/pyenv-version-file-write new/pyenv-2.4.23/libexec/pyenv-version-file-write --- old/pyenv-2.4.20/libexec/pyenv-version-file-write 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/libexec/pyenv-version-file-write 2024-12-18 08:13:13.000000000 +0100 @@ -1,9 +1,25 @@ #!/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 [ -n "$PYENV_DEBUG" ] && set -x +while [[ $# -gt 0 ]] +do + case "$1" in + -f|--force) + FORCE=1 + shift + ;; + *) + break + ;; + esac +done + + PYENV_VERSION_FILE="$1" shift || true versions=("$@") @@ -14,7 +30,7 @@ fi # 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. # Create an empty file. Using "rm" might cause a permission error. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/libexec/pyenv-version-name new/pyenv-2.4.23/libexec/pyenv-version-name --- old/pyenv-2.4.20/libexec/pyenv-version-name 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/libexec/pyenv-version-name 2024-12-18 08:13:13.000000000 +0100 @@ -1,8 +1,25 @@ #!/usr/bin/env bash # 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 [ -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 PYENV_VERSION_FILE="$(pyenv-version-file)" PYENV_VERSION="$(pyenv-version-file-read "$PYENV_VERSION_FILE" || true)" @@ -33,16 +50,20 @@ # Remove the explicit 'python-' prefix from versions like 'python-3.12'. normalised_version="${version#python-}" if version_exists "${version}" || [ "$version" = "system" ]; then - versions=("${versions[@]}" "${version}") + versions+=("${version}") elif version_exists "${normalised_version}"; then - versions=("${versions[@]}" "${normalised_version}") + versions+=("${normalised_version}") elif resolved_version="$(pyenv-latest -b "${version}")"; then - versions=("${versions[@]}" "${resolved_version}") + versions+=("${resolved_version}") elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then - versions=("${versions[@]}" "${resolved_version}") + versions+=("${resolved_version}") else - echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2 - any_not_installed=1 + if [[ -n $FORCE ]]; then + versions+=("${normalised_version}") + else + echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2 + any_not_installed=1 + fi fi done } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/libexec/pyenv-which new/pyenv-2.4.23/libexec/pyenv-which --- old/pyenv-2.4.20/libexec/pyenv-which 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/libexec/pyenv-which 2024-12-18 08:13:13.000000000 +0100 @@ -59,7 +59,7 @@ fi OLDIFS="$IFS" -IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name)}) +IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name -f)}) IFS="$OLDIFS" declare -a nonexistent_versions @@ -96,7 +96,6 @@ for version in "${nonexistent_versions[@]}"; do echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2 done - exit 1 fi echo "pyenv: $PYENV_COMMAND: command not found" >&2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/README.md new/pyenv-2.4.23/plugins/python-build/README.md --- old/pyenv-2.4.20/plugins/python-build/README.md 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/README.md 2024-12-18 08:13:13.000000000 +0100 @@ -169,16 +169,14 @@ * `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get additionally searched when looking up build definitions. * `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`. * `MAKE` lets you override the command to use for `make`. Useful for specifying GNU make (`gmake`) on some systems. * `MAKE_OPTS` (or `MAKEOPTS`) lets you pass additional options to `make`. * `MAKE_INSTALL_OPTS` lets you pass additional options to `make install`. -* `PYTHON_CONFIGURE_OPTS` and `PYTHON_MAKE_OPTS` and `PYTHON_MAKE_INSTALL_OPTS` allow - you to specify configure and make options for building CPython. These variables - will be passed to Python only, not any dependent packages (e.g. libyaml). +* `<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. +* `<PACKAGE>_CONFIGURE_OPTS`, `<PACKAGE>_MAKE_OPTS`, `<PACKAGE>_MAKE_INSTALL_OPTS`, `<PACKAGE>_MAKE_INSTALL_TARGET` allow + 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/bin/python-build new/pyenv-2.4.23/plugins/python-build/bin/python-build --- old/pyenv-2.4.20/plugins/python-build/bin/python-build 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/bin/python-build 2024-12-18 08:13:13.000000000 +0100 @@ -558,7 +558,7 @@ } 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() { @@ -811,10 +811,12 @@ local PACKAGE_MAKE_OPTS="${package_var_name}_MAKE_OPTS" local PACKAGE_MAKE_OPTS_ARRAY="${package_var_name}_MAKE_OPTS_ARRAY[@]" 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 use_homebrew || true - use_tcltk || true + use_custom_tcltk || use_homebrew_tcltk || true use_homebrew_readline || use_freebsd_pkg || true use_homebrew_ncurses || true if is_mac -ge 1014; then @@ -826,8 +828,14 @@ use_free_threading || true fi - ( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then - export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}" + ( if [[ -n "${!PACKAGE_CFLAGS}" ]]; then + 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 if [ -z "$CC" ] && is_mac -ge 1010; then export CC=clang @@ -1594,11 +1602,7 @@ [[ "$1" != openssl-1.0.* ]] || nokerberos=1 # Compile a shared lib with zlib dynamically linked. - package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5} - - # 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 + package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5} no-docs no-apps no-tests build_package_standard "$@" @@ -1671,31 +1675,43 @@ use_homebrew_tcltk() { can_use_homebrew || return 1 - # get the version from the folder that homebrew versions - local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)" - if [ -d "$tcltk_libdir" ]; then - echo "python-build: use tcl-tk from homebrew" - if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then - local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')" - package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version" - # In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir. - # We're not using tclConfig.sh here 'cuz it produces the version-specific path to <brew prefix>/Cellar - # and we'd rather have rpath set to <brew prefix>/opt/<...> to allow micro release upgrades without rebuilding - # XXX: do use tclConfig.sh and translate the paths if more path shenanigans appear in later releases - if [ -d "$tcltk_libdir/include/tcl-tk" ]; then - package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include/tcl-tk" - else - package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include" + # Since https://github.com/Homebrew/homebrew-core/commit/f10e88617b41555193c22fdcba6109fe82155ee2 (10.11.2024), + # 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 + echo "python-build: use tcl-tk from homebrew" + if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then + local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')" + package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version" + # In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir. + # We're not using tclConfig.sh here 'cuz it produces the version-specific path to <brew prefix>/Cellar + # and we'd rather have rpath set to <brew prefix>/opt/<...> to allow micro release upgrades without rebuilding + # XXX: do use tclConfig.sh and translate the paths if more path shenanigans appear in later releases + if [ -d "$tcltk_libdir/include/tcl-tk" ]; then + package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include/tcl-tk" + else + package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include" + fi fi + export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + return 0 fi - export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" - fi + done + return 1 } # FIXME: this function is a workaround for #1125 # once fixed, it should be removed. +# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk 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=" # get tcltk libs local tcltk_libs="${tcltk_ops//$tcltk_ops_flag/}" @@ -1738,21 +1754,6 @@ 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 # using Apple's nonstandard way, `dsymutil', that creates a "dSYM bundle" # that's supposed to be installed alongside executables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/share/python-build/3.13.1 new/pyenv-2.4.23/plugins/python-build/share/python-build/3.13.1 --- old/pyenv-2.4.20/plugins/python-build/share/python-build/3.13.1 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/share/python-build/3.13.1 2024-12-18 08:13:13.000000000 +0100 @@ -1,6 +1,6 @@ prefer_openssl3 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 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/share/python-build/3.13.1t new/pyenv-2.4.23/plugins/python-build/share/python-build/3.13.1t --- old/pyenv-2.4.20/plugins/python-build/share/python-build/3.13.1t 1970-01-01 01:00:00.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/share/python-build/3.13.1t 2024-12-18 08:13:13.000000000 +0100 @@ -0,0 +1,2 @@ +export PYTHON_BUILD_FREE_THREADING=1 +source "$(dirname "${BASH_SOURCE[0]}")"/3.13.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a2 new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a2 --- old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a2 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a2 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -prefer_openssl3 -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 "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline -if has_tar_xz_support; then - install_package "Python-3.14.0a2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a2.tar.xz#2ff9e10147342b3efd69f5cd9cc06ec46250f2a046587599d18e2cac69c05920" standard verify_py313 copy_python_gdb ensurepip -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 -fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a2t new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a2t --- old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a2t 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a2t 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -export PYTHON_BUILD_FREE_THREADING=1 -source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0a2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a3 new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a3 --- old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a3 1970-01-01 01:00:00.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a3 2024-12-18 08:13:13.000000000 +0100 @@ -0,0 +1,9 @@ +prefer_openssl3 +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 "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline +if has_tar_xz_support; then + install_package "Python-3.14.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 + 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a3t new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a3t --- old/pyenv-2.4.20/plugins/python-build/share/python-build/3.14.0a3t 1970-01-01 01:00:00.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/share/python-build/3.14.0a3t 2024-12-18 08:13:13.000000000 +0100 @@ -0,0 +1,2 @@ +export PYTHON_BUILD_FREE_THREADING=1 +source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0a3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/plugins/python-build/test/build.bats new/pyenv-2.4.23/plugins/python-build/test/build.bats --- old/pyenv-2.4.20/plugins/python-build/test/build.bats 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/plugins/python-build/test/build.bats 2024-12-18 08:13:13.000000000 +0100 @@ -30,12 +30,12 @@ tarball() { local name="$1" local path="$PWD/$name" - local configure="$path/configure" + local configure="$path/${2:-configure}" shift 1 executable "$configure" <<OUT #!$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 OUT @@ -50,7 +50,7 @@ stub_make_install() { stub "$MAKE" \ " : 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() { @@ -74,17 +74,60 @@ unstub make 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 make -j 2 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 make -j 2 make install 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" { cached_tarball "yaml-0.1.6" cached_tarball "Python-3.6.2" @@ -103,12 +146,12 @@ unstub patch 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 make -j 2 make install 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 make -j 2 make install @@ -133,12 +176,12 @@ unstub patch 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 make -j 2 make install 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 make -j 2 make install @@ -166,7 +209,7 @@ unstub make 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 make -j 2 make install @@ -182,7 +225,7 @@ for i in {1..10}; do stub uname '-s : echo Darwin'; done for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done stub 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 install_fixture definitions/needs-yaml @@ -194,7 +237,7 @@ unstub make 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 make -j 2 make install @@ -208,7 +251,7 @@ mkdir -p "$readline_libdir" for i in {1..8}; do stub uname '-s : echo Darwin'; done for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done - for i in {1..2}; do stub brew false; done + for i in {1..3}; do stub brew false; done stub brew "--prefix readline : echo '$readline_libdir'" for i in {1..2}; do stub brew false; done stub_make_install @@ -224,7 +267,7 @@ unstub make 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 make -j 2 make install @@ -238,7 +281,7 @@ mkdir -p "$ncurses_libdir" for i in {1..9}; do stub uname '-s : echo Darwin'; done for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done - for i in {1..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 false stub_make_install @@ -254,7 +297,7 @@ unstub make 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 make -j 2 make install @@ -286,7 +329,7 @@ unstub sysctl 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 make -j 1 make install @@ -321,7 +364,7 @@ unstub sysctl 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 make -j 1 make install @@ -349,7 +392,7 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="" Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib make -j 2 make install @@ -364,7 +407,7 @@ for i in {1..4}; do stub uname '-s : echo Linux'; done 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 export PYTHON_BUILD_USE_HOMEBREW=1 @@ -378,7 +421,7 @@ unstub make 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 make -j 2 make install @@ -394,7 +437,7 @@ for i in {1..4}; do stub uname '-s : echo Linux'; done 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 export PYTHON_BUILD_USE_HOMEBREW=1 @@ -408,7 +451,7 @@ unstub make 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 make -j 2 make install @@ -435,7 +478,7 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="" Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib make -j 2 make install @@ -453,7 +496,7 @@ 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..4}; do stub brew false; done + for i in {1..5}; do stub brew false; done stub_make_install export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib" @@ -468,7 +511,7 @@ 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: 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 make -j 2 make install @@ -482,11 +525,11 @@ mkdir -p "$tcl_tk_libdir/lib" 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 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 stub_make_install @@ -502,7 +545,7 @@ 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="${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 make -j 2 make install @@ -516,10 +559,10 @@ tcl_tk_version_long="8.6.10" 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..5}; do stub brew false; done + for i in {1..4}; do stub brew false; done stub_make_install 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 @@ 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: 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 make -j 2 make install @@ -544,14 +587,14 @@ @test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" { 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 tcl_tk_libdir="$TMP/homebrew-tcl-tk" mkdir -p "$tcl_tk_libdir/lib" 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 stub_make_install @@ -568,7 +611,7 @@ 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="${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 make -j 2 make install @@ -594,7 +637,7 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="" Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib make -j 2 make install @@ -622,7 +665,7 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="" Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib make -j 4 make install @@ -651,7 +694,7 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="" Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib make -j 1 make install @@ -675,41 +718,13 @@ 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: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="" Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib make -j 2 make install DOGE="such wow" 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" { cached_tarball "Python-3.6.2" @@ -727,7 +742,7 @@ unstub make 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 make -j 2 make install @@ -739,7 +754,7 @@ 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..5}; do stub brew false; done + for i in {1..6}; do stub brew false; done stub_make_install run_inline_definition <<DEF @@ -754,7 +769,7 @@ 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: 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 make -j 2 make install @@ -777,7 +792,7 @@ 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: 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 make -j 2 make install @@ -867,7 +882,7 @@ assert_build_log <<OUT 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 make -j 2 make install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/test/exec.bats new/pyenv-2.4.23/test/exec.bats --- old/pyenv-2.4.20/test/exec.bats 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/test/exec.bats 2024-12-18 08:13:13.000000000 +0100 @@ -16,16 +16,22 @@ @test "fails with invalid version" { export PYENV_VERSION="3.4" - run pyenv-exec python -V - assert_failure "pyenv: version \`3.4' is not installed (set by PYENV_VERSION environment variable)" + run pyenv-exec nonexistent + 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" { mkdir -p "$PYENV_TEST_DIR" cd "$PYENV_TEST_DIR" echo 2.7 > .python-version - run pyenv-exec rspec - assert_failure "pyenv: version \`2.7' is not installed (set by $PWD/.python-version)" + run pyenv-exec nonexistent + 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" { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/test/local.bats new/pyenv-2.4.23/test/local.bats --- old/pyenv-2.4.20/test/local.bats 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/test/local.bats 2024-12-18 08:13:13.000000000 +0100 @@ -41,6 +41,18 @@ 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" { echo "1.0-pre" > .python-version mkdir -p "${PYENV_ROOT}/versions/1.2.3" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/test/version-file-write.bats new/pyenv-2.4.23/test/version-file-write.bats --- old/pyenv-2.4.20/test/version-file-write.bats 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/test/version-file-write.bats 2024-12-18 08:13:13.000000000 +0100 @@ -9,7 +9,7 @@ @test "invocation without 2 arguments prints usage" { 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" "" assert_failure } @@ -21,6 +21,13 @@ 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" { mkdir -p "${PYENV_ROOT}/versions/2.7.6" assert [ ! -e "my-version" ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/test/version-name.bats new/pyenv-2.4.23/test/version-name.bats --- old/pyenv-2.4.20/test/version-name.bats 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/test/version-name.bats 2024-12-18 08:13:13.000000000 +0100 @@ -73,6 +73,11 @@ 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)" { create_version "3.5.1" PYENV_VERSION="3.5.1:1.2" run pyenv-version-name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyenv-2.4.20/test/which.bats new/pyenv-2.4.23/test/which.bats --- old/pyenv-2.4.20/test/which.bats 2024-12-04 00:08:51.000000000 +0100 +++ new/pyenv-2.4.23/test/which.bats 2024-12-18 08:13:13.000000000 +0100 @@ -71,7 +71,16 @@ @test "version not installed" { create_executable "3.4" "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" { @@ -80,6 +89,13 @@ assert_failure <<OUT 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: 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 } @@ -131,6 +147,21 @@ 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 "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
