1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 07:13:53 -05:00

Compare commits

..

15 Commits

Author SHA1 Message Date
Makoto Sasaki
ff995b6654 v20141008 2014-10-08 19:29:20 +09:00
Makoto Sasaki
4d15d21f0f Add CPython 3.4.2 (fixes #251) 2014-10-08 18:47:18 +09:00
Makoto Sasaki
6790e3e18a Add CPython 3.2.6rc1 and CPython 3.3.6rc1 (fixes #248) 2014-10-05 02:07:12 +09:00
Makoto Sasaki
737e0f1b3f Add CPython 3.4.2rc1 (fixes #245) 2014-09-26 00:36:17 +09:00
Yamashita Yuu
ab9ee414ad v20140924 2014-09-24 13:57:53 +09:00
Yamashita Yuu
c3a755c853 Add PyPy-2.4.0 (fixes #241) 2014-09-23 05:00:27 +09:00
Daniel Hahler
9901c4b84d Use consistent quoting for versions=("$@") across bins 2014-09-11 12:59:40 +02:00
Yamashita, Yuu
a43f7f5341 Merge pull request #231 from blueyed/fix-zsh-completion-for-none
Do not quote completions in $reply
2014-09-11 01:31:14 +09:00
Makoto Sasaki
af2cb3f943 Add PyPy 2.4-beta1 (fixes #232) 2014-09-10 16:50:19 +09:00
Yamashita, Yuu
9b8b9c5205 Merge pull request #230 from blueyed/version-file-write-no-rm
pyenv-version-file-write: do not use rm, but clobber the file
2014-09-08 13:16:05 +09:00
Daniel Hahler
b6aef96cea pyenv-version-file-write: do not use rm, but clobber the file
With e.g. /usr/local/bin/.python-version owned by some user, `pyenv
local foo` would fail, if the user has no permissions for
`/usr/local/bin`, but only the `.python-version` file.
2014-09-07 16:56:40 +02:00
Daniel Hahler
bc6be9ed9f Do not quote completions in $reply
With an empty list of completions, zsh would complete a space / advance
the cursor by a space when completing.
2014-09-03 21:01:38 +02:00
Yamashita, Yuu
2297bd3741 Merge pull request #227 from blueyed/doc-multiple-versions
doc: note about using multiple versions
2014-09-03 10:17:30 +09:00
Daniel Hahler
8595df4e18 minor: remove trailing whitespace 2014-09-03 02:51:22 +02:00
Daniel Hahler
200adac02f doc: note about using multiple versions
Add a note about how to activate/use multiple versions to the main
README, to the "Choosing the Python Version" section.
2014-09-03 02:47:57 +02:00
16 changed files with 219 additions and 21 deletions

View File

@@ -1,5 +1,16 @@
## Version History ## Version History
#### 20141008
* python-build: Add new CPython release; 3.4.2 (#251)
* python-build: Add new CPython release candidates; 3.2.6rc1, 3.3.6rc1 (#248)
#### 20140924
* pyenv: Fix an unintended behavior when user does not have write permission on $PYENV_ROOT (#230)
* pyenv: Fix a zsh completion issue (#232)
* python-build: Add new PyPy release; pypy-2.4.0, pypy-2.4.0-src (#241)
#### 20140825 #### 20140825
* pyenv: Fix zsh completion with multiple words (#215) * pyenv: Fix zsh completion with multiple words (#215)

View File

@@ -126,6 +126,9 @@ reading it from the following sources, in this order:
Python. (In other words, whatever version would run if pyenv weren't in your Python. (In other words, whatever version would run if pyenv weren't in your
`PATH`.) `PATH`.)
**NOTE:** You can activate multiple versions at the same time, e.g. `pyenv
global 3.4.1 2.7.8`. This allows for parallel usage of python2 and python3,
and is required with tools like `tox`.
### Locating the Python Installation ### Locating the Python Installation
@@ -134,7 +137,7 @@ specified, it passes the command along to the corresponding Python
installation. installation.
Each Python version is installed into its own directory under Each Python version is installed into its own directory under
`~/.pyenv/versions`. `~/.pyenv/versions`.
For example, you might have these versions installed: For example, you might have these versions installed:
@@ -165,7 +168,7 @@ https://github.com/yyuu/pyenv-installer
This will get you going with the latest version of pyenv and make it This will get you going with the latest version of pyenv and make it
easy to fork and contribute any changes back upstream. easy to fork and contribute any changes back upstream.
1. **Check out pyenv where you want it installed.** 1. **Check out pyenv where you want it installed.**
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else). A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else).
$ cd $ cd
@@ -173,7 +176,7 @@ easy to fork and contribute any changes back upstream.
2. **Define environment variable `PYENV_ROOT`** to point to the path where 2. **Define environment variable `PYENV_ROOT`** to point to the path where
pyenv repo is cloned and add `$PYENV_ROOT/bin` to your `$PATH` for access pyenv repo is cloned and add `$PYENV_ROOT/bin` to your `$PATH` for access
to the `pyenv` command-line utility. to the `pyenv` command-line utility.
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile $ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
@@ -189,25 +192,25 @@ easy to fork and contribute any changes back upstream.
**Zsh note**: Modify your `~/.zshenv` file instead of `~/.bash_profile`. **Zsh note**: Modify your `~/.zshenv` file instead of `~/.bash_profile`.
**Ubuntu note**: Modify your `~/.bashrc` file instead of `~/.bash_profile`. **Ubuntu note**: Modify your `~/.bashrc` file instead of `~/.bash_profile`.
4. **Restart your shell so the path changes take effect.** 4. **Restart your shell so the path changes take effect.**
You can now begin using pyenv. You can now begin using pyenv.
$ exec $SHELL $ exec $SHELL
5. **Install Python versions into `$PYENV_ROOT/versions`.** 5. **Install Python versions into `$PYENV_ROOT/versions`.**
For example, to install Python 2.7.6, download and unpack the source, then run: For example, to install Python 2.7.6, download and unpack the source, then run:
$ pyenv install 2.7.6 $ pyenv install 2.7.6
**NOTE:** If you need to pass configure option to build, please use **NOTE:** If you need to pass configure option to build, please use
```CONFIGURE_OPTS``` environment variable. ```CONFIGURE_OPTS``` environment variable.
**NOTE:** If you are having trouble installing a python version, **NOTE:** If you are having trouble installing a python version,
please visit the wiki page about please visit the wiki page about
[Common Build Problems](https://github.com/yyuu/pyenv/wiki/Common-build-problems) [Common Build Problems](https://github.com/yyuu/pyenv/wiki/Common-build-problems)
6. **Rebuild the shim binaries.** 6. **Rebuild the shim binaries.**
You should do this any time you install a new Python binary. You should do this any time you install a new Python binary.
(Examples: installing a new Python version, or installing a package that provides a binary.) (Examples: installing a new Python version, or installing a package that provides a binary.)
$ pyenv rehash $ pyenv rehash
@@ -234,7 +237,7 @@ To upgrade to a specific release of pyenv, check out the corresponding tag:
### Homebrew on Mac OS X ### Homebrew on Mac OS X
You can also install pyenv using the [Homebrew](http://brew.sh) You can also install pyenv using the [Homebrew](http://brew.sh)
package manager for Mac OS X. package manager for Mac OS X.
$ brew update $ brew update
@@ -288,8 +291,8 @@ As time goes on, you will accumulate Python versions in your
To remove old Python versions, `pyenv uninstall` command to automate To remove old Python versions, `pyenv uninstall` command to automate
the removal process. the removal process.
Alternatively, simply `rm -rf` the directory of the version you want Alternatively, simply `rm -rf` the directory of the version you want
to remove. You can find the directory of a particular Python version to remove. You can find the directory of a particular Python version
with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`. with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`.
@@ -306,10 +309,10 @@ See [COMMANDS.md](COMMANDS.md).
## Development ## Development
The pyenv source code is [hosted on GitHub](https://github.com/yyuu/pyenv). The pyenv source code is [hosted on GitHub](https://github.com/yyuu/pyenv).
It's clean, modular, and easy to understand--even if you're not a shell hacker. It's clean, modular, and easy to understand--even if you're not a shell hacker.
Please feel free to submit Pull Requests and report bugs on the Please feel free to submit Pull Requests and report bugs on the
[issue tracker](https://github.com/yyuu/pyenv/issues). [issue tracker](https://github.com/yyuu/pyenv/issues).

View File

@@ -14,5 +14,5 @@ _pyenv() {
completions="$(pyenv completions ${words[2,-2]})" completions="$(pyenv completions ${words[2,-2]})"
fi fi
reply=("${(ps:\n:)completions}") reply=(${(ps:\n:)completions})
} }

View File

@@ -12,7 +12,7 @@
set -e set -e
[ -n "$PYENV_DEBUG" ] && set -x [ -n "$PYENV_DEBUG" ] && set -x
version="20140825" version="20141008"
if cd "$PYENV_ROOT" 2>/dev/null; then if cd "$PYENV_ROOT" 2>/dev/null; then
git_revision="$(git describe --tags HEAD 2>/dev/null || true)" git_revision="$(git describe --tags HEAD 2>/dev/null || true)"

View File

@@ -21,7 +21,7 @@ if [ "$1" = "--complete" ]; then
exec pyenv-versions --bare exec pyenv-versions --bare
fi fi
versions=($@) versions=("$@")
PYENV_VERSION_FILE="${PYENV_ROOT}/version" PYENV_VERSION_FILE="${PYENV_ROOT}/version"
if [ -n "$versions" ]; then if [ -n "$versions" ]; then

View File

@@ -33,7 +33,7 @@ if [ "$1" = "--complete" ]; then
exec pyenv-versions --bare exec pyenv-versions --bare
fi fi
versions=($@) versions=("$@")
if [ "$versions" = "--unset" ]; then if [ "$versions" = "--unset" ]; then
rm -f .python-version .pyenv-version rm -f .python-version .pyenv-version

View File

@@ -17,7 +17,8 @@ fi
pyenv-prefix "${versions[@]}" >/dev/null pyenv-prefix "${versions[@]}" >/dev/null
# Write the version out to disk. # Write the version out to disk.
rm -f "$PYENV_VERSION_FILE" # Create an empty file. Using "rm" might cause a permission error.
> "$PYENV_VERSION_FILE"
for version in "${versions[@]}"; do for version in "${versions[@]}"; do
echo "$version" >> "$PYENV_VERSION_FILE" echo "$version" >> "$PYENV_VERSION_FILE"
done done

View File

@@ -0,0 +1,3 @@
require_cc
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.2.6rc1" "https://www.python.org/ftp/python/3.2.6/Python-3.2.6rc1.tgz#b10c473f205793319e41e2855abcf7f46f0f845e6e8e5077183dbc1271c19743" ldflags_dirs standard verify_py32 ensurepip

View File

@@ -0,0 +1,3 @@
require_cc
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.3.6rc1" "https://www.python.org/ftp/python/3.3.6/Python-3.3.6rc1.tgz#1729a43107be4e13b8b4407926557242f2a28a93b97d2d861f8b002257467169" ldflags_dirs standard verify_py33 ensurepip

View File

@@ -0,0 +1,3 @@
require_cc
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.4.2" "https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tgz#44a3c1ef1c7ca3e4fd25242af80ed72da941203cb4ed1a8c1b724d9078965dd8" ldflags_dirs standard verify_py34 ensurepip

View File

@@ -0,0 +1,70 @@
diff -r -u ../Python-3.3.3.orig/Modules/readline.c ./Modules/readline.c
--- ../Python-3.3.3.orig/Modules/readline.c 2013-11-17 16:23:01.000000000 +0900
+++ ./Modules/readline.c 2014-03-29 16:22:10.219305878 +0900
@@ -231,8 +231,7 @@
if (!PyArg_ParseTuple(args, buf, &function))
return NULL;
if (function == Py_None) {
- Py_XDECREF(*hook_var);
- *hook_var = NULL;
+ Py_CLEAR(*hook_var);
}
else if (PyCallable_Check(function)) {
PyObject *tmp = *hook_var;
@@ -774,14 +773,22 @@
}
static int
+#if defined(_RL_FUNCTION_TYPEDEF)
on_startup_hook(void)
+#else
+on_startup_hook()
+#endif
{
return on_hook(startup_hook);
}
#ifdef HAVE_RL_PRE_INPUT_HOOK
static int
+#if defined(_RL_FUNCTION_TYPEDEF)
on_pre_input_hook(void)
+#else
+on_pre_input_hook()
+#endif
{
return on_hook(pre_input_hook);
}
@@ -819,7 +826,7 @@
(r != Py_None && PyLong_AsLong(r) == -1 && PyErr_Occurred())) {
goto error;
}
- Py_XDECREF(r); r=NULL;
+ Py_CLEAR(r);
if (0) {
error:
@@ -877,7 +884,7 @@
* before calling the normal completer */
static char **
-flex_complete(char *text, int start, int end)
+flex_complete(const char *text, int start, int end)
{
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_completion_append_character ='\0';
@@ -936,12 +943,12 @@
rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
/* Set our hook functions */
- rl_startup_hook = (Function *)on_startup_hook;
+ rl_startup_hook = on_startup_hook;
#ifdef HAVE_RL_PRE_INPUT_HOOK
- rl_pre_input_hook = (Function *)on_pre_input_hook;
+ rl_pre_input_hook = on_pre_input_hook;
#endif
/* Set our completion function */
- rl_attempted_completion_function = (CPPFunction *)flex_complete;
+ rl_attempted_completion_function = flex_complete;
/* Set Python word break characters */
completer_word_break_characters =
rl_completer_word_break_characters =

View File

@@ -0,0 +1,50 @@
require_distro() {
if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then
{ echo
colorize 1 "WARNING"
echo ": The binary distribution of PyPy is built for $1."
echo "installed binary may not run expectedly on other platforms."
echo
} >&2
return 1
fi
}
case "$(pypy_architecture 2>/dev/null || true)" in
"linux" )
require_distro "Ubuntu 10.04" || true
install_package "pypy-2.4-beta1-linux" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-linux.tar.bz2#8b63af8791ed7b5316b746af7c9a38f52e92f8153b4e97343778d01b0893ea6d" "pypy" verify_py27 ensurepip
;;
"linux-armel" )
require_distro "Ubuntu 12.04" || true
install_package "pypy-2.4-beta1-linux-armel" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-linux-armel.tar.bz2#429c6439f2492ab5541d95673cc71fd3f6e76f4c9695a047f3d23c25de33c849" "pypy" verify_py27 ensurepip
;;
"linux-armhf" )
if [[ "$(cat /etc/issue 2>/dev/null || true)" == "Raspbian"* ]]; then
install_package "pypy-2.4-beta1-linux-armhf-raspbian" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-linux-armhf-raspbian.tar.bz2#b6f4b253cfbeb4fb6e842ab29d432edefcd6c5f78b6505139d19c84dd4a2839a" "pypy" verify_py27 ensurepip
else
require_distro "Ubuntu 13.04" || true
install_package "pypy-2.4-beta1-linux-armhf-raring" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-linux-armhf-raring.tar.bz2#ecc35b8ef369e3a1686b50de8574cee0b1971d9510a329d7e34851b71d774a71" "pypy" verify_py27 ensurepip
fi
;;
"linux64" )
require_distro "Ubuntu 12.04" || true
install_package "pypy-2.4-beta1-linux64" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-linux64.tar.bz2#b526aa67c2fa84fbda7e36354648369573d4efc4e95b948210f79dc3b3330869" "pypy" verify_py27 ensurepip
;;
"osx64" )
install_package "pypy-2.4-beta1-osx64" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-osx64.tar.bz2#aec6dc3eb1014940ade3b1ff77edb67a1b95e94cee6e9e49ac15b7edeffe92e1" "pypy" verify_py27 ensurepip
;;
"win32" )
# FIXME: never tested on Windows
install_zip "pypy-2.4-beta1-win32" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4-beta1-win32.zip#763952626ffdad105d336b3a28f538c65263502eb08a9c37f073873693f75c32" "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.4-beta1-src' to build from soruce."
echo
} >&2
exit 1
;;
esac

View File

@@ -0,0 +1,2 @@
require_gcc
install_package "pypy-pypy-9f425c60afdf" "https://bitbucket.org/pypy/pypy/get/release-2.4-beta1.tar.bz2#4baa5663872cf47e18fb35232cc70503b087e0d3f927bd4cc4bbf7ef578b13bd" "pypy_builder" verify_py27 ensurepip

View File

@@ -0,0 +1,50 @@
require_distro() {
if [[ "$(cat /etc/issue 2>/dev/null || true)" != "$1"* ]]; then
{ echo
colorize 1 "WARNING"
echo ": The binary distribution of PyPy is built for $1."
echo "installed binary may not run expectedly on other platforms."
echo
} >&2
return 1
fi
}
case "$(pypy_architecture 2>/dev/null || true)" in
"linux" )
require_distro "Ubuntu 10.04" || true
install_package "pypy-2.4.0-linux" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-linux.tar.bz2#a24adb366f87ac0eba829d7188a156a7d897e71893689fab06502c3f4152ac0e" "pypy" verify_py27 ensurepip
;;
"linux-armel" )
require_distro "Ubuntu 12.04" || true
install_package "pypy-2.4.0-linux-armel" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-linux-armel.tar.bz2#8362d634bf86fbfb3b99b578b13c0a9fd673b2b7580d6d65b4a181934c659ccd" "pypy" verify_py27 ensurepip
;;
"linux-armhf" )
if [[ "$(cat /etc/issue 2>/dev/null || true)" == "Raspbian"* ]]; then
install_package "pypy-2.4.0-linux-armhf-raspbian" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-linux-armhf-raspbian.tar.bz2#5e0ba69b28ffbd5b61b0b6be2a130ab0c80e7d2da289d9530b0b6eac4302d5fa" "pypy" verify_py27 ensurepip
else
require_distro "Ubuntu 13.04" || true
install_package "pypy-2.4.0-linux-armhf-raring" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-linux-armhf-raring.tar.bz2#ddbdd6207c41cf82d8c96d52a2a204a2cdada9301cb577f9b323f22394bb1f0a" "pypy" verify_py27 ensurepip
fi
;;
"linux64" )
require_distro "Ubuntu 12.04" || true
install_package "pypy-2.4.0-linux64" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-linux64.tar.bz2#27cdc0d6e8bce2637678f6d076fc780877dffe1bf9aec9e253f95219af9ed099" "pypy" verify_py27 ensurepip
;;
"osx64" )
install_package "pypy-2.4.0-osx64" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-osx64.tar.bz2#3eb8afdfa42bc9b08b4d3058e21d4ce978a52722fdcfdc67d6c3ee5013a51aaa" "pypy" verify_py27 ensurepip
;;
"win32" )
# FIXME: never tested on Windows
install_zip "pypy-2.4.0-win32" "https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-win32.zip#3eb8afdfa42bc9b08b4d3058e21d4ce978a52722fdcfdc67d6c3ee5013a51aaa" "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.4.0-src' to build from soruce."
echo
} >&2
exit 1
;;
esac

View File

@@ -0,0 +1,2 @@
require_gcc
install_package "pypy-pypy-c6ad44ecf5d8" "https://bitbucket.org/pypy/pypy/get/release-2.4.0.tar.bz2#7e0dec2c40106f20f002121bdabb71939915254fb91bd55b01434e4b994113d2" "pypy_builder" verify_py27 ensurepip

View File

@@ -5,7 +5,7 @@ load test_helper
@test "blank invocation" { @test "blank invocation" {
run pyenv run pyenv
assert_success assert_success
assert [ "${lines[0]}" == "pyenv 20140825" ] assert [ "${lines[0]}" == "pyenv 20141008" ]
} }
@test "invalid command" { @test "invalid command" {