1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-08 11:33:49 -05:00

Compare commits

...

62 Commits

Author SHA1 Message Date
Josh Friend
3faba7d47c v1.2.4 2018-05-01 13:51:00 -04:00
Josh Friend
3f8ea04cc2 Add pypy-portable 6.0.0
closes #1154
2018-05-01 13:45:59 -04:00
Josh Friend
f7a3ffd2d8 CPython 2.7.15 2018-05-01 01:14:42 -04:00
Yamashita, Yuu
df0437f111 Merge pull request #1145 from pyenv/rehash-wait
Wait rehash until lock acquisition
2018-05-01 09:37:03 +09:00
Yamashita, Yuu
d6ba379e08 Merge pull request #1146 from pyenv/http-client-based-on-envvar
Allow overriding HTTP client type based on environment variable
2018-05-01 09:34:24 +09:00
Josh Friend
47436606b5 Add pypy 6.0.0 2018-04-27 18:16:14 -04:00
Yamashita, Yuu
b3ba0fd7e3 Refactor test code of python-build. Use curl during tests by default 2018-04-26 02:06:57 +00:00
Yamashita, Yuu
750c63c643 Merge pull request #1151 from pyenv/ruby-build-20180424
Import latest changes from https://github.com/rbenv/ruby-build as of v20180424
2018-04-26 10:31:38 +09:00
Yamashita, Yuu
c8ad3385c7 Import latest changes from https://github.com/rbenv/ruby-build as of v20180424 2018-04-26 00:56:08 +00:00
Yamashita, Yuu
11067155f4 Merge pull request #1147 from zbentley/fix_bundle_loader_for_new_osx
Address #273 via a patch from python#21811
2018-04-25 10:11:54 +09:00
Zac Bentley
18df84f535 Address #273 via a patch from python#21811 2018-04-24 13:14:18 -04:00
Yamashita, Yuu
098fb9f07a Rewrite python-build tests with using PYTHON_BUILD_HTTP_CLIENT 2018-04-24 05:22:32 +00:00
Yamashita, Yuu
fc90785f75 Allow overriding HTTP client type based on environment variable PYTHON_BUILD_HTTP_CLIENT (#1126) 2018-04-24 02:33:43 +00:00
Yamashita, Yuu
1ec57a0c68 Add basic test for rehash wait 2018-04-24 00:42:47 +00:00
Yamashita, Yuu
7973e59473 Fix rehash test to give up sooner after lock file's presence 2018-04-24 00:38:01 +00:00
Yamashita, Yuu
b1e3f13a85 Renamed variable; s/PYENV_REHASH_LOCK_TIMEOUT/PYENV_REHASH_TIMEOUT/ 2018-04-24 00:35:55 +00:00
Yamashita, Yuu
a6c15fb242 Experimental implementation to wait rehash until acquiring lock
For now the code is using traditional pseudo locking mechanism
based on `noclobber`.
2018-04-19 01:02:16 +00:00
Yamashita, Yuu
63c4b7f45c Merge pull request #1140 from fschulze/2.7.15rc1
Add Python 2.7.15rc1.
2018-04-15 19:51:09 +09:00
Florian Schulze
20e4f53aac Add Python 2.7.15rc1. 2018-04-15 12:40:30 +02:00
Yamashita, Yuu
35f7ef8708 Merge pull request #1133 from pyenv/rbenv-20180402
Import changes from rbenv as of 20180402
2018-04-05 16:47:20 +09:00
Yamashita, Yuu
83429344ea Rewrite some tests for pyenv which was recently imported from rbenv 2018-04-02 01:52:42 +00:00
Yamashita, Yuu
83f97ef2b3 Merge remote-tracking branch 'rbenv/master' into rbenv-20180402 2018-04-02 01:46:48 +00:00
Josh Friend
b960f863cc CPython 3.7.0b2 -> b3 2018-03-30 15:04:29 -04:00
Yamashita, Yuu
a41d7561d0 Merge pull request #1131 from pyenv/workaround-get-pip-url-py26-py32
Use custom get-pip URL based on the target version
2018-03-29 12:19:46 +09:00
Yamashita, Yuu
980b03b582 Update warning message on presence of PIP_VERSION 2018-03-29 03:16:53 +00:00
Yamashita, Yuu
f3aba64a84 Merge pull request #1132 from pyenv/fix-typo-in-pr-template
Fixed a typo in PR template
2018-03-29 10:18:07 +09:00
Yamashita, Yuu
fc33f674b4 s/Generaly/Generally/ 😞 2018-03-29 01:14:19 +00:00
Yamashita, Yuu
f5663f084a Show some warning on the use of PIP_VERSION 2018-03-29 00:58:17 +00:00
Yamashita, Yuu
a1d39c1e25 Add test for custom GET_PIP_URL per versions 2018-03-29 00:58:06 +00:00
Yamashita, Yuu
90dfb261e2 Use custom get-pip URL based on the target version (#1127) 2018-03-29 00:38:16 +00:00
Joe Siewert
367c6765ab Modify changelog to indicate CPython 3.6.5 (#1130) 2018-03-28 20:15:40 -04:00
Mislav Marohnić
c8ba27fd07 Merge pull request #1069 from viclim/fix-issue-1065
Ignore empty `.ruby-version` files
2018-02-26 10:53:46 +01:00
Victor Lim
9daf81f16e Fix https://github.com/rbenv/rbenv/issues/1065
Command `rbenv version-name > .ruby-version` will create an empty `.ruby-version` file
before running `rbenv-version-file`. This causes `rbenv-version-file` to return empty
string which in turn causes `rbenv-version-name` to return `system`.

Ensure size of `.ruby-version` is non-zero as a workaround.
2018-02-26 16:49:37 +08:00
Mislav Marohnić
b943955dbf Merge pull request #981 from mhinz/shell-descriptive-error
Better error message for `rbenv shell`
2017-12-07 05:00:44 +01:00
Marco Hinz
643023d98f Add tests for shell integration 2017-12-07 02:32:35 +01:00
Marco Hinz
af53c790cc Better error message for rbenv shell
Shell integration is not enabled by default. This means that, from all the
commands from `rbenv commands`, only "shell" won't work right away.

Replace "no such command" with a more descriptive message that points to
`rbenv init` instead.
2017-12-07 02:32:34 +01:00
Mislav Marohnić
6aa70b6541 Merge pull request #1013 from blueyed/shellcheck
Fix some issues reported by shellcheck
2017-11-30 11:43:18 +01:00
Daniel Hahler
5f8a4c4d62 Fix some issues reported by shellcheck 2017-11-29 16:20:51 +01:00
Mislav Marohnić
eda952ab08 Merge branch 'cdpath-enable' 2017-11-29 15:53:41 +01:00
Mislav Marohnić
b80ea43e25 Quote directory name in variable assignment 2017-11-29 15:51:03 +01:00
Mislav Marohnić
c310bc5f83 Merge pull request #968 from maxnordlund/patch-1
Fix fish subcommand completion
2017-11-29 15:47:19 +01:00
Mislav Marohnić
eab68688dc Merge pull request #959 from zenspider/fix-dash-u
Fixed `rbenv init -` output to work w/ no args and bash's `set -u`.
2017-11-29 15:40:23 +01:00
Mislav Marohnić
5183e32887 Merge pull request #982 from MartinNowak/issue759
partly resolve #759
2017-11-29 15:37:22 +01:00
Mislav Marohnić
e2f469a7cd Merge pull request #1002 from blueyed/fix-which-tests-PATH
test/which.bats: do not export PATH
2017-11-29 15:25:03 +01:00
Mislav Marohnić
33a5c2495d Merge pull request #1003 from blueyed/version-file-skip-dirs
rbenv-version-file: ensure that the version file is a file
2017-11-29 15:23:58 +01:00
Mislav Marohnić
66b9f6fb2b Merge pull request #1024 from andyone/master
Fixed support for commas for all environment variables in configure script
2017-11-29 15:20:00 +01:00
Daniel Hahler
a9ca72ab8e test/which.bats: do not export PATH
Otherwise `sed` might not be found later in bats/libexec/bats-exec-test,
in case `/usr/bin` gets removed.
2017-11-20 04:22:05 +01:00
Ryan Davis
1a8b5e04a9 Fixed rbenv init - output to work w/ no args and bash's set -u. 2017-11-06 13:59:04 -08:00
Mislav Marohnić
2d7cefe782 Merge pull request #1034 from MinhThienDX/master
Fix URL fragment target
2017-09-04 18:57:27 +02:00
MinhThienDX
650c9d3452 Fix URL fragment target 2017-09-04 23:51:22 +07:00
Jeremy Daer
4ebd1bd12c Merge pull request #1009 from jeremy/homebrew-install-clarification
Clarify Homebrew/git install guidance
2017-08-23 14:47:56 -10:00
Anton Novojilov
dbaa8c83b6 Fixed support of build env vars for dynamic bash extension configure script 2017-08-07 13:12:37 +02:00
Mislav Marohnić
615f8443fe Merge pull request #1011 from kenaniah/patch-1
Properly escapes commas in c flags
2017-06-25 02:48:23 +02:00
Kenaniah Cerny
fc706daf60 properly escapes commas in cflags 2017-06-18 20:57:52 -07:00
Mislav Marohnić
6cd487db81 rbenv 1.1.1 2017-06-15 16:55:33 +02:00
Jeremy Daer
e3e99cc906 Clarify Homebrew/git install guidance
* Move Homebrew to the top, common case for new devs
* Note that `brew install rbenv` includes ruby-build by default
* Be clear that `rbenv init` instructions are needed for shell setup
* Be explicit about starting a new shell to pick up PATH/init changes
* Use rbenv-doctor to conclusively demonstrate correct setup
* Separate upgrade instructions for Homebrew vs Git installs

Related: https://github.com/rbenv/ruby-build/pull/1106
2017-06-14 09:02:50 -07:00
Daniel Hahler
95b1b05cbe rbenv-version-file: ensure that the version file is a file
Forwarded from https://github.com/pyenv/pyenv/pull/606.
2017-06-05 15:40:59 +02:00
Tim Pope
9d93605e18 Don't unset CDPATH 2017-04-05 17:39:39 -04:00
Tim Pope
1f1e291385 Enforce absolute RBENV_DIR
This prevents CDPATH from becoming an issue.

Closes #866.
2017-04-05 16:54:03 -04:00
Martin Nowak
db39044ef6 partly resolve #759
- some versions of bash (e.g. 4.3.11) complain about clobbering
  /dev/null, use bash's explicit >| operator to ignore noclober
- not sure if the original #759 report has the same cause
- https://github.com/rbenv/rbenv/issues/759#issuecomment-289326891
2017-03-27 02:06:13 +02:00
Max Nordlund
fab5cf912f Fix pyenv -> rbenv typo 2017-02-10 09:31:13 +01:00
Max Nordlund
9f52b56aa8 Fix fish subcommand completion
This allows subcommand style plugins to properly autocomplete.
Existing commands are not affected. 

Example, say you have support for `rbenv foo bar --flag`, then
this allows the last `--flag` argument to be properly completed.
2017-02-10 09:12:30 +01:00
31 changed files with 409 additions and 115 deletions

View File

@@ -5,7 +5,7 @@ Make sure you have checked all steps below.
* pyenv has some powerful support for plugins and hook scripts. Please refer to [Authoring plugins](https://github.com/pyenv/pyenv/wiki/Authoring-plugins) for details and try to implement it as a plugin if possible.
* [ ] Please consider contributing the patch upstream to [rbenv](https://github.com/rbenv/rbenv), since we have borrowed most of the code from this project.
* We are occasionally importing the changes from rbenv. In general, you can expect some changes made in rbenv will be imported to pyenv too, eventually.
* Generaly speaking, we sometimes don't prefer to make some change in the core to keep compatibility with rbenv.
* Generally speaking, we sometimes don't prefer to make some change in the core to keep compatibility with rbenv.
* [ ] My PR addresses the following pyenv issue (if any)
- https://github.com/pyenv/pyenv/issues/XXXX

View File

@@ -1,8 +1,17 @@
## Version History
## 1.2.4
* python-build: Add CPython 2.7.15
* python-build: Add PyPy 6.0.0
* python-build: Allow overriding HTTP client type based on environment variable `PYTHON_BUILD_HTTP_CLIENT` (#1126)
* python-build: Use version-specific `get-pip.py` when installing 2.6 and 3.2 (#1131)
* pyenv: Merge rbenv master (#1151)
* pyenv: Make `pyenv-rehash` safer for multiple processes (#1092)
## 1.2.3
* python-build: Add CPython 3.5.6
* python-build: Add CPython 3.6.5
* python-build: Set openssl PKG_CONFIG_PATH for python 3.7 (#1117)
* python-build: Add ActivePython versions 2.7.14, 3.5.4, 3.6.0 (#1113)
* python-build: Unset `PIP_VERSION` before invoking `get-pip.py` as a workaround for `invalid truth value` error (#1124)

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -e
unset CDPATH
if [ "$1" = "--debug" ]; then
export PYENV_DEBUG=1
@@ -22,7 +21,8 @@ abort() {
if enable -f "${BASH_SOURCE%/*}"/../libexec/pyenv-realpath.dylib realpath 2>/dev/null; then
abs_dirname() {
local path="$(realpath "$1")"
local path
path="$(realpath "$1")"
echo "${path%/*}"
}
else
@@ -69,6 +69,11 @@ if [ -z "${PYENV_DIR}" ]; then
export PYENV_DIR
unset PYENV_FILE_ARG
fi
else
[[ $PYENV_DIR == /* ]] || PYENV_DIR="$PWD/$PYENV_DIR"
cd "$PYENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$PYENV_DIR'"
PYENV_DIR="$PWD"
cd "$OLDPWD"
fi
if [ -z "${PYENV_DIR}" ]; then
@@ -121,7 +126,13 @@ case "$command" in
;;
* )
command_path="$(command -v "pyenv-$command" || true)"
[ -n "$command_path" ] || abort "no such command \`$command'"
if [ -z "$command_path" ]; then
if [ "$command" == "shell" ]; then
abort "shell integration not enabled. Run \`pyenv init' for instructions."
else
abort "no such command \`$command'"
fi
fi
shift 1
if [ "$1" = --help ]; then

View File

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

View File

@@ -28,15 +28,15 @@ shopt -s nullglob
for command in "${path}/pyenv-"*; do
command="${command##*pyenv-}"
if [ -n "$sh" ]; then
if [ ${command:0:3} = "sh-" ]; then
echo ${command##sh-}
if [ "${command:0:3}" = "sh-" ]; then
echo "${command##sh-}"
fi
elif [ -n "$nosh" ]; then
if [ ${command:0:3} != "sh-" ]; then
echo ${command##sh-}
if [ "${command:0:3}" != "sh-" ]; then
echo "${command##sh-}"
fi
else
echo ${command##sh-}
echo "${command##sh-}"
fi
done
done

View File

@@ -42,6 +42,7 @@ extract_initial_comment_block() {
}
collect_documentation() {
# shellcheck disable=SC2016
$(type -p gawk awk | head -1) '
/^Summary:/ {
summary = substr($0, 10)
@@ -86,7 +87,8 @@ collect_documentation() {
}
documentation_for() {
local filename="$(command_path "$1")"
local filename
filename="$(command_path "$1")"
if [ -n "$filename" ]; then
extract_initial_comment_block < "$filename" | collect_documentation
fi
@@ -114,7 +116,7 @@ print_help() {
eval "$(documentation_for "$command")"
[ -n "$help" ] || help="$summary"
if [ -n "$usage" -o -n "$summary" ]; then
if [ -n "$usage" ] || [ -n "$summary" ]; then
if [ -n "$usage" ]; then
echo "$usage"
else

View File

@@ -138,7 +138,7 @@ esac
if [ "$shell" != "fish" ]; then
IFS="|"
cat <<EOS
command="\$1"
command="\${1:-}"
if [ "\$#" -gt 0 ]; then
shift
fi

View File

@@ -10,30 +10,51 @@ PROTOTYPE_SHIM_PATH="${SHIM_PATH}/.pyenv-shim"
# Create the shims directory if it doesn't already exist.
mkdir -p "$SHIM_PATH"
# Ensure only one instance of pyenv-rehash is running at a time by
# setting the shell's `noclobber` option and attempting to write to
# the prototype shim file. If the file already exists, print a warning
# to stderr and exit with a non-zero status.
set -o noclobber
{ echo > "$PROTOTYPE_SHIM_PATH"
} 2>/dev/null ||
{ if [ -w "$SHIM_PATH" ]; then
echo "pyenv: cannot rehash: $PROTOTYPE_SHIM_PATH exists"
else
echo "pyenv: cannot rehash: $SHIM_PATH isn't writable"
fi
exit 1
} >&2
set +o noclobber
acquire_lock() {
# Ensure only one instance of pyenv-rehash is running at a time by
# setting the shell's `noclobber` option and attempting to write to
# the prototype shim file. If the file already exists, print a warning
# to stderr and exit with a non-zero status.
local ret
set -o noclobber
echo > "$PROTOTYPE_SHIM_PATH" 2>| /dev/null || ret=1
set +o noclobber
[ -z "${ret}" ]
}
# If we were able to obtain a lock, register a trap to clean up the
# prototype shim when the process exits.
trap remove_prototype_shim EXIT
trap release_lock EXIT
remove_prototype_shim() {
rm -f "$PROTOTYPE_SHIM_PATH"
}
release_lock() {
remove_prototype_shim
}
if [ ! -w "$SHIM_PATH" ]; then
echo "pyenv: cannot rehash: $SHIM_PATH isn't writable"
exit 1
fi
unset acquired
for _ in $(seq "${PYENV_REHASH_TIMEOUT:-60}"); do
if acquire_lock 2>/dev/null; then
acquired=1
break
else
# POSIX sleep(1) doesn't provides time precision of subsecond
sleep 1
fi
done
if [ -z "${acquired}" ]; then
echo "pyenv: cannot rehash: $PROTOTYPE_SHIM_PATH exists"
exit 1
fi
# The prototype shim file is a script that re-execs itself, passing
# its filename and any arguments to `pyenv exec`. This file is
# hard-linked for every executable and then removed. The linking
@@ -83,7 +104,7 @@ remove_outdated_shims() {
list_executable_names() {
local version file
pyenv-versions --bare --skip-aliases | \
while read version; do
while read -r version; do
for file in "${PYENV_ROOT}/versions/${version}/bin/"*; do
echo "${file##*/}"
done
@@ -136,6 +157,7 @@ shopt -s nullglob
# executables.
create_prototype_shim
remove_outdated_shims
# shellcheck disable=SC2046
make_shims $(list_executable_names | sort -u)

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env bash
# Summary: Display the root directory where versions and shims are kept
echo $PYENV_ROOT
echo "$PYENV_ROOT"

View File

@@ -20,7 +20,7 @@ fi
whence() {
local command="$1"
pyenv-versions --bare | while read version; do
pyenv-versions --bare | while read -r version; do
path="$(pyenv-prefix "$version")/bin/${command}"
if [ -x "$path" ]; then
[ "$print_paths" ] && echo "$path" || echo "$version"

View File

@@ -14,7 +14,7 @@
# -g/--debug Build a debug version
#
PYTHON_BUILD_VERSION="20160602"
PYTHON_BUILD_VERSION="20180424"
OLDIFS="$IFS"
@@ -60,6 +60,7 @@ resolve_link() {
}
abs_dirname() {
local cwd="$(pwd)"
local path="$1"
# Use a subshell to avoid modifying the current path
@@ -72,6 +73,7 @@ abs_dirname() {
pwd
)
# cd "$cwd"
}
capitalize() {
@@ -328,21 +330,22 @@ http() {
local file="$3"
[ -n "$url" ] || return 1
if type aria2c &>/dev/null; then
"http_${method}_aria2c" "$url" "$file"
elif type curl &>/dev/null; then
"http_${method}_curl" "$url" "$file"
elif type wget &>/dev/null; then
# SSL Certificate error with older wget that does not support Server Name Indication (#60)
if [[ "$(wget --version 2>/dev/null || true)" = "GNU Wget 1.1"[0-3]* ]]; then
echo "python-build: wget (< 1.14) doesn't support Server Name Indication. Please install curl (>= 7.18.1) and try again" >&2
return 1
fi
"http_${method}_wget" "$url" "$file"
local http_client
if [ -n "${PYTHON_BUILD_HTTP_CLIENT}" ]; then
http_client="http_${method}_${PYTHON_BUILD_HTTP_CLIENT}"
else
echo "error: please install \`aria2c\`, \`curl\` or \`wget\` and try again" >&2
exit 1
if type aria2c &>/dev/null; then
http_client="http_${method}_aria2c"
elif type curl &>/dev/null; then
http_client="http_${method}_curl"
elif type wget &>/dev/null; then
http_client="http_${method}_wget"
else
echo "error: please install \`aria2c\`, \`curl\` or \`wget\` and try again" >&2
exit 1
fi
fi
"${http_client}" "$url" "$file"
}
http_head_aria2c() {
@@ -1183,7 +1186,7 @@ fix_rbx_irb() {
require_java7() {
local version="$(java -version 2>&1 | grep '\(java\|openjdk\) version' | head -1)"
if [[ $version != *1.[789]* ]]; then
if [[ $version != *[789]* ]]; then
colorize 1 "ERROR" >&3
echo ": Java 7 required. Please install a 1.7-compatible JRE." >&3
return 1
@@ -1506,10 +1509,16 @@ build_package_mac_openssl() {
export CPPFLAGS="-I${OPENSSL_PREFIX_PATH}/include ${CPPFLAGS}"
export LDFLAGS="-L${OPENSSL_PREFIX_PATH}/lib ${LDFLAGS}"
# Make sure pkg-config finds our build first.
export PKG_CONFIG_PATH="${OPENSSL_PREFIX_PATH}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
# Hint OpenSSL that we prefer a 64-bit build.
export KERNEL_BITS="64"
OPENSSL_CONFIGURE="${OPENSSL_CONFIGURE:-./config}"
local nokerberos
[[ "$1" != openssl-1.0.* ]] || nokerberos=1
# Compile a shared lib with zlib dynamically linked, no kerberos.
package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-ssl2 no-ssl3 no-krb5 shared
@@ -2031,6 +2040,14 @@ ARIA2_OPTS="${PYTHON_BUILD_ARIA2_OPTS} ${IPV4+--disable-ipv6=true} ${IPV6+--disa
CURL_OPTS="${PYTHON_BUILD_CURL_OPTS} ${IPV4+--ipv4} ${IPV6+--ipv6}"
WGET_OPTS="${PYTHON_BUILD_WGET_OPTS} ${IPV4+--inet4-only} ${IPV6+--inet6-only}"
if [ -z "${PYTHON_BUILD_HTTP_CLIENT}" ] && ! type aria2c &>/dev/null && ! type curl &>/dev/null; then
# SSL Certificate error with older wget that does not support Server Name Indication (#60)
if [[ "$(wget --version 2>/dev/null || true)" = "GNU Wget 1.1"[0-3]* ]]; then
echo "python-build: wget (< 1.14) doesn't support Server Name Indication. Please install curl (>= 7.18.1) and try again" >&2
return 1
fi
fi
# Add an option to build a debug version of Python (#11)
if [ -n "$DEBUG" ]; then
package_option python configure --with-pydebug
@@ -2118,11 +2135,28 @@ if [ -z "${EZ_SETUP_URL}" ]; then
fi
if [ -z "${GET_PIP_URL}" ]; then
if [ -n "${PIP_VERSION}" ]; then
{ colorize 1 "WARNING"
echo ": Setting PIP_VERSION=${PIP_VERSION} is no longer supported and may cause failures during the install process."
} 1>&2
GET_PIP_URL="https://raw.githubusercontent.com/pypa/pip/${PIP_VERSION}/contrib/get-pip.py"
# Unset `PIP_VERSION` from environment before invoking `get-pip.py` to deal with "ValueError: invalid truth value" (pypa/pip#4528)
unset PIP_VERSION
else
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
# Use custom get-pip URL based on the target version (#1127)
case "${DEFINITION_PATH##*/}" in
2.6 | 2.6.* )
GET_PIP_URL="https://bootstrap.pypa.io/2.6/get-pip.py"
;;
3.2 | 3.2.* )
GET_PIP_URL="https://bootstrap.pypa.io/3.2/get-pip.py"
;;
3.3 | 3.3.* )
GET_PIP_URL="https://bootstrap.pypa.io/3.3/get-pip.py"
;;
* )
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
;;
esac
fi
fi

View File

@@ -0,0 +1,8 @@
#require_gcc
install_package "openssl-1.0.2k" "https://www.openssl.org/source/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
install_package "readline-6.3" "https://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-2.7.15" "https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz#22d9b1ac5b26135ad2b8c2901a9413537e08749a753356ee913c84dbd2df5574" ldflags_dirs standard verify_py27 ensurepip
else
install_package "Python-2.7.15" "https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz#18617d1f15a380a919d517630a9cd85ce17ea602f9bbdc58ddc672df4b0239db" ldflags_dirs standard verify_py27 ensurepip
fi

View File

@@ -2,7 +2,7 @@
install_package "openssl-1.0.2k" "https://www.openssl.org/source/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
install_package "readline-6.3" "https://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline
if has_tar_xz_support; then
install_package "Python-3.7.0b2" "https://www.python.org/ftp/python/3.7.0/Python-3.7.0b2.tar.xz#92082de7fafdcdab61a91b908f32b35f13a7aef3c2671c0fa388eb574c3fc882" ldflags_dirs standard verify_py37 ensurepip
install_package "Python-3.7.0b3" "https://www.python.org/ftp/python/3.7.0/Python-3.7.0b3.tar.xz#2b152788486c61ee6c3e9feaeb4c3fe9679f0a76a19a4c82eb4c665989c340fb" ldflags_dirs standard verify_py37 ensurepip
else
install_package "Python-3.7.0b2" "https://www.python.org/ftp/python/3.7.0/Python-3.7.0b2.tgz#2c787957e79bc916c913d6aeea899f07539729329ea76500387fd11cf1bd3b0a" ldflags_dirs standard verify_py37 ensurepip
install_package "Python-3.7.0b3" "https://www.python.org/ftp/python/3.7.0/Python-3.7.0b3.tgz#4ef8f7f1753451d79d2972f90928e8cc7bfce47e9a2afa14da5969321ddfb7d0" ldflags_dirs standard verify_py37 ensurepip
fi

View File

@@ -0,0 +1,58 @@
diff -ur ../Python-2.7.6/configure ./configure
--- ../Python-2.7.6/configure 2014-06-19 14:35:59.000000000 -0400
+++ ./configure 2018-04-24 12:44:24.143179222 -0400
@@ -6045,8 +6045,14 @@
# Calculate the right deployment target for this build.
#
- cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
- if test ${cur_target} '>' 10.2; then
+ cur_target_major=`sw_vers -productVersion | \
+ sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
+ cur_target_minor=`sw_vers -productVersion | \
+ sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
+ cur_target="${cur_target_major}.${cur_target_minor}"
+ if test ${cur_target_major} -eq 10 && \
+ test ${cur_target_minor} -ge 3
+ then
cur_target=10.3
if test ${enable_universalsdk}; then
if test "${UNIVERSAL_ARCHS}" = "all"; then
@@ -8230,15 +8236,14 @@
# Use -undefined dynamic_lookup whenever possible (10.3 and later).
# This allows an extension to be used in any Python
- if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2
+ dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
+ sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
+ dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \
+ sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
+ if test ${dep_target_major} -eq 10 && \
+ test ${dep_target_minor} -le 2
then
- if test "${enable_universalsdk}"; then
- LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
- fi
- LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
- LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
- BLDSHARED="$LDSHARED"
- else
+ # building for OS X 10.0 through 10.2
LDSHARED='$(CC) -bundle'
LDCXXSHARED='$(CXX) -bundle'
if test "$enable_framework" ; then
@@ -8252,6 +8257,14 @@
LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi
+ else
+ # building for OS X 10.3 and later
+ if test "${enable_universalsdk}"; then
+ LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+ fi
+ LDSHARED='$(CC) -bundle -undefined dynamic_lookup'
+ LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup'
+ BLDSHARED="$LDSHARED"
fi
;;
Linux*|GNU*|QNX*)

View File

@@ -0,0 +1,50 @@
case "$(pypy_architecture 2>/dev/null || true)" in
"linux" )
if require_distro "Ubuntu 12.04" "Ubuntu 12.10" "Ubuntu 13.04" "Ubuntu 13.10" "Ubuntu 14.04" 1>/dev/null 2>&1; then
install_package "pypy2-v6.0.0-linux32" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux32.tar.bz2#ad1082d4328ae8f32617b14628648583b82b6d29df3aa42b97bd1853c08c4bc8" "pypy" verify_py27 ensurepip
else
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
echo "try 'pypy3.5-6.0.0-src' to build from source."
echo
} >&2
exit 1
fi
;;
"linux-armel" )
require_distro "Ubuntu 12.04" || true
install_package "pypy2-v6.0.0-linux-armel" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux-armel.tar.bz2#924ca3f90aa28e8961859508c25752c95253b842318a0f267267ffe90f56a916" "pypy" verify_py27 ensurepip
;;
"linux-armhf" )
if [[ "$(cat /etc/issue 2>/dev/null || true)" == "Raspbian"* ]]; then
install_package "pypy2-v6.0.0-linux-armhf-raspbian" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux-armhf-raspbian.tar.bz2#6506ce739e31981e5596d3cc2e2c7f5b086ee77bb4d97773082b62b2f283eef2" "pypy" verify_py27 ensurepip
else
require_distro "Ubuntu 13.04" || true
install_package "pypy2-v6.0.0-linux-armhf-raring" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux-armhf-raring.tar.bz2#2c430240cecb562102c677598f106aa57899f00cd37f719989e18ed9ca44bd01" "pypy" verify_py27 ensurepip
fi
;;
"linux64" )
if require_distro "Ubuntu 12.04" "Ubuntu 12.10" "Ubuntu 13.04" "Ubuntu 13.10" "Ubuntu 14.04" 1>/dev/null 2>&1; then
install_package "pypy2-v6.0.0-linux64" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux64.tar.bz2#6cbf942ba7c90f504d8d6a2e45d4244e3bf146c8722d64e9410b85eac6b5af67" "pypy" verify_py27 ensurepip
else
install_package "pypy-6.0.0-linux_x86_64-portable" "https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-6.0.0-linux_x86_64-portable.tar.bz2#1d2a833680f9432b6b5f6b8503f656535f429eeb6c4bc5408abe5b637bfb9b94" "pypy" verify_py27 ensurepip
fi
;;
"osx64" )
install_package "pypy2-v6.0.0-osx64" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-osx64.tar.bz2#d7dc443e6bb9a45212e8d8f5a63e9f6ce23f1d88c50709efea1c75b76c8bc186" "pypy" verify_py27 ensurepip
;;
"win32" )
# FIXME: never tested on Windows
install_zip "pypy2-v6.0.0-win32" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-win32.zip#6e2210dae1ae721ed4eb9cba19f15453514b64111511c84f24843c4fdefdaf7f" "pypy" verify_py27 ensurepip
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
echo "try 'pypy2-6.0.0-src' to build from source."
echo
} >&2
exit 1
;;
esac

View File

@@ -0,0 +1,3 @@
#require_gcc
install_package "openssl-1.0.2k" "https://www.openssl.org/source/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
install_package "pypy2-v6.0.0-src" "https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-src.tar.bz2#6097ec5ee23d0d34d8cd27a1072bed041c8a080ad48731190a03a2223029212d" "pypy_builder" verify_py27 ensurepip

View File

@@ -0,0 +1,58 @@
case "$(pypy_architecture 2>/dev/null || true)" in
"linux" )
if require_distro "Ubuntu 14.04" 1>/dev/null 2>&1; then
install_package "pypy3-v6.0.0-linux32" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux32.tar.bz2#b04eeee5160e6cb5f8962de80f077ea1dc7be34e77d74bf075519c23603f5ff9" "pypy" verify_py27 ensurepip
fi
;;
"linux64" )
if require_distro "Ubuntu 14.04" "Ubuntu 16.04" 1>/dev/null 2>&1; then
install_package "pypy3-v6.0.0-linux64" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux64.tar.bz2#4cfffa292b9ef34bb6ba39cdbaa196c5c5cbbc5aa3faaa157cf45d7e34027048" "pypy" verify_py27 ensurepip
else
install_package "pypy3.5-6.0.0-linux_x86_64-portable" "https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.5-6.0.0-linux_x86_64-portable.tar.bz2#07f16282d126abfa759702baea869b0f661aa97f4c553ebec66c624bda28155f" "pypy" verify_py35 ensurepip
fi
;;
"linux-armel" )
require_distro "Ubuntu 12.04" || true
install_package "pypy3-v6.0.0-linux-armel" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux-armel.tar.bz2#6a6888a55192f58594838b8b3d2e7daaad43d3bf4293afab3dd8987d0bbd1124" "pypy" verify_py27 ensurepip
;;
"linux-armhf" )
if [[ "$(cat /etc/issue 2>/dev/null || true)" == "Raspbian"* ]]; then
install_package "pypy3-v6.0.0-linux-armhf-raspbian" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux-armhf-raspbian.tar.bz2#8a0420dda23413925400538bbfc0cff2bbb2ab0de984eef6faaeab6d3309cbcc" "pypy" verify_py27 ensurepip
else
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
echo "try 'pypy3.5-6.0.0-src' to build from source."
echo
} >&2
exit 1
fi
;;
"osx64" )
if require_osx_version "10.13"; then
install_package "pypy3-v6.0.0-osx64" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-osx64.tar.bz2#938b8034e30f5f5060d2a079070c56c3be5559bc7ae9cc0c8395fe6fc45cfe4c" "pypy" verify_py27 ensurepip
else
# install_package "pypy3-v6.0.0-osx64-2" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-osx64-2.tar.bz2#" "pypy" verify_py27 ensurepip
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
echo "try 'pypy3.5-6.0.0-src' to build from source."
echo
} >&2
exit 1
fi
;;
"win32" )
# FIXME: never tested on Windows
install_zip "pypy3-v6.0.0-win32" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-win32.zip#72dddb3746a51f7672c77d619c818e27efe899e08ae82762448e50dbfdc2f5f3" "pypy" verify_py27 ensurepip
;;
* )
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
echo "try 'pypy3.5-6.0.0-src' to build from source."
echo
} >&2
exit 1
;;
esac

View File

@@ -0,0 +1,3 @@
#require_gcc
install_package "openssl-1.0.2k" "https://www.openssl.org/source/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
install_package "pypy3-v6.0.0-src" "https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-src.tar.bz2#ed8005202b46d6fc6831df1d13a4613bc40084bfa42f275068edadf8954034a3" "pypy_builder" verify_py35 ensurepip

View File

@@ -8,7 +8,6 @@ export CC=cc
export -n PYTHON_CONFIGURE_OPTS
setup() {
ensure_not_found_in_path aria2c
mkdir -p "$INSTALL_ROOT"
stub md5 false
stub curl false
@@ -537,6 +536,10 @@ OUT
# nop
}
@test "JRuby Java 9 version string" {
# nop
}
@test "non-writable TMPDIR aborts build" {
export TMPDIR="${TMP}/build"
mkdir -p "$TMPDIR"

View File

@@ -3,10 +3,8 @@
load test_helper
export PYTHON_BUILD_SKIP_MIRROR=1
export PYTHON_BUILD_CACHE_PATH="$TMP/cache"
export PYTHON_BUILD_CURL_OPTS=
setup() {
ensure_not_found_in_path aria2c
mkdir "$PYTHON_BUILD_CACHE_PATH"
}

View File

@@ -3,11 +3,6 @@
load test_helper
export PYTHON_BUILD_SKIP_MIRROR=1
export PYTHON_BUILD_CACHE_PATH=
export PYTHON_BUILD_CURL_OPTS=
setup() {
ensure_not_found_in_path aria2c
}
@test "package URL without checksum" {

View File

@@ -3,10 +3,8 @@
load test_helper
export PYTHON_BUILD_SKIP_MIRROR=1
export PYTHON_BUILD_CACHE_PATH=
export PYTHON_BUILD_ARIA2_OPTS=
setup() {
ensure_not_found_in_path aria2c
export PYTHON_BUILD_BUILD_PATH="${TMP}/source"
mkdir -p "${PYTHON_BUILD_BUILD_PATH}"
}
@@ -21,6 +19,8 @@ setup() {
}
@test "using aria2c if available" {
export PYTHON_BUILD_ARIA2_OPTS=
export PYTHON_BUILD_HTTP_CLIENT="aria2c"
stub aria2c "--allow-overwrite=true --no-conf=true -o * http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$4"
install_fixture definitions/without-checksum

View File

@@ -4,11 +4,6 @@ load test_helper
export PYTHON_BUILD_SKIP_MIRROR=
export PYTHON_BUILD_CACHE_PATH=
export PYTHON_BUILD_MIRROR_URL=http://mirror.example.com
export PYTHON_BUILD_CURL_OPTS=
setup() {
ensure_not_found_in_path aria2c
}
@test "package URL without checksum bypasses mirror" {

View File

@@ -5,11 +5,11 @@ export PYTHON_BUILD_CACHE_PATH="$TMP/cache"
export MAKE=make
export MAKE_OPTS="-j 2"
export CC=cc
export PYTHON_BUILD_HTTP_CLIENT="curl"
export TMP_FIXTURES="$TMP/fixtures"
setup() {
ensure_not_found_in_path aria2c
mkdir -p "$INSTALL_ROOT"
stub md5 false
stub curl false
@@ -92,6 +92,19 @@ resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}
run_inline_definition_with_name() {
local definition_name="build-definition"
case "$1" in
"--name="* )
local definition_name="${1#--name=}"
shift 1
;;
esac
local definition="${TMP}/${definition_name}"
cat > "$definition"
run python-build "$definition" "${1:-$INSTALL_ROOT}"
}
@test "apply built-in python patch before building" {
cached_tarball "Python-3.6.2"
@@ -326,3 +339,43 @@ OUT
assert_success
assert_output "10.4"
}
@test "use the default EZ_SETUP_URL by default" {
run_inline_definition <<OUT
echo "\${EZ_SETUP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/ez_setup.py"
assert_success
}
@test "use the default GET_PIP_URL by default" {
run_inline_definition <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/get-pip.py"
assert_success
}
@test "use the custom GET_PIP_URL for 2.6 versions" {
run_inline_definition_with_name --name=2.6 <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/2.6/get-pip.py"
assert_success
}
@test "use the custom GET_PIP_URL for 3.2 versions" {
run_inline_definition_with_name --name=3.2 <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/3.2/get-pip.py"
assert_success
}
@test "use the custom GET_PIP_URL for 3.3 versions" {
run_inline_definition_with_name --name=3.3 <<OUT
echo "\${GET_PIP_URL}"
OUT
assert_output "https://bootstrap.pypa.io/3.3/get-pip.py"
assert_success
}

View File

@@ -1,4 +1,6 @@
export TMP="$BATS_TEST_DIRNAME/tmp"
export RUBY_BUILD_CURL_OPTS=
export RUBY_BUILD_HTTP_CLIENT="curl"
if [ "$FIXTURE_ROOT" != "$BATS_TEST_DIRNAME/fixtures" ]; then
export FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures"
@@ -9,35 +11,6 @@ if [ "$FIXTURE_ROOT" != "$BATS_TEST_DIRNAME/fixtures" ]; then
export PATH
fi
remove_command_from_path() {
OLDIFS="${IFS}"
local cmd="$1"
local path
local paths=()
IFS=:
for path in ${PATH}; do
if [ -e "${path}/${cmd}" ]; then
local tmp_path="$(mktemp -d "${TMP}/path.XXXXX")"
ln -fs "${path}"/* "${tmp_path}"
rm -f "${tmp_path}/${cmd}"
paths["${#paths[@]}"]="${tmp_path}"
else
paths["${#paths[@]}"]="${path}"
fi
done
export PATH="${paths[*]}"
IFS="${OLDIFS}"
}
ensure_not_found_in_path() {
local cmd
for cmd; do
if command -v "${cmd}" 1>/dev/null 2>&1; then
remove_command_from_path "${cmd}"
fi
done
}
teardown() {
rm -fr "${TMP:?}"/*
}

24
src/configure vendored
View File

@@ -34,16 +34,16 @@ esac
eval "$("$src_dir"/shobj-conf -C "$CC" -o "$host_os")"
sed "
s,@CC@,${CC},
s,@CFLAGS@,${CFLAGS},
s,@LOCAL_CFLAGS@,${LOCAL_CFLAGS},
s,@DEFS@,${DEFS},
s,@LOCAL_DEFS@,${LOCAL_DEFS},
s,@SHOBJ_CC@,${SHOBJ_CC},
s,@SHOBJ_CFLAGS@,${SHOBJ_CFLAGS},
s,@SHOBJ_LD@,${SHOBJ_LD},
s,@SHOBJ_LDFLAGS@,${SHOBJ_LDFLAGS//,/\\,},
s,@SHOBJ_XLDFLAGS@,${SHOBJ_XLDFLAGS//,/\\,},
s,@SHOBJ_LIBS@,${SHOBJ_LIBS},
s,@SHOBJ_STATUS@,${SHOBJ_STATUS},
s#@CC@#${CC}#
s#@CFLAGS@#${CFLAGS}#
s#@LOCAL_CFLAGS@#${LOCAL_CFLAGS}#
s#@DEFS@#${DEFS}#
s#@LOCAL_DEFS@#${LOCAL_DEFS}#
s#@SHOBJ_CC@#${SHOBJ_CC}#
s#@SHOBJ_CFLAGS@#${SHOBJ_CFLAGS}#
s#@SHOBJ_LD@#${SHOBJ_LD}#
s#@SHOBJ_LDFLAGS@#${SHOBJ_LDFLAGS}#
s#@SHOBJ_XLDFLAGS@#${SHOBJ_XLDFLAGS}#
s#@SHOBJ_LIBS@#${SHOBJ_LIBS}#
s#@SHOBJ_STATUS@#${SHOBJ_STATUS}#
" "$src_dir"/Makefile.in > "$src_dir"/Makefile

View File

@@ -25,12 +25,22 @@ create_executable() {
}
@test "rehash in progress" {
export PYENV_REHASH_TIMEOUT=1
mkdir -p "${PYENV_ROOT}/shims"
touch "${PYENV_ROOT}/shims/.pyenv-shim"
run pyenv-rehash
assert_failure "pyenv: cannot rehash: ${PYENV_ROOT}/shims/.pyenv-shim exists"
}
@test "wait until lock acquisition" {
export PYENV_REHASH_TIMEOUT=5
mkdir -p "${PYENV_ROOT}/shims"
touch "${PYENV_ROOT}/shims/.pyenv-shim"
bash -c "sleep 1 && rm -f ${PYENV_ROOT}/shims/.pyenv-shim" &
run pyenv-rehash
assert_success
}
@test "creates shims" {
create_executable "2.7" "python"
create_executable "2.7" "fab"

View File

@@ -2,6 +2,17 @@
load test_helper
@test "shell integration disabled" {
run pyenv shell
assert_failure "pyenv: shell integration not enabled. Run \`pyenv init' for instructions."
}
@test "shell integration enabled" {
eval "$(pyenv init -)"
run pyenv shell
assert_success "pyenv: no shell-specific version configured"
}
@test "no shell version" {
mkdir -p "${PYENV_TEST_DIR}/myproject"
cd "${PYENV_TEST_DIR}/myproject"

View File

@@ -9,7 +9,7 @@ setup() {
create_file() {
mkdir -p "$(dirname "$1")"
touch "$1"
echo "system" > "$1"
}
@test "detects global 'version' file" {

View File

@@ -26,7 +26,7 @@ setup() {
}
@test "detects local file" {
touch .python-version
echo "system" > .python-version
run pyenv-version-origin
assert_success "${PWD}/.python-version"
}

View File

@@ -60,12 +60,11 @@ create_executable() {
}
@test "doesn't include current directory in PATH search" {
export PATH="$(path_without "kill-all-humans")"
mkdir -p "$PYENV_TEST_DIR"
cd "$PYENV_TEST_DIR"
touch kill-all-humans
chmod +x kill-all-humans
PYENV_VERSION=system run pyenv-which kill-all-humans
PATH="$(path_without "kill-all-humans")" PYENV_VERSION=system run pyenv-which kill-all-humans
assert_failure "pyenv: kill-all-humans: command not found"
}
@@ -91,9 +90,8 @@ OUT
}
@test "no executable found for system version" {
export PATH="$(path_without "py.test")"
PYENV_VERSION=system run pyenv-which py.test
assert_failure "pyenv: py.test: command not found"
PATH="$(path_without "rake")" PYENV_VERSION=system run pyenv-which rake
assert_failure "pyenv: rake: command not found"
}
@test "executable found in other versions" {