mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-13 22:03:52 -05:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9146f44db1 | ||
|
|
b9ae43a9df | ||
|
|
f6a77549eb | ||
|
|
cbd246acff | ||
|
|
9d21169ee0 | ||
|
|
7bceb85067 | ||
|
|
eeb69b1b79 | ||
|
|
8abefe1fcb | ||
|
|
b22fcd9759 | ||
|
|
45df273592 | ||
|
|
dbd50e7bd9 | ||
|
|
1c0a5d8264 | ||
|
|
7c7cca8a26 | ||
|
|
123b3af1a0 | ||
|
|
ba9c01ce77 | ||
|
|
7535efe031 | ||
|
|
995da2df89 | ||
|
|
f28b3ee123 | ||
|
|
97b957d5d5 | ||
|
|
fe2412c95d | ||
|
|
5114600c4d | ||
|
|
96d3bd6379 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,5 +1,26 @@
|
||||
## Version History
|
||||
|
||||
#### 20150204
|
||||
|
||||
* python-build: Add PyPy 2.5.0 release (#311)
|
||||
* python-build: Add note about `--enable-shared` and RPATH (#217)
|
||||
* python-build: Fix regression of `PYTHON_MAKE_INSTALL_TARGET` and add test (#255)
|
||||
* python-build: Symlink `pythonX.Y-config` to `python-config` if `python-config` is missing (#296)
|
||||
* python-build: Latest `pip` can't be installed into `3.0.1` (#309)
|
||||
|
||||
#### 20150124
|
||||
|
||||
* python-build: Import recent changes from ruby-build v20150112
|
||||
* python-build: Prevent adding `/Library/Python/X.X/site-packages` to `sys.path` whtn `--enable-framework` is enabled on OS X. Thanks @s1341 (#292)
|
||||
* python-build: Add new IronPython release; 2.7.5
|
||||
|
||||
#### 20141211
|
||||
|
||||
* pyenv: Add bulit-in `pip-rehash` feature. You don't need to install [pyenv-pip-rehash](https://github.com/yyuu/pyenv-pip-rehash) anymore.
|
||||
* python-build: Add new CPython release; 2.7.9 (#284)
|
||||
* python-build: Add new PyPy releases; pypy3-2.4.0, pypy3-2.4.0-src (#277)
|
||||
* python-build: Add build definitions of PyPy nightly build
|
||||
|
||||
#### 20141127
|
||||
|
||||
* python-build: Add new CPython release candidates; 2.7.9rc1 (#276)
|
||||
|
||||
4
Makefile
4
Makefile
@@ -1,5 +1,9 @@
|
||||
.PHONY: test
|
||||
|
||||
# Do not pass in user flags to build tests.
|
||||
unexport PYTHON_CFLAGS
|
||||
unexport PYTHON_CONFIGURE_OPTS
|
||||
|
||||
test: bats
|
||||
PATH="./bats/bin:$$PATH" test/run
|
||||
cd plugins/python-build && $(PWD)/bats/bin/bats $${CI:+--tap} test
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Simple Python Version Management: pyenv
|
||||
|
||||
[](https://travis-ci.org/yyuu/pyenv)
|
||||
[](https://travis-ci.org/yyuu/pyenv)
|
||||
|
||||
pyenv lets you easily switch between multiple versions of Python. It's
|
||||
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
||||
@@ -171,8 +171,7 @@ easy to fork and contribute any changes back upstream.
|
||||
1. **Check out pyenv where you want it installed.**
|
||||
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else).
|
||||
|
||||
$ cd
|
||||
$ git clone git://github.com/yyuu/pyenv.git .pyenv
|
||||
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
|
||||
|
||||
|
||||
2. **Define environment variable `PYENV_ROOT`** to point to the path where
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="20141211"
|
||||
version="20150204"
|
||||
|
||||
if cd "$PYENV_ROOT" 2>/dev/null; then
|
||||
git_revision="$(git describe --tags HEAD 2>/dev/null || true)"
|
||||
|
||||
@@ -105,6 +105,20 @@ process.
|
||||
configure and make options for buildling CPython. These variables will
|
||||
be passed to Python only, not any dependent packages (e.g. libyaml).
|
||||
|
||||
### Building as `--enable-shared`
|
||||
|
||||
You can build CPython with `--enable-shared` to install a version with
|
||||
shared object.
|
||||
|
||||
If `--enabled-shared` was found in `PYTHON_CONFIGURE_OPTS` or `CONFIGURE_OPTS`,
|
||||
`python-build` will automatically set `RPATH` to the pyenv's prefix directory.
|
||||
This means you don't have to set `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` for
|
||||
the version(s) installed with `--enable-shared`.
|
||||
|
||||
```sh
|
||||
$ env PYTHON_CONFIGURE_OPTS="--enable-shared` pyenv install 2.7.9
|
||||
```
|
||||
|
||||
### Checksum verification
|
||||
|
||||
If you have the `shasum`, `openssl`, or `sha256sum` tool installed,
|
||||
|
||||
@@ -106,6 +106,8 @@ for option in "${OPTIONS[@]}"; do
|
||||
esac
|
||||
done
|
||||
|
||||
[ "${#ARGUMENTS[@]}" -le 1 ] || usage 1 >&2
|
||||
|
||||
unset VERSION_NAME
|
||||
|
||||
# The first argument contains the definition to install. If the
|
||||
@@ -114,8 +116,7 @@ unset VERSION_NAME
|
||||
# version is not specified.
|
||||
DEFINITION="${ARGUMENTS[0]}"
|
||||
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv-local 2>/dev/null || true)"
|
||||
[ -n "$DEFINITION" ] || usage 1
|
||||
|
||||
[ -n "$DEFINITION" ] || usage 1 >&2
|
||||
|
||||
# Define `before_install` and `after_install` functions that allow
|
||||
# plugin hooks to register a string of code for execution before or
|
||||
|
||||
@@ -17,24 +17,32 @@ if [ "$1" = "--complete" ]; then
|
||||
exec pyenv versions --bare
|
||||
fi
|
||||
|
||||
usage() {
|
||||
# We can remove the sed fallback once pyenv 0.4.0 is widely available
|
||||
pyenv-help uninstall 2>/dev/null || sed -ne '/^#/!q;s/.//;s/.//;1,4d;p' < "$0"
|
||||
[ -z "$1" ] || exit "$1"
|
||||
}
|
||||
|
||||
if [ -z "$PYENV_ROOT" ]; then
|
||||
PYENV_ROOT="${HOME}/.pyenv"
|
||||
fi
|
||||
|
||||
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
usage 0
|
||||
fi
|
||||
|
||||
unset FORCE
|
||||
if [ "$1" = "-f" ] || [ "$1" = "--force" ]; then
|
||||
FORCE=true
|
||||
shift
|
||||
fi
|
||||
|
||||
[ "$#" -eq 1 ] || usage 1 >&2
|
||||
|
||||
DEFINITION="$1"
|
||||
case "$DEFINITION" in
|
||||
"" | -* )
|
||||
# We can remove the sed fallback once pyenv 0.4.0 is widely available.
|
||||
{ pyenv-help uninstall 2>/dev/null ||
|
||||
sed -ne '/^#/!q;s/.\{1,2\}//;1,4d;p' < "$0"
|
||||
} >&2
|
||||
exit 1
|
||||
usage 1 >&2
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Usage: python-build [-kvp] <definition> <prefix>
|
||||
# python-build --definitions
|
||||
#
|
||||
# -k/--keep Do not remove source tree after installation
|
||||
# -v/--verbose Verbose mode: print compilation status to stdout
|
||||
# -p/--patch Apply a patch from stdin before building
|
||||
# --definitions List all built-in definitions
|
||||
# -g/--debug Build a debug version
|
||||
#
|
||||
|
||||
PYTHON_BUILD_VERSION="20141028"
|
||||
|
||||
@@ -495,7 +505,7 @@ fetch_svn() {
|
||||
if type svn &>/dev/null; then
|
||||
svn co -r "$svn_rev" "$svn_url" "${package_name}" >&4 2>&1
|
||||
else
|
||||
echo "error: please install \`svn\` and try again" >&2
|
||||
echo "error: please install Subversion and try again" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@@ -1098,7 +1108,15 @@ require_llvm() {
|
||||
local llvm_version="$1"
|
||||
if [ "$(uname -s)" = "Darwin" ] && [ "$(osx_version)" -ge 1010 ]; then
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" != *--llvm-* ]]; then
|
||||
if [ "$llvm_version" = "3.2" ]; then
|
||||
package_option python configure --prebuilt-name="llvm-3.2-x86_64-apple-darwin13.tar.bz2"
|
||||
else
|
||||
local llvm_prefix="$(brew --prefix llvm 2>/dev/null || true)"
|
||||
local llvm_config="${llvm_prefix}/bin/llvm-config"
|
||||
if [ -x "$llvm_config" ]; then
|
||||
package_option python configure --llvm-config="$llvm_config"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -1320,13 +1338,21 @@ verify_python() {
|
||||
# Not create symlinks on `altinstall` (#255)
|
||||
if [[ "$PYTHON_MAKE_INSTALL_TARGET" != *"altinstall"* ]]; then
|
||||
local suffix="${1#python}"
|
||||
local file
|
||||
local file link
|
||||
shopt -s nullglob
|
||||
for file in "${PREFIX_PATH}/bin"/*; do
|
||||
local link
|
||||
unset link
|
||||
case "${file}" in
|
||||
*"-${suffix}" ) link="${file%%-${suffix}}" ;;
|
||||
*"${suffix}" ) link="${file%%${suffix}}" ;;
|
||||
*/"python${suffix}-config" )
|
||||
# Symlink `pythonX.Y-config` to `python-config` if `python-config` is missing (#296)
|
||||
link="${file%/*}/python-config"
|
||||
;;
|
||||
*/*"-${suffix}" )
|
||||
link="${file%%-${suffix}}"
|
||||
;;
|
||||
*/*"${suffix}" )
|
||||
link="${file%%${suffix}}"
|
||||
;;
|
||||
esac
|
||||
if [ -n "$link" ] && [ ! -e "$link" ]; then
|
||||
( cd "${file%/*}" && ln -fs "${file##*/}" "${link##*/}" )
|
||||
@@ -1519,14 +1545,8 @@ version() {
|
||||
}
|
||||
|
||||
usage() {
|
||||
{ version
|
||||
echo "usage: python-build [-k|--keep] [-v|--verbose] [-p|--patch] [-g|--debug] definition prefix"
|
||||
echo " python-build --definitions"
|
||||
} >&2
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
sed -ne '/^#/!q;s/.\{1,2\}//;1,2d;p' < "$0"
|
||||
[ -z "$1" ] || exit "$1"
|
||||
}
|
||||
|
||||
list_definitions() {
|
||||
@@ -1558,16 +1578,9 @@ parse_options "$@"
|
||||
for option in "${OPTIONS[@]}"; do
|
||||
case "$option" in
|
||||
"h" | "help" )
|
||||
usage without_exiting
|
||||
{ echo
|
||||
echo " -k/--keep Do not remove source tree after installation"
|
||||
echo " -v/--verbose Verbose mode: print compilation status to stdout"
|
||||
echo " -p/--patch Apply a patch from stdin before building"
|
||||
echo " -g/--debug Build a debug version"
|
||||
echo " --definitions List all built-in definitions"
|
||||
version
|
||||
echo
|
||||
} >&2
|
||||
exit 0
|
||||
usage 0
|
||||
;;
|
||||
"definitions" )
|
||||
list_definitions
|
||||
@@ -1592,9 +1605,11 @@ for option in "${OPTIONS[@]}"; do
|
||||
esac
|
||||
done
|
||||
|
||||
[ "${#ARGUMENTS[@]}" -eq 2 ] || usage 1 >&2
|
||||
|
||||
DEFINITION_PATH="${ARGUMENTS[0]}"
|
||||
if [ -z "$DEFINITION_PATH" ]; then
|
||||
usage
|
||||
usage 1 >&2
|
||||
elif [ ! -f "$DEFINITION_PATH" ]; then
|
||||
for DEFINITION_DIR in "${PYTHON_BUILD_DEFINITIONS[@]}"; do
|
||||
if [ -f "${DEFINITION_DIR}/${DEFINITION_PATH}" ]; then
|
||||
@@ -1611,7 +1626,7 @@ fi
|
||||
|
||||
PREFIX_PATH="${ARGUMENTS[1]}"
|
||||
if [ -z "$PREFIX_PATH" ]; then
|
||||
usage
|
||||
usage 1 >&2
|
||||
elif [ "${PREFIX_PATH#/}" = "$PREFIX_PATH" ]; then
|
||||
PREFIX_PATH="${PWD}/${PREFIX_PATH}"
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#require_gcc
|
||||
install_package "readline-6.3" "http://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline
|
||||
install_package "Python-3.0.1" "http://python.org/ftp/python/3.0.1/Python-3.0.1.tgz#7d5f2feae9035f1d3d9e6bb7f092dbf374d6bb4b25abd0d2d11f13bba1cb04de" ldflags_dirs standard verify_py30 ensurepip
|
||||
install_package "Python-3.0.1" "http://python.org/ftp/python/3.0.1/Python-3.0.1.tgz#7d5f2feae9035f1d3d9e6bb7f092dbf374d6bb4b25abd0d2d11f13bba1cb04de" ldflags_dirs standard verify_py30
|
||||
install_package "setuptools-1.4.2" "https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz#263986a60a83aba790a5bffc7d009ac88114ba4e908e5c90e453b3bf2155dbbd" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#145eaa5d1ea1b062663da1f3a97780d7edea4c63c68a37c463b1deedf7bb4957" python
|
||||
|
||||
2
plugins/python-build/share/python-build/ironpython-2.7.5
Normal file
2
plugins/python-build/share/python-build/ironpython-2.7.5
Normal file
@@ -0,0 +1,2 @@
|
||||
install_zip "IronPython-2.7.5" "https://github.com/IronLanguages/main/releases/download/ipy-2.7.5/IronPython-2.7.5.zip#d2651084a61a43379ce6c031f4f29c5e01ba96d1ff89a5282376dd4b84439b5b" ironpython
|
||||
# FIXME: have not confirmed to install setuptools into IronPython yet
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.2/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.2/Lib/site.py 2014-12-12 10:59:47.000000000 +0200
|
||||
+++ ./Lib/site.py 2014-12-12 11:24:28.000000000 +0200
|
||||
@@ -312,7 +312,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework and "/%s.framework/"%(framework,) in prefix:
|
||||
+ if False and framework and "/%s.framework/"%(framework,) in prefix:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.3/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.3/Lib/site.py 2012-04-10 02:07:31.000000000 +0300
|
||||
+++ ./Lib/site.py 2014-12-12 11:35:33.000000000 +0200
|
||||
@@ -312,7 +312,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework:
|
||||
+ if False and framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.3/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.3/Lib/site.py 2012-04-10 02:07:31.000000000 +0300
|
||||
+++ ./Lib/site.py 2014-12-12 11:35:33.000000000 +0200
|
||||
@@ -312,7 +312,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework:
|
||||
+ if False and framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.5/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.5/Lib/site.py 2013-05-12 06:32:44.000000000 +0300
|
||||
+++ ./Lib/site.py 2014-12-12 11:29:29.000000000 +0200
|
||||
@@ -300,7 +300,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework:
|
||||
+ if False and framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.5/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.5/Lib/site.py 2013-05-12 06:32:44.000000000 +0300
|
||||
+++ ./Lib/site.py 2014-12-12 11:29:29.000000000 +0200
|
||||
@@ -300,7 +300,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework:
|
||||
+ if False and framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.5/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.5/Lib/site.py 2013-05-12 06:32:44.000000000 +0300
|
||||
+++ ./Lib/site.py 2014-12-12 11:29:29.000000000 +0200
|
||||
@@ -300,7 +300,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework:
|
||||
+ if False and framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
@@ -0,0 +1,13 @@
|
||||
Only in .: 003_system_library_path_in_sys_path.patch
|
||||
diff -ur ../Python-2.7.8/Lib/site.py ./Lib/site.py
|
||||
--- ../Python-2.7.8/Lib/site.py 2014-06-30 05:05:30.000000000 +0300
|
||||
+++ ./Lib/site.py 2014-12-12 11:42:33.000000000 +0200
|
||||
@@ -300,7 +300,7 @@
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
- if framework:
|
||||
+ if False and framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
38
plugins/python-build/share/python-build/pypy-2.5.0
Normal file
38
plugins/python-build/share/python-build/pypy-2.5.0
Normal file
@@ -0,0 +1,38 @@
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
require_distro "Ubuntu 12.04" "Ubuntu 12.10" "Ubuntu 13.04" "Ubuntu 13.10" "Ubuntu 14.04" || true
|
||||
install_package "pypy-2.5.0-linux" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux.tar.bz2#3dfd56a986d25929b4ed9f40a5484f72f1d513cd816cf8aaa683106c3391247c" "pypy" verify_py27 ensurepip
|
||||
;;
|
||||
"linux-armel" )
|
||||
require_distro "Ubuntu 12.04" "Ubuntu 12.10" "Ubuntu 13.04" "Ubuntu 13.10" "Ubuntu 14.04" || true
|
||||
install_package "pypy-2.5.0-linux-armel" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux-armel.tar.bz2#277fa6c61d63af96893dafd19e1ffea7b988397c6a0fd66cd99dc0db1029be56" "pypy" verify_py27 ensurepip
|
||||
;;
|
||||
"linux-armhf" )
|
||||
if [[ "$(cat /etc/issue 2>/dev/null || true)" == "Raspbian"* ]]; then
|
||||
install_package "pypy-2.5.0-linux-armhf-raspbian" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux-armhf-raspbian.tar.bz2#6c975e39f0e7d57176b49a987a08862a3cbd9aeb52f47eb4ab148ea334e747fd" "pypy" verify_py27 ensurepip
|
||||
else
|
||||
require_distro "Ubuntu 13.04" || true
|
||||
install_package "pypy-2.5.0-linux-armhf-raring" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux-armhf-raring.tar.bz2#1866bf2b8a8144c68d64f2ba982c6c545849913167b4602b762716332ec1fa0b" "pypy" verify_py27 ensurepip
|
||||
fi
|
||||
;;
|
||||
"linux64" )
|
||||
require_distro "Ubuntu 12.04" || true
|
||||
install_package "pypy-2.5.0-linux64" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux64.tar.bz2#7764fb6b662407f8709eaa334c542aac9cb6bfe3291ac198dad0980ca129f3c2" "pypy" verify_py27 ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
install_package "pypy-2.5.0-osx64" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-osx64.tar.bz2#30b392b969b54cde281b07f5c10865a7f2e11a229c46b8af384ca1d3fe8d4e6e" "pypy" verify_py27 ensurepip
|
||||
;;
|
||||
"win32" )
|
||||
# FIXME: never tested on Windows
|
||||
install_zip "pypy-2.5.0-win32" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-win32.zip#692391434cf14016d74c6b8bda8f93135ef026f48c8327f3195bfa24d314317d" "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 'pypy-2.5.0-src' to build from soruce."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
2
plugins/python-build/share/python-build/pypy-2.5.0-src
Normal file
2
plugins/python-build/share/python-build/pypy-2.5.0-src
Normal file
@@ -0,0 +1,2 @@
|
||||
require_gcc
|
||||
install_package "pypy-pypy-c6ad44ecf5d8" "https://bitbucket.org/pypy/pypy/get/release-2.5.0.tar.bz2#8d644a55a3150cf3d18536c784e3410bb3f3438c1505000c4f761863bacedf88" "pypy_builder" verify_py27 ensurepip
|
||||
23
plugins/python-build/test/arguments.bats
Normal file
23
plugins/python-build/test/arguments.bats
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
@test "not enought arguments for python-build" {
|
||||
# use empty inline definition so nothing gets built anyway
|
||||
local definition="${TMP}/build-definition"
|
||||
echo '' > "$definition"
|
||||
|
||||
run python-build "$definition"
|
||||
assert_failure
|
||||
assert_output_contains 'Usage: python-build'
|
||||
}
|
||||
|
||||
@test "extra arguments for python-build" {
|
||||
# use empty inline definition so nothing gets built anyway
|
||||
local definition="${TMP}/build-definition"
|
||||
echo '' > "$definition"
|
||||
|
||||
run python-build "$definition" "${TMP}/install" ""
|
||||
assert_failure
|
||||
assert_output_contains 'Usage: python-build'
|
||||
}
|
||||
@@ -5,6 +5,7 @@ export PYTHON_BUILD_CACHE_PATH="$TMP/cache"
|
||||
export MAKE=make
|
||||
export MAKE_OPTS="-j 2"
|
||||
export CC=cc
|
||||
export -n PYTHON_CONFIGURE_OPTS
|
||||
|
||||
setup() {
|
||||
mkdir -p "$INSTALL_ROOT"
|
||||
@@ -449,6 +450,18 @@ OUT
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "JRuby Java 7 missing" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "JRuby Java is outdated" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "JRuby Java 7 up-to-date" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "non-writable TMPDIR aborts build" {
|
||||
export TMPDIR="${TMP}/build"
|
||||
mkdir -p "$TMPDIR"
|
||||
|
||||
@@ -5,8 +5,13 @@ export MAKE=make
|
||||
export MAKE_OPTS='-j 2'
|
||||
export -n CFLAGS
|
||||
export -n CC
|
||||
export -n PYTHON_CONFIGURE_OPTS
|
||||
|
||||
@test "require_gcc on OS X 10.9" {
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.9.5'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.9.5'
|
||||
stub gcc '--version : echo 4.2.1'
|
||||
@@ -24,6 +29,10 @@ OUT
|
||||
}
|
||||
|
||||
@test "require_gcc on OS X 10.10" {
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub gcc '--version : echo 4.2.1'
|
||||
@@ -36,7 +45,7 @@ DEF
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
CC=${TMP}/bin/gcc
|
||||
MACOSX_DEPLOYMENT_TARGET=10.10
|
||||
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
OUT
|
||||
}
|
||||
|
||||
|
||||
@@ -146,3 +146,42 @@ ${PYENV_ROOT}/plugins/bar/share/python-build
|
||||
${PYENV_ROOT}/plugins/foo/share/python-build
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "not enough arguments for pyenv-install" {
|
||||
stub_python_build
|
||||
run pyenv-install
|
||||
assert_failure
|
||||
assert_output_contains 'Usage: pyenv install'
|
||||
}
|
||||
|
||||
@test "too many arguments for pyenv-install" {
|
||||
stub_python_build
|
||||
run pyenv-install 3.4.1 3.4.2
|
||||
assert_failure
|
||||
assert_output_contains 'Usage: pyenv install'
|
||||
}
|
||||
|
||||
@test "show help for pyenv-install" {
|
||||
stub_python_build
|
||||
run pyenv-install -h
|
||||
assert_success
|
||||
assert_output_contains 'Usage: pyenv install'
|
||||
}
|
||||
|
||||
@test "not enough arguments pyenv-uninstall" {
|
||||
run pyenv-uninstall
|
||||
assert_failure
|
||||
assert_output_contains 'Usage: pyenv uninstall'
|
||||
}
|
||||
|
||||
@test "too many arguments for pyenv-uninstall" {
|
||||
run pyenv-uninstall 3.4.1 3.4.2
|
||||
assert_failure
|
||||
assert_output_contains 'Usage: pyenv uninstall'
|
||||
}
|
||||
|
||||
@test "show help for pyenv-uninstall" {
|
||||
run pyenv-uninstall -h
|
||||
assert_success
|
||||
assert_output_contains 'Usage: pyenv uninstall'
|
||||
}
|
||||
|
||||
@@ -138,3 +138,24 @@ OUT
|
||||
unstub make
|
||||
unstub patch
|
||||
}
|
||||
|
||||
@test "allow custom make install target" {
|
||||
cached_tarball "Python-3.2.1"
|
||||
|
||||
stub brew false
|
||||
stub "$MAKE" \
|
||||
" : echo \"$MAKE \$@\" >> build.log" \
|
||||
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||
|
||||
PYTHON_MAKE_INSTALL_TARGET="altinstall" TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||
assert_success
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.2.1: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.2.1: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make altinstall
|
||||
OUT
|
||||
|
||||
unstub make
|
||||
}
|
||||
|
||||
@@ -115,6 +115,10 @@ assert_output() {
|
||||
|
||||
assert_output_contains() {
|
||||
local expected="$1"
|
||||
if [ -z "$expected" ]; then
|
||||
echo "assert_output_contains needs an argument" >&2
|
||||
return 1
|
||||
fi
|
||||
echo "$output" | $(type -p ggrep grep | head -1) -F "$expected" >/dev/null || {
|
||||
{ echo "expected output to contain $expected"
|
||||
echo "actual: $output"
|
||||
|
||||
@@ -5,7 +5,7 @@ load test_helper
|
||||
@test "blank invocation" {
|
||||
run pyenv
|
||||
assert_success
|
||||
assert [ "${lines[0]}" == "pyenv 20141211" ]
|
||||
assert [ "${lines[0]}" == "pyenv 20150204" ]
|
||||
}
|
||||
|
||||
@test "invalid command" {
|
||||
|
||||
Reference in New Issue
Block a user