mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-09 03:53:48 -05:00
Compare commits
181 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cca008ba04 | ||
|
|
2fd7be0453 | ||
|
|
cdccbd0ba3 | ||
|
|
51c026bf56 | ||
|
|
5d967fa38a | ||
|
|
f03adae58a | ||
|
|
65316a7e99 | ||
|
|
e928e75f22 | ||
|
|
de1f8a7a1d | ||
|
|
7256feeaa8 | ||
|
|
6d4365a696 | ||
|
|
8439f8e187 | ||
|
|
32a86a84c0 | ||
|
|
d5b12f826d | ||
|
|
b6b761f9f1 | ||
|
|
e8f952a5d8 | ||
|
|
864cd79980 | ||
|
|
6d20b3b123 | ||
|
|
fe4eccf3e7 | ||
|
|
f0f2cdd1c6 | ||
|
|
58427b9a5c | ||
|
|
72757562c1 | ||
|
|
fb97a9c2bd | ||
|
|
48b545345e | ||
|
|
45bb60dc39 | ||
|
|
c0fef470cb | ||
|
|
986fe1a749 | ||
|
|
bfe54c9459 | ||
|
|
a43631d7c0 | ||
|
|
a157725dbe | ||
|
|
3a95c969e1 | ||
|
|
0d949796ce | ||
|
|
ee6ef20859 | ||
|
|
7bc426e2be | ||
|
|
3b0ee099a8 | ||
|
|
44db3b03d0 | ||
|
|
49d955d584 | ||
|
|
1e79a5222b | ||
|
|
d29feab2c8 | ||
|
|
a98fee0555 | ||
|
|
7ea0408966 | ||
|
|
42e6409f6c | ||
|
|
6f7a29c3f4 | ||
|
|
8aa8d84e09 | ||
|
|
39f1b141ef | ||
|
|
a55dd92436 | ||
|
|
9f5aa953b4 | ||
|
|
971397dd4e | ||
|
|
867909c933 | ||
|
|
162fea40f7 | ||
|
|
423de9ae8d | ||
|
|
40d35f84b4 | ||
|
|
8675031879 | ||
|
|
381002dbe2 | ||
|
|
2d9e981d60 | ||
|
|
152457a428 | ||
|
|
86ca164a11 | ||
|
|
943c5f995d | ||
|
|
c80b1cdfb9 | ||
|
|
15677f7f5a | ||
|
|
631bf6a23a | ||
|
|
2862858052 | ||
|
|
a7e09ce2ea | ||
|
|
4d56947277 | ||
|
|
07b7471819 | ||
|
|
3d4fc164a2 | ||
|
|
f2925393e4 | ||
|
|
a681e756e1 | ||
|
|
dc3a201301 | ||
|
|
7706a45080 | ||
|
|
23dfe75b73 | ||
|
|
df7ccfe0e8 | ||
|
|
e342d84715 | ||
|
|
e54cd5f49d | ||
|
|
80ec306155 | ||
|
|
a9e11ba164 | ||
|
|
5b7c140f5b | ||
|
|
aebed1c0a4 | ||
|
|
4adc45ef8a | ||
|
|
d79bda4602 | ||
|
|
552d943762 | ||
|
|
663abeb5fa | ||
|
|
748261869a | ||
|
|
54889eb87a | ||
|
|
cfe2aba670 | ||
|
|
009fea2b20 | ||
|
|
6e214570d1 | ||
|
|
abfa1c6d92 | ||
|
|
066c05336f | ||
|
|
1fa027af1e | ||
|
|
a0cc289d15 | ||
|
|
4bbf7d7bb0 | ||
|
|
4b82f575c7 | ||
|
|
c0d8b9cfe8 | ||
|
|
0388da7d0b | ||
|
|
13efdea9ab | ||
|
|
8db91d5516 | ||
|
|
a015760854 | ||
|
|
d4f45b0096 | ||
|
|
444088b1db | ||
|
|
09877f45cb | ||
|
|
f864294e0e | ||
|
|
5963dc4f61 | ||
|
|
0915c5b7b6 | ||
|
|
ed38af6409 | ||
|
|
208be7d6af | ||
|
|
07aa659dbb | ||
|
|
88c3404997 | ||
|
|
3a35f43eb4 | ||
|
|
9a42b48da4 | ||
|
|
f5cc25ed14 | ||
|
|
e0e3244015 | ||
|
|
9c72c27d76 | ||
|
|
483d95d6d2 | ||
|
|
05ca057bb2 | ||
|
|
108a10a198 | ||
|
|
979e6f0a61 | ||
|
|
2a9c18372a | ||
|
|
8315e1528b | ||
|
|
c81a28105f | ||
|
|
d601efa0d5 | ||
|
|
0688b17cc1 | ||
|
|
bb6a747c02 | ||
|
|
681d31bc36 | ||
|
|
3b1bc86031 | ||
|
|
6139b51af4 | ||
|
|
10a8c83888 | ||
|
|
9985f7b436 | ||
|
|
a7895e6ea8 | ||
|
|
7dd48d1665 | ||
|
|
11c54713bb | ||
|
|
3051d21004 | ||
|
|
9ecfdd1073 | ||
|
|
47d3dee0bb | ||
|
|
0a3b72d890 | ||
|
|
f018056165 | ||
|
|
af55330d37 | ||
|
|
0211c345f7 | ||
|
|
2f8c625a7d | ||
|
|
e28661c7e2 | ||
|
|
6882be06a6 | ||
|
|
c6c4e41eb9 | ||
|
|
f504b01818 | ||
|
|
876be1bb04 | ||
|
|
6185bb55e6 | ||
|
|
7f714c34ba | ||
|
|
848e56e992 | ||
|
|
8b07b92c37 | ||
|
|
3a20ce7555 | ||
|
|
0c6ad7c52b | ||
|
|
1bd397112a | ||
|
|
dcfd715603 | ||
|
|
474d7cc066 | ||
|
|
02c44942c6 | ||
|
|
76db37dbfa | ||
|
|
eb89256f59 | ||
|
|
19f74e41f0 | ||
|
|
6c74b616a5 | ||
|
|
8cce6e8dd2 | ||
|
|
03cabd88e9 | ||
|
|
e56962b357 | ||
|
|
cabdc45181 | ||
|
|
7f45f1eb9d | ||
|
|
acc949c27b | ||
|
|
4f689cdf83 | ||
|
|
26134d9b38 | ||
|
|
1c90a0f864 | ||
|
|
90d0d20508 | ||
|
|
58e2087967 | ||
|
|
a65af6570d | ||
|
|
70d7749584 | ||
|
|
9df4524c79 | ||
|
|
f7450587dc | ||
|
|
22e1aa6e9d | ||
|
|
2d64fb1cb9 | ||
|
|
a85875c39e | ||
|
|
8db5778b12 | ||
|
|
c7d8a1c33d | ||
|
|
44b7da194b | ||
|
|
b2eb2d28d1 | ||
|
|
dfeda54079 |
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [pyenv] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: pyenv # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@@ -17,5 +17,5 @@ Make sure you have checked all steps below.
|
|||||||
- [ ] pyenv version:
|
- [ ] pyenv version:
|
||||||
- [ ] Python version:
|
- [ ] Python version:
|
||||||
- [ ] C Compiler information (e.g. gcc 7.3):
|
- [ ] C Compiler information (e.g. gcc 7.3):
|
||||||
- [ ] Please attach verbose build log as gist
|
- [ ] Please attach the debug trace of the failing command as a gist:
|
||||||
* You can turn on verbose debug logging using by setting `PYENV_DEBUG=1`, e.g. `env PYENV_DEBUG=1 pyenv install -v 3.6.4`
|
* Run `env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.log` and attach `trace.log`. E.g. if you have a problem with installing Python, run `env PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log` (note the `-v` option to `pyenv install`).
|
||||||
|
|||||||
38
.github/workflows/macos_build.yml
vendored
Normal file
38
.github/workflows/macos_build.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: macos_build
|
||||||
|
on: [pull_request, push]
|
||||||
|
jobs:
|
||||||
|
macos_build:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version:
|
||||||
|
- 3.7.10
|
||||||
|
- 3.8.10
|
||||||
|
- 3.9.5
|
||||||
|
- 3.10.0
|
||||||
|
runs-on: macos-10.15
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
# Normally, we would use the superbly maintained...
|
||||||
|
# - uses: actions/setup-python@v2
|
||||||
|
# with:
|
||||||
|
# python-version: ${{ matrix.python-version }}
|
||||||
|
# ... but in the repo, we want to test pyenv builds on macOS
|
||||||
|
- run: |
|
||||||
|
brew install openssl readline sqlite3 xz zlib
|
||||||
|
# https://github.com/pyenv/pyenv#installation
|
||||||
|
- run: pwd
|
||||||
|
- env:
|
||||||
|
PYENV_ROOT: /Users/runner/work/pyenv/pyenv
|
||||||
|
run: |
|
||||||
|
echo $PYENV_ROOT
|
||||||
|
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||||
|
bin/pyenv install ${{ matrix.python-version }}
|
||||||
|
bin/pyenv global ${{ matrix.python-version }}
|
||||||
|
bin/pyenv rehash
|
||||||
|
- run: python --version
|
||||||
|
- run: python -m pip --version
|
||||||
|
- shell: python # Prove that actual Python == expected Python
|
||||||
|
env:
|
||||||
|
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||||
|
run: import os, sys ; assert sys.version.startswith(os.getenv("EXPECTED_PYTHON"))
|
||||||
40
.github/workflows/pyenv_tests.yml
vendored
Normal file
40
.github/workflows/pyenv_tests.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: pyenv_tests
|
||||||
|
on: [pull_request, push]
|
||||||
|
jobs:
|
||||||
|
pyenv_tests:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-20.04
|
||||||
|
- ubuntu-18.04
|
||||||
|
- macos-11
|
||||||
|
- macos-10.15
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
# Normally, we would use the superbly maintained...
|
||||||
|
# - uses: actions/setup-python@v2
|
||||||
|
# with:
|
||||||
|
# python-version: ${{ matrix.python-version }}
|
||||||
|
# ... but in the repo, we want to test pyenv builds on Ubuntu
|
||||||
|
# - run: |
|
||||||
|
# sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
|
||||||
|
# libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
|
||||||
|
# xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
|
||||||
|
# https://github.com/pyenv/pyenv#installation
|
||||||
|
- run: |
|
||||||
|
if test "$RUNNER_OS" == "macOS"; then
|
||||||
|
brew install coreutils fish
|
||||||
|
elif [[ $(lsb_release -sr | awk -F. '{print $1}') -ge 20 ]]; then
|
||||||
|
# Ubuntu 18 has fish 2 which lacks many features that facilitate testing
|
||||||
|
sudo apt install fish -yq
|
||||||
|
fi
|
||||||
|
- run: pwd
|
||||||
|
- env:
|
||||||
|
PYENV_ROOT: /home/runner/work/pyenv/pyenv
|
||||||
|
run: |
|
||||||
|
echo $PYENV_ROOT
|
||||||
|
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||||
|
- run: |
|
||||||
|
make test
|
||||||
@@ -1,18 +1,15 @@
|
|||||||
name: ubuntu_tests
|
name: ubuntu_build
|
||||||
on: [pull_request, push]
|
on: [pull_request, push]
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu_tests:
|
ubuntu_build:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- 2.7.18
|
|
||||||
- 3.5.10
|
|
||||||
- 3.6.13
|
|
||||||
- 3.7.10
|
- 3.7.10
|
||||||
- 3.8.10
|
- 3.8.10
|
||||||
- 3.9.5
|
- 3.9.5
|
||||||
- 3.10.0rc1
|
- 3.10.0
|
||||||
runs-on: Ubuntu-20.04
|
runs-on: Ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
121
CHANGELOG.md
121
CHANGELOG.md
@@ -1,5 +1,126 @@
|
|||||||
## Version History
|
## Version History
|
||||||
|
|
||||||
|
## Release 2.3.0
|
||||||
|
|
||||||
|
* Bump openssl 1.1 to 1.1.1n for CPython 3.7 3.8 3.9 (#2276)
|
||||||
|
* Doc Fix: Escape a hash character causing unwanted GitHub Issue linking (#2282)
|
||||||
|
* Add CPython 3.9.12 (#2296)
|
||||||
|
* Add CPython 3.10.4 (#2295)
|
||||||
|
* Add patch for 3.6.15 to support Xcode 13.3 (#2288)
|
||||||
|
* Add patch for 3.7.12 to support Xcode 13.3 (#2292)
|
||||||
|
* Add CONTRIBUTING.md (#2287)
|
||||||
|
* Add PyPy 7.3.9 release 2022-03-30 (#2308)
|
||||||
|
* Add Pyston 2.3.3 (#2316)
|
||||||
|
* Add CPython 3.11.0a7 (#2315)
|
||||||
|
* Add "nogil" Python v3.9.10 (#2342)
|
||||||
|
* Support XCode 13.3 in all releases that officially support MacOS 11 (#2344)
|
||||||
|
* Add GraalPython 22.1.0 (#2346)
|
||||||
|
* Make PYENV_DEBUG imply -v for `pyenv install` (#2347)
|
||||||
|
* Simplify init scheme (#2310)
|
||||||
|
* Don't use Homebrew outside of MacOS (#2349)
|
||||||
|
* Add `:latest` syntax to documentation for the `install` command (#2351)
|
||||||
|
|
||||||
|
## Release 2.2.5
|
||||||
|
|
||||||
|
* Add CPython 3.10.3
|
||||||
|
* Add CPython 3.9.11
|
||||||
|
* Add CPython 3.8.13
|
||||||
|
* Add CPython 3.7.13
|
||||||
|
* Add CPython 3.11.0a6 (#2266)
|
||||||
|
* Add PyPy 7.3.8 (#2253)
|
||||||
|
* Add miniconda3-3.7-4.11.0, miniconda3-3.8-4.11.0, miniconda3-3.9-4.11.0 (#2268)
|
||||||
|
* Add pyston-2.3.2 (#2240)
|
||||||
|
* Fix UnicodeDecodeError for CPython 3.6.15 and 3.7.12 (#2237)
|
||||||
|
* python-build: add URL for get-pip for Python 3.6 (#2238)
|
||||||
|
* Bump openssl to 1.1.1n for CPython 3.10.x
|
||||||
|
|
||||||
|
## Release 2.2.4
|
||||||
|
|
||||||
|
* Added docstrings to several undocumented functions (#2197)
|
||||||
|
* Fix incorrect pypy 2.7-7.3.6 sha256 hashes (#2208)
|
||||||
|
* Fix a regression in include paths when compiling ctypes in 3.6.15/3.7.12 (#2209)
|
||||||
|
* Revert "Disable coreutils on M1 Apple Silicon with arm64 (#2020)" (#2212)
|
||||||
|
* CPython 3.11.0a4 (#2217)
|
||||||
|
* CPython 3.9.10 and 3.10.2 (#2219)
|
||||||
|
* miniconda3-latest: added Linux-aarch64 (#2221)
|
||||||
|
* Add GraalPython 22.0.0 (#2226)
|
||||||
|
|
||||||
|
|
||||||
|
## Release 2.2.3
|
||||||
|
|
||||||
|
* Add new pypy versions (pypy2.7-7.3.2~7.3.5) to the version list (#2194)
|
||||||
|
* Fix Python 3.7.12 compilation on macOS arm64/M1. (#2190)
|
||||||
|
* Fix Python 3.6.15 compilation on macOS arm64/M1. (#2189)
|
||||||
|
* Add Anaconda3-2021.11 (#2193)
|
||||||
|
* CPython 3.11.0a3 (#2187)
|
||||||
|
* Fix errant "echo" in README install instructions (#2185)
|
||||||
|
* Add Miniforge and Mambaforge 4.10.3-10 (#2184)
|
||||||
|
* Add CPython 3.10.1 (#2183)
|
||||||
|
* Fix 3.6.15 build on macOS (#2182)
|
||||||
|
|
||||||
|
## Release 2.2.2
|
||||||
|
|
||||||
|
* Add support for macOS Apple M1 (#2164)
|
||||||
|
|
||||||
|
## Release 2.2.1
|
||||||
|
|
||||||
|
* Add CPython 3.9.9 (#2162)
|
||||||
|
* Add CPython 3.9.8 (#2152)
|
||||||
|
* Add Add micropython 1.17 (#2158)
|
||||||
|
* Add Add micropython 1.16 (#2158)
|
||||||
|
* Patch 3.10.0 configure, fixes https://bugs.python.org/issue45350 (#2155)
|
||||||
|
* Use command and type instead of which (#2144)
|
||||||
|
* Add definition of pyenv help in COMMANDS.md #2139
|
||||||
|
* Use OpenSSL 1.0 for CPython 2.7.18
|
||||||
|
|
||||||
|
## Release 2.2.0
|
||||||
|
* Adding PyPy release 7.3.7 (Python 3.7 and 3.8). (#2132)
|
||||||
|
* Append Homebrew custom prefix to search path (#1957)
|
||||||
|
* Add documentation for init command (#2125)
|
||||||
|
* Add setup instructions for the case when one installs Pyenv as part of a batch job (#2127)
|
||||||
|
* Add documentation for completions command (#2126)
|
||||||
|
* Default --with-universal-archs to universal2 on Apple Silicon (#2122)
|
||||||
|
* Update README.md (#2120)
|
||||||
|
* Add GraalPython 21.3.0 (#2117)
|
||||||
|
* Pypy ver 7.3.6 - python 3.7 and python 3.8 (#2111)
|
||||||
|
* Discover Tcl/Tk reliably and use active version (#2106)
|
||||||
|
* Fish installation instructions (#2104)
|
||||||
|
* Add CPython 3.11.0a1 (#2099)
|
||||||
|
|
||||||
|
## Release 2.1.0
|
||||||
|
* Fix mambaforge-pypy3 build (#2096)
|
||||||
|
* Add Python 3.10.0 (#2093)
|
||||||
|
* Add documentation for exec command (#2090)
|
||||||
|
* Add documentation for shims command (#2091)
|
||||||
|
* Add documentation for hooks command (#2089)
|
||||||
|
* Add documentation for root command (#2088)
|
||||||
|
* Add documentaion for prefix command (#2087)
|
||||||
|
* Update to Pyston's v2 package of the 2.3.1 release (#2078)
|
||||||
|
* Add pyston-2.3.1 support (#2075)
|
||||||
|
* Don't update conda when installing pip (#2074)
|
||||||
|
* Improve `add_miniconda.py` (#2072)
|
||||||
|
* GitHub actions tests (#2073)
|
||||||
|
* Fix sed commands (#2071)
|
||||||
|
* macOS: fix the build of Python 2.7.18 on macOS 11.5.2 (Big Sur) + Apple Silicon (#2061)
|
||||||
|
|
||||||
|
## Release 2.0.7
|
||||||
|
* Update setup instructions in the Readme (#2067)
|
||||||
|
* Allow tcl-tk as argument or try with homebrew by default (#1646)
|
||||||
|
* Allow system Python in sbin (#2065)
|
||||||
|
* Prevent addition of duplicate plugin dirs to PATH (#2045)
|
||||||
|
* Disable coreutils on M1 Apple Silicon with arm64 (#2020)
|
||||||
|
* Add Python 3.10.0rc2 (#2053)
|
||||||
|
* Add space after `yes/no` prompt (#2040)
|
||||||
|
* Add CPython v3.6.15 and v3.7.12 (#2052)
|
||||||
|
* Add missing Python 2.6.x definitions and patches (#2051)
|
||||||
|
* Fix build of ossaudiodev in Linux/FreeBSD for Python 2.6 (#2049)
|
||||||
|
* Fix build of ossaudiodev in Linux/FreeBSD for Python 3.1 (#2047)
|
||||||
|
|
||||||
|
## Release 2.0.6
|
||||||
|
* Add CPython 3.9.7 (#2044)
|
||||||
|
* Add CPython v3.8.12 (#2043)
|
||||||
|
* Adapt conda.bash for bash associative array (#2037)
|
||||||
|
|
||||||
## Release 2.0.5
|
## Release 2.0.5
|
||||||
|
|
||||||
* Move man page to location where it can be automatically found by man (#2032)
|
* Move man page to location where it can be automatically found by man (#2032)
|
||||||
|
|||||||
100
COMMANDS.md
100
COMMANDS.md
@@ -5,6 +5,7 @@ first argument.
|
|||||||
|
|
||||||
The most common subcommands are:
|
The most common subcommands are:
|
||||||
|
|
||||||
|
* [`pyenv help`](#pyenv-help)
|
||||||
* [`pyenv commands`](#pyenv-commands)
|
* [`pyenv commands`](#pyenv-commands)
|
||||||
* [`pyenv local`](#pyenv-local)
|
* [`pyenv local`](#pyenv-local)
|
||||||
* [`pyenv global`](#pyenv-global)
|
* [`pyenv global`](#pyenv-global)
|
||||||
@@ -16,6 +17,17 @@ The most common subcommands are:
|
|||||||
* [`pyenv versions`](#pyenv-versions)
|
* [`pyenv versions`](#pyenv-versions)
|
||||||
* [`pyenv which`](#pyenv-which)
|
* [`pyenv which`](#pyenv-which)
|
||||||
* [`pyenv whence`](#pyenv-whence)
|
* [`pyenv whence`](#pyenv-whence)
|
||||||
|
* [`pyenv exec`](#pyenv-exec)
|
||||||
|
* [`pyenv root`](#pyenv-root)
|
||||||
|
* [`pyenv prefix`](#pyenv-prefix)
|
||||||
|
* [`pyenv hooks`](#pyenv-hooks)
|
||||||
|
* [`pyenv shims`](#pyenv-shims)
|
||||||
|
* [`pyenv init`](#pyenv-init)
|
||||||
|
* [`pyenv completions`](#pyenv-completions)
|
||||||
|
|
||||||
|
## `pyenv help`
|
||||||
|
|
||||||
|
List all available pyenv commands along with a brief description of what they do. Run `pyenv help <command>` for information on a specific command. For full documentation, see: https://github.com/pyenv/pyenv#readme
|
||||||
|
|
||||||
|
|
||||||
## `pyenv commands`
|
## `pyenv commands`
|
||||||
@@ -216,6 +228,14 @@ Then install the desired versions:
|
|||||||
2.6.8
|
2.6.8
|
||||||
* 2.7.6 (set by /home/yyuu/.pyenv/version)
|
* 2.7.6 (set by /home/yyuu/.pyenv/version)
|
||||||
|
|
||||||
|
To install the latest version of Python without giving a specific version use the `:latest` syntax. For example, to install the latest patch version for Python 3.8 you could do:
|
||||||
|
|
||||||
|
pyenv install 3.8:latest
|
||||||
|
|
||||||
|
To install the latest major release for Python 3 try:
|
||||||
|
|
||||||
|
pyenv install 3:latest
|
||||||
|
|
||||||
## `pyenv uninstall`
|
## `pyenv uninstall`
|
||||||
|
|
||||||
Uninstall a specific Python version.
|
Uninstall a specific Python version.
|
||||||
@@ -278,3 +298,83 @@ Lists all Python versions with the given command installed.
|
|||||||
2.6.8
|
2.6.8
|
||||||
2.7.6
|
2.7.6
|
||||||
3.3.3
|
3.3.3
|
||||||
|
|
||||||
|
## `pyenv exec`
|
||||||
|
|
||||||
|
Usage: pyenv exec <command> [arg1 arg2...]
|
||||||
|
|
||||||
|
Runs an executable by first preparing PATH so that the selected Python
|
||||||
|
version's `bin` directory is at the front.
|
||||||
|
|
||||||
|
For example, if the currently selected Python version is 3.9.7:
|
||||||
|
|
||||||
|
pyenv exec pip install -r requirements.txt
|
||||||
|
|
||||||
|
is equivalent to:
|
||||||
|
|
||||||
|
PATH="$PYENV_ROOT/versions/3.9.7/bin:$PATH" pip install -r requirements.txt
|
||||||
|
|
||||||
|
## `pyenv root`
|
||||||
|
|
||||||
|
Displays the root directory where versions and shims are kept.
|
||||||
|
|
||||||
|
$ pyenv root
|
||||||
|
/home/user/.pyenv
|
||||||
|
|
||||||
|
## `pyenv prefix`
|
||||||
|
|
||||||
|
Displays the directories where the given Python versions are installed,
|
||||||
|
separated by colons. If no version is given, `pyenv prefix` displays the
|
||||||
|
locations of the currently selected versions.
|
||||||
|
|
||||||
|
$ pyenv prefix 3.9.7
|
||||||
|
/home/user/.pyenv/versions/3.9.7
|
||||||
|
|
||||||
|
## `pyenv hooks`
|
||||||
|
|
||||||
|
Lists installed hook scripts for a given pyenv command.
|
||||||
|
|
||||||
|
Usage: pyenv hooks <command>
|
||||||
|
|
||||||
|
## `pyenv shims`
|
||||||
|
|
||||||
|
List existing pyenv shims.
|
||||||
|
|
||||||
|
Usage: pyenv shims [--short]
|
||||||
|
|
||||||
|
$ pyenv shims
|
||||||
|
/home/user/.pyenv/shims/2to3
|
||||||
|
/home/user/.pyenv/shims/2to3-3.9
|
||||||
|
/home/user/.pyenv/shims/idle
|
||||||
|
/home/user/.pyenv/shims/idle3
|
||||||
|
/home/user/.pyenv/shims/idle3.9
|
||||||
|
/home/user/.pyenv/shims/pip
|
||||||
|
/home/user/.pyenv/shims/pip3
|
||||||
|
/home/user/.pyenv/shims/pip3.9
|
||||||
|
/home/user/.pyenv/shims/pydoc
|
||||||
|
/home/user/.pyenv/shims/pydoc3
|
||||||
|
/home/user/.pyenv/shims/pydoc3.9
|
||||||
|
/home/user/.pyenv/shims/python
|
||||||
|
/home/user/.pyenv/shims/python3
|
||||||
|
/home/user/.pyenv/shims/python3.9
|
||||||
|
/home/user/.pyenv/shims/python3.9-config
|
||||||
|
/home/user/.pyenv/shims/python3.9-gdb.py
|
||||||
|
/home/user/.pyenv/shims/python3-config
|
||||||
|
/home/user/.pyenv/shims/python-config
|
||||||
|
|
||||||
|
## `pyenv init`
|
||||||
|
|
||||||
|
Configure the shell environment for pyenv
|
||||||
|
|
||||||
|
Usage: eval "$(pyenv init [-|--path] [--no-rehash] [<shell>])"
|
||||||
|
|
||||||
|
- Initialize shims directory, print PYENV_SHELL variable, completions path
|
||||||
|
and shell function
|
||||||
|
--path Print shims path
|
||||||
|
--no-rehash Add no rehash command to output
|
||||||
|
|
||||||
|
## `pyenv completions`
|
||||||
|
|
||||||
|
Lists available completions for a given pyenv command.
|
||||||
|
|
||||||
|
Usage: pyenv completions <command> [arg1 arg2...]
|
||||||
|
|||||||
104
CONTRIBUTING.md
Normal file
104
CONTRIBUTING.md
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
General guidance
|
||||||
|
================
|
||||||
|
|
||||||
|
* The usual principes of respecting existing conventions and making sure that your changes
|
||||||
|
are in line with the overall product design apply when contributing code to Pyenv.
|
||||||
|
|
||||||
|
* We are limited to Bash 3.2 features
|
||||||
|
|
||||||
|
That's because that's the version shipped with MacOS.
|
||||||
|
(They didn't upgrade past it and switched to Zsh because later versions
|
||||||
|
are covered by GPLv3 which has additional restrictions unacceptable for Apple.)
|
||||||
|
|
||||||
|
* Be extra careful when submitting logic specific for the Apple Silicon platform
|
||||||
|
|
||||||
|
As of this writing, Github Actions do not support it and only one team member has the necessary hardware.
|
||||||
|
So we may be unable to test your changes and may have to take your word for it.
|
||||||
|
|
||||||
|
|
||||||
|
Formatting PRs
|
||||||
|
==============
|
||||||
|
|
||||||
|
We strive to keep commit history one-concern-per-commit to keep it meaningful and easy to follow.
|
||||||
|
If a pull request (PR) addresses a single concern (the typical case), we usually squash commits
|
||||||
|
from it together when merging so its commit history doesn't matter.
|
||||||
|
If however a PR addresses multiple separate concerns, each of them should be presented as a separate commit.
|
||||||
|
Adding multiple new Python releases of the same flavor is okay with either a single or multiple commits.
|
||||||
|
|
||||||
|
|
||||||
|
Authoring installation scripts
|
||||||
|
==============================
|
||||||
|
|
||||||
|
Adding new Python release support
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
The easiest way to add support for a new Python release is to copy the script from the previous one
|
||||||
|
and adjust it as necessary. In many cases, just changing version numbers, URLs and hashes is enough.
|
||||||
|
Do pay attention to other "magic numbers" that may be present in a script --
|
||||||
|
e.g. the set of architectures and OS versions supported by a release -- since those change from time to time, too.
|
||||||
|
|
||||||
|
Make sure to also copy any patches for the previous release that still apply to the new one.
|
||||||
|
Typically, a patch no longer applies if it addresses a problem that's already fixed in the new release.
|
||||||
|
|
||||||
|
For prereleases, we only create an entry for the latest prerelease in a specific version line.
|
||||||
|
When submitting a newer prerelease, replace the older one.
|
||||||
|
|
||||||
|
|
||||||
|
Adding version-specific fixes/patches
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
We accept fixes to issues in specific Python releases that prevent users from using them with Pyenv.
|
||||||
|
|
||||||
|
In the default configuration for a Python release, we strive to provide as close to vanilla experience as practical,
|
||||||
|
to maintain [the principle of the least surprise](https://en.wikipedia.org/wiki/Principle_of_least_astonishment).
|
||||||
|
As such, any such fixes:
|
||||||
|
|
||||||
|
* Must not break or degrade (e.g. disable features) the build in any of the environments that the release officially supports
|
||||||
|
* Must not introduce incompatibilities with the vanilla release (including binary incompatibilities)
|
||||||
|
* Should not patch things unnecessarily, to minimize the risk of the aforementioned undesirable side effects.
|
||||||
|
* E.g. if the fix is for a specific environment, its logic ought to only fire in this specific environment and not touch execution paths for other environments.
|
||||||
|
* As such, it's advisable to briefly explain in the PR what each added patch does and why it is necessary to fix the declared problem
|
||||||
|
|
||||||
|
Generally, version-specific fixes belong in the scripts for the affected releases and/or patches for them -- this guarantees that their effect is limited to only those releases.
|
||||||
|
|
||||||
|
<h3>Backporting upstream patches</h3>
|
||||||
|
|
||||||
|
Usually, this is the easiest way to backport a fix for a problem that is fixed in a newer release.
|
||||||
|
|
||||||
|
* Clone Python, check out the tag for the appropriate release and create a branch
|
||||||
|
* Apply existing patches if there are any (with either `patch` or `git am`) and commit
|
||||||
|
* Cherry-pick the upstream commit that fixes the problem in a newer release
|
||||||
|
* Commit and `git format-patch`
|
||||||
|
* Commit the generated patch file into Pyenv, test your changes and submit a PR
|
||||||
|
|
||||||
|
|
||||||
|
Deprecation policy
|
||||||
|
------------------
|
||||||
|
|
||||||
|
We do not provide official support for EOL releases and environments or otherwise provide any kind of extended support for old Python releases.
|
||||||
|
|
||||||
|
We do however accept fixes from interested parties that would allow running older, including EOL, releases in newer environments.
|
||||||
|
In addition to the above general requirements for release-specific fixes,
|
||||||
|
|
||||||
|
* Such a fix must not add maintenance burden (e.g. add new logic to `python-build` that has to be kept there indefinitely)
|
||||||
|
* Unless the added logic is useful for both EOL and non-EOL releases. In this case, it will be considered as being primarily an improvement for non-EOL releases.
|
||||||
|
* We do not provide any guarantees from our side that any such fix works or will continue working going forward. It's up to the interested parties to maintain it.
|
||||||
|
|
||||||
|
|
||||||
|
Advanced changes / adding new Python flavor support
|
||||||
|
---------------------------------------------------
|
||||||
|
|
||||||
|
An installation script is sourced from `python-build`. All installation scripts are based on the same logic:
|
||||||
|
|
||||||
|
1. Select the source to download and other variable parameters as needed.
|
||||||
|
|
||||||
|
This includes showing an error if the user's environment (OS, architecture) is not supported by the release.
|
||||||
|
Binary releases that only officially support specific distro(s) typically show a warning in other distros instead.
|
||||||
|
|
||||||
|
2. Run one of the `install_*` shell functions
|
||||||
|
|
||||||
|
`install_*` shell functions defined in `python-build` install Python from different kinds of sources -- compressed package (binary or source), upstream installation script, VCS checkout. Pick one that's the most appropriate for your packaging.
|
||||||
|
|
||||||
|
Each of them accepts a couple of function-specific arguments which are followed by arguments that constitute the build sequence. Each `<argument>` in the build sequence corresponds to the `install_*_<argument>` function in `python-build`. Check what's available and add any functions with logic specific to your flavor if needed.
|
||||||
|
|
||||||
|
We strive to keep out of `python-build` parts of build logic that are release-specific and/or tend to change abruptly between releases -- e.g. sets of supported architectures and other software's versions. This results in logic duplication between installation scripts -- but since old releases never change once released, this doesn't really add to the maintenance burden. As a rule of thumb, `python-build` can host parts of logic that are expected to stay the same for an indefinite amount of time -- for an entire Python flavor or release line.
|
||||||
508
README.md
508
README.md
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
[](https://gitter.im/yyuu/pyenv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://gitter.im/yyuu/pyenv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
[](https://travis-ci.org/pyenv/pyenv)
|
|
||||||
|
|
||||||
pyenv lets you easily switch between multiple versions of Python. It's
|
pyenv lets you easily switch between multiple versions of Python. It's
|
||||||
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
||||||
tools that do one thing well.
|
tools that do one thing well.
|
||||||
@@ -14,13 +12,13 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
### pyenv _does..._
|
### What pyenv _does..._
|
||||||
|
|
||||||
* Let you **change the global Python version** on a per-user basis.
|
* Lets you **change the global Python version** on a per-user basis.
|
||||||
* Provide support for **per-project Python versions**.
|
* Provides support for **per-project Python versions**.
|
||||||
* Allow you to **override the Python version** with an environment
|
* Allows you to **override the Python version** with an environment
|
||||||
variable.
|
variable.
|
||||||
* Search commands from **multiple versions of Python at a time**.
|
* Searches for commands from **multiple versions of Python at a time**.
|
||||||
This may be helpful to test across Python versions with [tox](https://pypi.python.org/pypi/tox).
|
This may be helpful to test across Python versions with [tox](https://pypi.python.org/pypi/tox).
|
||||||
|
|
||||||
|
|
||||||
@@ -29,12 +27,11 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
|||||||
* **Depend on Python itself.** pyenv was made from pure shell scripts.
|
* **Depend on Python itself.** pyenv was made from pure shell scripts.
|
||||||
There is no bootstrap problem of Python.
|
There is no bootstrap problem of Python.
|
||||||
* **Need to be loaded into your shell.** Instead, pyenv's shim
|
* **Need to be loaded into your shell.** Instead, pyenv's shim
|
||||||
approach works by adding a directory to your `$PATH`.
|
approach works by adding a directory to your `PATH`.
|
||||||
* **Manage virtualenv.** Of course, you can create [virtualenv](https://pypi.python.org/pypi/virtualenv)
|
* **Manage virtualenv.** Of course, you can create [virtualenv](https://pypi.python.org/pypi/virtualenv)
|
||||||
yourself, or [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
|
yourself, or [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
|
||||||
to automate the process.
|
to automate the process.
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
||||||
@@ -43,15 +40,27 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
|||||||
* **[How It Works](#how-it-works)**
|
* **[How It Works](#how-it-works)**
|
||||||
* [Understanding PATH](#understanding-path)
|
* [Understanding PATH](#understanding-path)
|
||||||
* [Understanding Shims](#understanding-shims)
|
* [Understanding Shims](#understanding-shims)
|
||||||
* [Choosing the Python Version](#choosing-the-python-version)
|
* [Understanding Python version selection](#understanding-python-version-selection)
|
||||||
* [Locating the Python Installation](#locating-the-python-installation)
|
* [Locating Pyenv-provided Python Installations](#locating-pyenv-provided-python-installations)
|
||||||
* **[Installation](#installation)**
|
* **[Installation](#installation)**
|
||||||
|
* [Getting Pyenv](#getting-pyenv)
|
||||||
|
* [Homebrew in macOS](#homebrew-in-macos)
|
||||||
|
* [Windows](#windows)
|
||||||
|
* [Automatic installer](#automatic-installer)
|
||||||
* [Basic GitHub Checkout](#basic-github-checkout)
|
* [Basic GitHub Checkout](#basic-github-checkout)
|
||||||
* [Upgrading](#upgrading)
|
* [Set up your shell environment for Pyenv](#set-up-your-shell-environment-for-pyenv)
|
||||||
* [Homebrew on macOS](#homebrew-on-macos)
|
* [Restart your shell](#restart-your-shell)
|
||||||
* [Advanced Configuration](#advanced-configuration)
|
* [Install Python build dependencies](#install-python-build-dependencies)
|
||||||
* [Uninstalling Python Versions](#uninstalling-python-versions)
|
* **[Usage](#usage)**
|
||||||
* **[Command Reference](#command-reference)**
|
* [Install additional Python versions](#install-additional-python-versions)
|
||||||
|
* [Switch between Python versions](#switch-between-python-versions)
|
||||||
|
* [Uninstall Python versions](#uninstall-python-versions)
|
||||||
|
* [Other operations](#other-operations)
|
||||||
|
* [Upgrading](#upgrading)
|
||||||
|
* [Uninstalling pyenv](#uninstalling-pyenv)
|
||||||
|
* [Advanced Configuration](#advanced-configuration)
|
||||||
|
* [Using Pyenv without shims](#using-pyenv-without-shims)
|
||||||
|
* [Environment variables](#environment-variables)
|
||||||
* **[Development](#development)**
|
* **[Development](#development)**
|
||||||
* [Version History](#version-history)
|
* [Version History](#version-history)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
@@ -67,6 +76,7 @@ executables injected into your `PATH`, determines which Python version
|
|||||||
has been specified by your application, and passes your commands along
|
has been specified by your application, and passes your commands along
|
||||||
to the correct Python installation.
|
to the correct Python installation.
|
||||||
|
|
||||||
|
|
||||||
### Understanding PATH
|
### Understanding PATH
|
||||||
|
|
||||||
When you run a command like `python` or `pip`, your operating system
|
When you run a command like `python` or `pip`, your operating system
|
||||||
@@ -82,6 +92,7 @@ precedence over another one at the end. In this example, the
|
|||||||
`/usr/local/bin` directory will be searched first, then `/usr/bin`,
|
`/usr/local/bin` directory will be searched first, then `/usr/bin`,
|
||||||
then `/bin`.
|
then `/bin`.
|
||||||
|
|
||||||
|
|
||||||
### Understanding Shims
|
### Understanding Shims
|
||||||
|
|
||||||
pyenv works by inserting a directory of _shims_ at the front of your
|
pyenv works by inserting a directory of _shims_ at the front of your
|
||||||
@@ -102,7 +113,8 @@ operating system will do the following:
|
|||||||
* Run the shim named `pip`, which in turn passes the command along to
|
* Run the shim named `pip`, which in turn passes the command along to
|
||||||
pyenv
|
pyenv
|
||||||
|
|
||||||
### Choosing the Python Version
|
|
||||||
|
### Understanding Python version selection
|
||||||
|
|
||||||
When you execute a shim, pyenv determines which Python version to use by
|
When you execute a shim, pyenv determines which Python version to use by
|
||||||
reading it from the following sources, in this order:
|
reading it from the following sources, in this order:
|
||||||
@@ -120,25 +132,45 @@ reading it from the following sources, in this order:
|
|||||||
directory, until reaching the root of your filesystem.
|
directory, until reaching the root of your filesystem.
|
||||||
|
|
||||||
4. The global `$(pyenv root)/version` file. You can modify this file using
|
4. The global `$(pyenv root)/version` file. You can modify this file using
|
||||||
the [`pyenv global`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global) command. If the global version
|
the [`pyenv global`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global) command.
|
||||||
file is not present, pyenv assumes you want to use the "system"
|
If the global version file is not present, pyenv assumes you want to use the "system"
|
||||||
Python. (In other words, whatever version would run if pyenv weren't in your
|
Python (see below).
|
||||||
`PATH`.)
|
|
||||||
|
A special version name "`system`" means to use whatever Python is found on `PATH`
|
||||||
|
after the shims `PATH` entry (in other words, whatever would be run if Pyenv
|
||||||
|
shims weren't on `PATH`). Note that Pyenv considers those installations outside
|
||||||
|
its control and does not attempt to inspect or distinguish them in any way.
|
||||||
|
So e.g. if you are on MacOS and have OS-bundled Python 3.8.9 and Homebrew-installed
|
||||||
|
Python 3.9.12 and 3.10.2 -- for Pyenv, this is still a single "`system`" version,
|
||||||
|
and whichever of those is first on `PATH` under the executable name you
|
||||||
|
specified will be run.
|
||||||
|
|
||||||
**NOTE:** You can activate multiple versions at the same time, including multiple
|
**NOTE:** You can activate multiple versions at the same time, including multiple
|
||||||
versions of Python2 or Python3 simultaneously. This allows for parallel usage of
|
versions of Python2 or Python3 simultaneously. This allows for parallel usage of
|
||||||
Python2 and Python3, and is required with tools like `tox`. For example, to set
|
Python2 and Python3, and is required with tools like `tox`. For example, to instruct
|
||||||
your path to first use your `system` Python and Python3 (set to 2.7.9 and 3.4.2
|
Pyenv to first use your system Python and Python3 (which are e.g. 2.7.9 and 3.4.2)
|
||||||
in this example), but also have Python 3.3.6, 3.2, and 2.5 available on your
|
but also have Python 3.3.6, 3.2.1, and 2.5.2 available, you first `pyenv install`
|
||||||
`PATH`, one would first `pyenv install` the missing versions, then set `pyenv
|
the missing versions, then set `pyenv global system 3.3.6 3.2.1 2.5.2`.
|
||||||
global system 3.3.6 3.2 2.5`. At this point, one should be able to find the full
|
Then you'll be able to invoke any of those versions with an appropriate `pythonX` or
|
||||||
executable path to each of these using `pyenv which`, e.g. `pyenv which python2.5`
|
`pythonX.Y` name.
|
||||||
(should display `$(pyenv root)/versions/2.5/bin/python2.5`), or `pyenv which
|
You can also specify multiple versions in a `.python-version` file by hand,
|
||||||
python3.4` (should display path to system Python3). You can also specify multiple
|
separated by newlines. Lines starting with a `#` are ignored.
|
||||||
versions in a `.python-version` file, separated by newlines.
|
|
||||||
Lines starting with a `#` are ignored.
|
|
||||||
|
|
||||||
### Locating the Python Installation
|
[`pyenv which <command>`](COMMANDS.md#pyenv-which) displays which real executable would be
|
||||||
|
run when you invoke `<command>` via a shim.
|
||||||
|
E.g. if you have 3.3.6, 3.2.1 and 2.5.2 installed of which 3.3.6 and 2.5.2 are selected
|
||||||
|
and your system Python is 3.2.5,
|
||||||
|
`pyenv which python2.5` should display `$(pyenv root)/versions/2.5.2/bin/python2.5`,
|
||||||
|
`pyenv which python3` -- `$(pyenv root)/versions/3.3.6/bin/python3` and
|
||||||
|
`pyenv which python3.2` -- path to your system Python due to the fall-through (see below).
|
||||||
|
|
||||||
|
Shims also fall through to anything further on `PATH` if the corresponding executable is
|
||||||
|
not present in any of the selected Python installations.
|
||||||
|
This allows you to use any programs installed elsewhere on the system as long as
|
||||||
|
they are not shadowed by a selected Python installation.
|
||||||
|
|
||||||
|
|
||||||
|
### Locating Pyenv-provided Python installations
|
||||||
|
|
||||||
Once pyenv has determined which version of Python your application has
|
Once pyenv has determined which version of Python your application has
|
||||||
specified, it passes the command along to the corresponding Python
|
specified, it passes the command along to the corresponding Python
|
||||||
@@ -156,220 +188,262 @@ For example, you might have these versions installed:
|
|||||||
As far as Pyenv is concerned, version names are simply directories under
|
As far as Pyenv is concerned, version names are simply directories under
|
||||||
`$(pyenv root)/versions`.
|
`$(pyenv root)/versions`.
|
||||||
|
|
||||||
### Managing Virtual Environments
|
|
||||||
|
|
||||||
There is a pyenv plugin named [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) which comes with various features to help pyenv users to manage virtual environments created by virtualenv or Anaconda.
|
|
||||||
Because the `activate` script of those virtual environments are relying on mutating `$PATH` variable of user's interactive shell, it will intercept pyenv's shim style command execution hooks.
|
|
||||||
We'd recommend to install pyenv-virtualenv as well if you have some plan to play with those virtual environments.
|
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Prerequisites:
|
### Getting Pyenv
|
||||||
|
#### Homebrew in macOS
|
||||||
For pyenv to install python correctly you should [**install the Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment).
|
|
||||||
|
|
||||||
### Homebrew on macOS
|
|
||||||
|
|
||||||
1. Consider installing with [Homebrew](https://brew.sh):
|
1. Consider installing with [Homebrew](https://brew.sh):
|
||||||
```sh
|
```sh
|
||||||
brew update
|
brew update
|
||||||
brew install pyenv
|
brew install pyenv
|
||||||
```
|
```
|
||||||
2. Then follow the rest of the post-installation steps under [Basic GitHub Checkout](https://github.com/pyenv/pyenv#basic-github-checkout), starting with #2 ("Configure your shell's environment for Pyenv").
|
2. Then follow the rest of the post-installation steps, starting with
|
||||||
|
[Set up your shell environment for Pyenv](#set-up-your-shell-environment-for-pyenv).
|
||||||
|
|
||||||
If you're on Windows, consider using @kirankotari's [`pyenv-win`](https://github.com/pyenv-win/pyenv-win) fork. (Pyenv does not work in Windows outside the Windows Subsystem for Linux.)
|
3. OPTIONAL. To fix `brew doctor`'s warning _""config" scripts exist outside your system or Homebrew directories"_
|
||||||
|
|
||||||
### The automatic installer
|
If you're going to build Homebrew formulae from source that link against Python
|
||||||
|
like Tkinter or NumPy
|
||||||
|
_(This is only generally the case if you are a developer of such a formula,
|
||||||
|
or if you have an EOL version of MacOS for which prebuilt bottles are no longer provided
|
||||||
|
and you are using such a formula)._
|
||||||
|
|
||||||
|
To avoid them accidentally linking against a Pyenv-provided Python,
|
||||||
|
add the following line into your interactive shell's configuration:
|
||||||
|
|
||||||
|
* Bash/Zsh:
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
|
||||||
|
~~~
|
||||||
|
|
||||||
|
* Fish:
|
||||||
|
|
||||||
|
~~~fish
|
||||||
|
alias brew="env PATH=(string replace (pyenv root)/shims '' \"\$PATH\") brew"
|
||||||
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
#### Windows
|
||||||
|
|
||||||
|
Pyenv does not officially support Windows and does not work in Windows outside
|
||||||
|
the Windows Subsystem for Linux.
|
||||||
|
Moreover, even there, the Pythons it installs are not native Windows versions
|
||||||
|
but rather Linux versions running in a virtual machine --
|
||||||
|
so you won't get Windows-specific functionality.
|
||||||
|
|
||||||
|
If you're in Windows, we recommend using @kirankotari's [`pyenv-win`](https://github.com/pyenv-win/pyenv-win) fork --
|
||||||
|
which does install native Windows Python versions.
|
||||||
|
|
||||||
|
|
||||||
|
#### Automatic installer
|
||||||
|
|
||||||
Visit our other project:
|
Visit our other project:
|
||||||
https://github.com/pyenv/pyenv-installer
|
https://github.com/pyenv/pyenv-installer
|
||||||
|
|
||||||
|
|
||||||
### Basic GitHub Checkout
|
#### Basic GitHub Checkout
|
||||||
|
|
||||||
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.**
|
* **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):
|
||||||
|
|
||||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||||
|
|
||||||
Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
* Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
||||||
worry if it fails; Pyenv will still work normally:
|
worry if it fails; Pyenv will still work normally:
|
||||||
|
|
||||||
cd ~/.pyenv && src/configure && make -C src
|
cd ~/.pyenv && src/configure && make -C src
|
||||||
|
|
||||||
2. **Configure your shell's environment for Pyenv**
|
|
||||||
|
|
||||||
**Note:** The below instructions for specific shells are designed for common shell setups.
|
### Set up your shell environment for Pyenv
|
||||||
If you have an uncommon setup and they don't work for you,
|
|
||||||
use the guidance text and the [Advanced Configuration](#advanced-configuration)
|
|
||||||
section below to figure out what you need to do in your specific case.
|
|
||||||
|
|
||||||
1. **Adjust the session-wide environment for your account.** Define
|
**Upgrade note:** The startup logic and instructions have been updated for simplicity in 2.3.0.
|
||||||
the `PYENV_ROOT` environment variable to point to the path where
|
The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works.
|
||||||
you cloned the Pyenv repo, add the `pyenv` command-line utility to your `PATH`,
|
|
||||||
run the output of `pyenv init --path` to enable shims.
|
|
||||||
|
|
||||||
These commands need to be added into your shell startup files in such a way
|
* Define environment variable `PYENV_ROOT` to point to the path where
|
||||||
that _they are executed only once per session, by its login shell._
|
Pyenv will store its data. `$HOME/.pyenv` is the default.
|
||||||
This typically means they need to be added into a per-user shell-specific
|
If you installed Pyenv via Git checkout, we recommend
|
||||||
`~/.*profile` file, _and_ into `~/.profile`, too, so that they are also
|
to set it to the same location as where you cloned it.
|
||||||
run by GUI managers (which typically act as a `sh` login shell).
|
* Add the `pyenv` executable to your `PATH` if it's not already there
|
||||||
|
* run `eval "$(pyenv init -)"` to install `pyenv` into your shell as a shell function, enable shims and autocompletion
|
||||||
|
* You may run `eval "$(pyenv init --path)"` instead to just enable shims, without shell integration
|
||||||
|
|
||||||
**MacOS note:** If you installed Pyenv with Homebrew, you don't need
|
The below setup should work for the vast majority of users for commmon use cases.
|
||||||
to add the `PYENV_ROOT=` and `PATH=` lines.
|
See [Advanvced configuration](#advanced-configuration) for details and more configuration options.
|
||||||
You also don't need to add commands into `~/.profile` if your shell doesn't use it.
|
|
||||||
|
|
||||||
- For **Bash**:
|
- For **bash**:
|
||||||
|
|
||||||
|
Stock Bash startup files vary widely between distibutions in which of them source
|
||||||
|
which, under what circumstances, in what order and what additional configuration they perform.
|
||||||
|
As such, the most reliable way to get Pyenv in all environments is to append Pyenv
|
||||||
|
configuration commands to both `.bashrc` (for interactive shells)
|
||||||
|
and the profile file that Bash would use (for login shells).
|
||||||
|
|
||||||
|
First, add the commands to `~/.bashrc`:
|
||||||
|
|
||||||
|
~~~ bash
|
||||||
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
||||||
|
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
||||||
|
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
||||||
|
If you have none of these, add them to `~/.profile`.
|
||||||
|
|
||||||
|
* to add to `~/.profile`:
|
||||||
~~~ bash
|
~~~ bash
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||||
echo 'eval "$(pyenv init --path)"' >> ~/.profile
|
echo 'eval "$(pyenv init -)"' >> ~/.profile
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
- **If your `~/.profile` sources `~/.bashrc` (Debian, Ubuntu, Mint):**
|
* to add to `~/.bash_profile`:
|
||||||
|
|
||||||
Put these lines into `~/.profile` _before_ the part that sources `~/.bashrc`:
|
|
||||||
~~~bash
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
|
||||||
~~~
|
|
||||||
|
|
||||||
And put this line at the _bottom_ of `~/.profile`:
|
|
||||||
~~~bash
|
|
||||||
eval "$(pyenv init --path)"
|
|
||||||
~~~
|
|
||||||
|
|
||||||
<!--This is an alternative option and needn't be replicated to `pyenv init`-->
|
|
||||||
Alternatively, for an automated installation, you can run the following:
|
|
||||||
~~~ bash
|
~~~ bash
|
||||||
echo -e 'if shopt -q login_shell; then' \
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
|
||||||
'\n export PYENV_ROOT="$HOME/.pyenv"' \
|
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
|
||||||
'\n export PATH="$PYENV_ROOT/bin:$PATH"' \
|
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
|
||||||
'\n eval "$(pyenv init --path)"' \
|
|
||||||
'\nfi' >> ~/.bashrc
|
|
||||||
echo -e 'if [ -z "$BASH_VERSION" ]; then'\
|
|
||||||
'\n export PYENV_ROOT="$HOME/.pyenv"'\
|
|
||||||
'\n export PATH="$PYENV_ROOT/bin:$PATH"'\
|
|
||||||
'\n eval "$(pyenv init --path)"'\
|
|
||||||
'\nfi' >>~/.profile
|
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
**Note:** If you have `~/.bash_profile`, make sure that it too executes the above-added commands,
|
|
||||||
e.g. by copying them there or by `source`'ing `~/.profile`.
|
|
||||||
|
|
||||||
- For **Zsh**:
|
- For **Zsh**:
|
||||||
|
|
||||||
- **MacOS, if Pyenv is installed with Homebrew:**
|
|
||||||
|
|
||||||
~~~ zsh
|
~~~ zsh
|
||||||
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
||||||
|
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
||||||
|
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
- **MacOS, if Pyenv is installed with a Git checkout:**
|
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
|
||||||
|
|
||||||
~~~ zsh
|
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zprofile
|
|
||||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zprofile
|
|
||||||
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
|
|
||||||
~~~
|
|
||||||
|
|
||||||
- **Other OSes:**
|
|
||||||
|
|
||||||
Same as for Bash above, but add the commands into both `~/.profile`
|
|
||||||
and `~/.zprofile`.
|
|
||||||
|
|
||||||
- For **Fish shell**:
|
- For **Fish shell**:
|
||||||
|
|
||||||
Execute this interactively:
|
Execute this interactively:
|
||||||
|
|
||||||
~~~ fish
|
~~~ fish
|
||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||||
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
And add this to `~/.config/fish/config.fish`:
|
And add this to `~/.config/fish/config.fish`:
|
||||||
~~~ fish
|
|
||||||
status is-interactive; and pyenv init --path | source
|
|
||||||
~~~
|
|
||||||
|
|
||||||
If Fish is not your login shell, also follow the Bash/Zsh instructions to add to `~/.profile`.
|
|
||||||
|
|
||||||
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
|
|
||||||
|
|
||||||
2. **Add `pyenv` into your shell** by running the output of `pyenv init -`
|
|
||||||
to enable autocompletion and all subcommands.
|
|
||||||
|
|
||||||
This command needs to run at startup of any interactive shell instance.
|
|
||||||
In an interactive login shell, it needs to run _after_ the commands
|
|
||||||
from the previous step.
|
|
||||||
|
|
||||||
- For **bash**:
|
|
||||||
~~~ bash
|
|
||||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
|
||||||
~~~
|
|
||||||
|
|
||||||
- **If your `/etc/profile` sources `~/.bashrc` (SUSE):**
|
|
||||||
|
|
||||||
~~~bash
|
|
||||||
echo 'if command -v pyenv >/dev/null; then eval "$(pyenv init -)"; fi' >> ~/.bashrc
|
|
||||||
~~~
|
|
||||||
|
|
||||||
- For **Zsh**:
|
|
||||||
~~~ zsh
|
|
||||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
|
||||||
~~~
|
|
||||||
|
|
||||||
- For **Fish shell**:
|
|
||||||
Add this to `~/.config/fish/config.fish`:
|
|
||||||
~~~ fish
|
~~~ fish
|
||||||
pyenv init - | source
|
pyenv init - | source
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
**General warning**: There are some systems where the `BASH_ENV` variable is configured
|
**Bash warning**: There are some systems where the `BASH_ENV` variable is configured
|
||||||
to point to `.bashrc`. On such systems you should almost certainly put the above-mentioned line
|
to point to `.bashrc`. On such systems, you should almost certainly put the
|
||||||
`eval "$(pyenv init -)"` into `.bash_profile`, and **not** into `.bashrc`. Otherwise you
|
`eval "$(pyenv init -)"` line into `.bash_profile`, and **not** into `.bashrc`. Otherwise, you
|
||||||
may observe strange behaviour, such as `pyenv` getting into an infinite loop.
|
may observe strange behaviour, such as `pyenv` getting into an infinite loop.
|
||||||
See [#264](https://github.com/pyenv/pyenv/issues/264) for details.
|
See [#264](https://github.com/pyenv/pyenv/issues/264) for details.
|
||||||
|
|
||||||
4. **Restart your login session for the changes to take effect.**
|
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
|
||||||
E.g. if you're in a GUI session, you need to fully log out and log back in.
|
|
||||||
|
|
||||||
In MacOS, restarting terminal windows is enough (because MacOS runs shells
|
|
||||||
in them as login shells by default).
|
|
||||||
|
|
||||||
5. [**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) before attempting to install a new Python version.
|
### Restart your shell
|
||||||
|
|
||||||
|
for the `PATH` changes to take effect.
|
||||||
|
|
||||||
6. **Install Python versions into `$(pyenv root)/versions`.**
|
|
||||||
For example, to download and install Python 2.7.8, run:
|
|
||||||
```sh
|
```sh
|
||||||
pyenv install 2.7.8
|
exec "$SHELL"
|
||||||
```
|
```
|
||||||
**NOTE:** If you need to pass a `configure` option to a build, please use the
|
|
||||||
```CONFIGURE_OPTS``` environment variable.
|
|
||||||
|
|
||||||
**NOTE:** If you want to use proxy to download, please set the `http_proxy` and `https_proxy`
|
### Install Python build dependencies
|
||||||
environment variables.
|
|
||||||
|
|
||||||
**NOTE:** If you are having trouble installing a Python version,
|
[**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
|
||||||
please visit the wiki page about
|
before attempting to install a new Python version.
|
||||||
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
|
||||||
|
You can now begin using Pyenv.
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
#### Upgrading
|
## Usage
|
||||||
|
|
||||||
|
### Install additional Python versions
|
||||||
|
|
||||||
|
To install additonal Python versions, use [`pyenv install`](COMMANDS.md#pyenv-install).
|
||||||
|
|
||||||
|
For example, to download and install Python 3.10.4, run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pyenv install 3.10.4
|
||||||
|
```
|
||||||
|
|
||||||
|
**NOTE:** Most Pyenv-provided Python releases are source releases and are built
|
||||||
|
from source as part of installation (that's why you need Python build dependencies preinstalled).
|
||||||
|
You can pass options to Python's `configure` and compiler flags to customize the build,
|
||||||
|
see [_Special environment variables_ in Python-Build's README](plugins/python-build/README.md#special-environment-variables)
|
||||||
|
for details.
|
||||||
|
|
||||||
|
**NOTE:** If you want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
||||||
|
environment variables.
|
||||||
|
|
||||||
|
**NOTE:** If you are having trouble installing a Python version,
|
||||||
|
please visit the wiki page about
|
||||||
|
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
||||||
|
|
||||||
|
|
||||||
|
### Switch between Python versions
|
||||||
|
|
||||||
|
To select a Pyenv-installed Python as the version to use, run one
|
||||||
|
of the following commands:
|
||||||
|
|
||||||
|
* [`pyenv shell <version>`](COMMANDS.md#pyenv-shell) -- select just for current shell session
|
||||||
|
* [`pyenv local <version>`](COMMANDS.md#pyenv-local) -- automatically select whenever you are in the current directory (or its subdirectories)
|
||||||
|
* [`pyenv global <version>`](COMMANDS.md#pyenv-shell) -- select globally for your user account
|
||||||
|
|
||||||
|
E.g. to select the above-mentioned newly-installed Python 3.10.4 as your preferred version to use:
|
||||||
|
|
||||||
|
~~~bash
|
||||||
|
pyenv global 3.10.4
|
||||||
|
~~~
|
||||||
|
|
||||||
|
Now whenever you invoke `python`, `pip` etc., an executable from the Pyenv-provided
|
||||||
|
3.10.4 installation will be run instead of the system Python.
|
||||||
|
|
||||||
|
Using "`system`" as a version name would reset the selection to your system-provided Python.
|
||||||
|
|
||||||
|
See [Understanding shims](#understanding-shims) and
|
||||||
|
[Understanding Python version selection](#understanding-python-version-selection)
|
||||||
|
for more details on how the selection works and more information on its usage.
|
||||||
|
|
||||||
|
|
||||||
|
### Uninstall Python versions
|
||||||
|
|
||||||
|
As time goes on, you will accumulate Python versions in your
|
||||||
|
`$(pyenv root)/versions` directory.
|
||||||
|
|
||||||
|
To remove old Python versions, use [`pyenv uninstall <version>`](COMMANDS.md#pyenv-uninstall).
|
||||||
|
|
||||||
|
Alternatively, you can simply `rm -rf` the directory of the version you want
|
||||||
|
to remove. You can find the directory of a particular Python version
|
||||||
|
with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`.
|
||||||
|
Note however that plugins may run additional operations on uninstall
|
||||||
|
which you would need to do by hand as well. E.g. Pyenv-Virtualenv also
|
||||||
|
removes any virtual environments linked to the version being uninstalled.
|
||||||
|
|
||||||
|
|
||||||
|
### Other operations
|
||||||
|
|
||||||
|
Run `pyenv commands` to get a list of all available subcommands.
|
||||||
|
Run a subcommand with `--help` to get help on it, or see the [Commands Reference](COMMANDS.md).
|
||||||
|
|
||||||
|
Note that Pyenv plugins that you install may add their own subcommands.
|
||||||
|
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
If you've installed Pyenv using Homebrew, upgrade using:
|
If you've installed Pyenv using Homebrew, upgrade using:
|
||||||
```sh
|
```sh
|
||||||
brew upgrade pyenv
|
brew upgrade pyenv
|
||||||
```
|
```
|
||||||
|
|
||||||
If you've installed Pyenv using the instructions above, you can
|
If you've installed Pyenv using Pyenv-installer or Git checkout, you can
|
||||||
upgrade your installation at any time using Git.
|
upgrade your installation at any time using Git.
|
||||||
|
|
||||||
To upgrade to the latest development version of pyenv, use `git pull`:
|
To upgrade to the latest development version of pyenv, use `git pull`:
|
||||||
@@ -388,7 +462,7 @@ git tag
|
|||||||
git checkout v0.1.0
|
git checkout v0.1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
### Uninstalling pyenv
|
## Uninstalling pyenv
|
||||||
|
|
||||||
The simplicity of pyenv makes it easy to temporarily disable it, or
|
The simplicity of pyenv makes it easy to temporarily disable it, or
|
||||||
uninstall from the system.
|
uninstall from the system.
|
||||||
@@ -401,10 +475,10 @@ uninstall from the system.
|
|||||||
`pyenv` will still be accessible on the command line, but your Python
|
`pyenv` will still be accessible on the command line, but your Python
|
||||||
apps won't be affected by version switching.
|
apps won't be affected by version switching.
|
||||||
|
|
||||||
2. To completely **uninstall** Pyenv, remove _all_ configuration lines for it
|
2. To completely **uninstall** Pyenv, remove _all_ Pyenv configuration lines
|
||||||
from your shell startup configuration, and then remove
|
from your shell startup configuration, and then remove
|
||||||
its root directory. This will **delete all Python versions** that were
|
its root directory. This will **delete all Python versions** that were
|
||||||
installed under `` $(pyenv root)/versions/ `` directory:
|
installed under the `` $(pyenv root)/versions/ `` directory:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
rm -rf $(pyenv root)
|
rm -rf $(pyenv root)
|
||||||
@@ -417,83 +491,94 @@ uninstall from the system.
|
|||||||
brew uninstall pyenv
|
brew uninstall pyenv
|
||||||
```
|
```
|
||||||
|
|
||||||
### Advanced Configuration
|
## Advanced Configuration
|
||||||
|
|
||||||
Skip this section unless you must know what every line in your shell
|
Skip this section unless you must know what every line in your shell
|
||||||
profile is doing.
|
profile is doing.
|
||||||
|
|
||||||
|
Also see the [Environment variables](#environment-variables) section
|
||||||
|
for the environment variables that control Pyenv's behavior.
|
||||||
|
|
||||||
`pyenv init` is the only command that crosses the line of loading
|
`pyenv init` is the only command that crosses the line of loading
|
||||||
extra commands into your shell. Coming from RVM, some of you might be
|
extra commands into your shell. Coming from RVM, some of you might be
|
||||||
opposed to this idea. Here's what `pyenv init` actually does.
|
opposed to this idea. Here's what `eval "$(pyenv init -)"` actually does:
|
||||||
Step 1 is done by `eval "$(pyenv init --path)"`, the others are done by
|
|
||||||
`eval "$(pyenv init -)"`.
|
|
||||||
|
|
||||||
|
|
||||||
1. **Sets up your shims path.** This is the only requirement for pyenv to
|
1. **Sets up the shims path.** This is what allows Pyenv to intercept
|
||||||
function properly. You can do this by hand by prepending
|
and redirect invocations of `python`, `pip` etc. transparently.
|
||||||
`$(pyenv root)/shims` to your `$PATH`.
|
It prepends `$(pyenv root)/shims` to your `$PATH`.
|
||||||
|
It also deletes any other instances of `$(pyenv root)/shims` on `PATH`
|
||||||
|
which allows to invoke `eval "$(pyenv init -)"` multiple times without
|
||||||
|
getting duplicate `PATH` entries.
|
||||||
|
|
||||||
2. **Installs autocompletion.** This is entirely optional but pretty
|
2. **Installs autocompletion.** This is entirely optional but pretty
|
||||||
useful. Sourcing `$(pyenv root)/completions/pyenv.bash` will set that
|
useful. Sourcing `$(pyenv root)/completions/pyenv.bash` will set that
|
||||||
up. There is also a `$(pyenv root)/completions/pyenv.zsh` for Zsh
|
up. There are also completions for Zsh and Fish.
|
||||||
users.
|
|
||||||
|
|
||||||
3. **Rehashes shims.** From time to time you'll need to rebuild your
|
3. **Rehashes shims.** From time to time you'll need to rebuild your
|
||||||
shim files. Doing this on init makes sure everything is up to
|
shim files. Doing this on init makes sure everything is up to
|
||||||
date. You can always run `pyenv rehash` manually.
|
date. You can always run `pyenv rehash` manually.
|
||||||
|
|
||||||
4. **Installs the sh dispatcher.** This bit is also optional, but allows
|
4. **Installs `pyenv` into the current shell as a shell function.**
|
||||||
pyenv and plugins to change variables in your current shell, making
|
This bit is also optional, but allows
|
||||||
commands like `pyenv shell` possible. The sh dispatcher doesn't do
|
pyenv and plugins to change variables in your current shell.
|
||||||
|
This is required for some commands like `pyenv shell` to work.
|
||||||
|
The sh dispatcher doesn't do
|
||||||
anything crazy like override `cd` or hack your shell prompt, but if
|
anything crazy like override `cd` or hack your shell prompt, but if
|
||||||
for some reason you need `pyenv` to be a real script rather than a
|
for some reason you need `pyenv` to be a real script rather than a
|
||||||
shell function, you can safely skip it.
|
shell function, you can safely skip it.
|
||||||
|
|
||||||
|
`eval "$(pyenv init --path)"` only does items 1 and 3.
|
||||||
|
|
||||||
To see exactly what happens under the hood for yourself, run `pyenv init -`
|
To see exactly what happens under the hood for yourself, run `pyenv init -`
|
||||||
or `pyenv init --path`.
|
or `pyenv init --path`.
|
||||||
|
|
||||||
|
`eval "$(pyenv init -)"` is supposed to run at any interactive shell's
|
||||||
|
startup (including nested shells -- e.g. those invoked from editors)
|
||||||
|
so that you get completion and convenience shell functions.
|
||||||
|
|
||||||
|
`eval "$(pyenv init --path)"` can be used instead of `eval "$(pyenv init -)"`
|
||||||
|
to just enable shims, without shell integration. It can also be used to bump shims
|
||||||
|
to the front of `PATH` after some other logic has prepended stuff to `PATH`
|
||||||
|
that may shadow Pyenv's shims.
|
||||||
|
|
||||||
|
* In particular, in Debian-based distributions, the stock `~/.profile`
|
||||||
|
prepends per-user `bin` directories to `PATH` after having sourced `~/.bashrc`.
|
||||||
|
This necessitates appending a `pyenv init` call to `~/.profile` as well as `~/.bashrc`
|
||||||
|
in these distributions because the system's Pip places executables for
|
||||||
|
modules installed by a non-root user into those per-user `bin` directories.
|
||||||
|
|
||||||
|
|
||||||
|
### Using Pyenv without shims
|
||||||
|
|
||||||
If you don't want to use `pyenv init` and shims, you can still benefit
|
If you don't want to use `pyenv init` and shims, you can still benefit
|
||||||
from pyenv's ability to install Python versions for you. Just run
|
from pyenv's ability to install Python versions for you. Just run
|
||||||
`pyenv install` and you will find versions installed in
|
`pyenv install` and you will find versions installed in
|
||||||
`$(pyenv root)/versions`, which you can manually execute or symlink
|
`$(pyenv root)/versions`.
|
||||||
as required.
|
|
||||||
|
|
||||||
### Uninstalling Python Versions
|
You can manually execute or symlink them as required,
|
||||||
|
or you can use [`pyenv exec <command>`](COMMANDS.md#pyenv-exec)
|
||||||
|
whenever you want `<command>` to be affected by Pyenv's version selection
|
||||||
|
as currently configured.
|
||||||
|
|
||||||
As time goes on, you will accumulate Python versions in your
|
`pyenv exec` works by prepending `$(pyenv root)/versions/<selected version>/bin`
|
||||||
`$(pyenv root)/versions` directory.
|
to `PATH` in the `<command>`'s environment, the same as what e.g. RVM does.
|
||||||
|
|
||||||
To remove old Python versions, `pyenv uninstall` command to automate
|
|
||||||
the removal process.
|
|
||||||
|
|
||||||
Alternatively, simply `rm -rf` the directory of the version you want
|
|
||||||
to remove. You can find the directory of a particular Python version
|
|
||||||
with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`.
|
|
||||||
|
|
||||||
|
|
||||||
----
|
### Environment variables
|
||||||
|
|
||||||
|
You can affect how Pyenv operates with the following settings:
|
||||||
## Command Reference
|
|
||||||
|
|
||||||
See [COMMANDS.md](COMMANDS.md).
|
|
||||||
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
## Environment variables
|
|
||||||
|
|
||||||
You can affect how pyenv operates with the following settings:
|
|
||||||
|
|
||||||
name | default | description
|
name | default | description
|
||||||
-----|---------|------------
|
-----|---------|------------
|
||||||
`PYENV_VERSION` | | Specifies the Python version to be used.<br>Also see [`pyenv shell`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-shell)
|
`PYENV_VERSION` | | Specifies the Python version to be used.<br>Also see [`pyenv shell`]COMMANDS.md#pyenv-shell)
|
||||||
`PYENV_ROOT` | `~/.pyenv` | Defines the directory under which Python versions and shims reside.<br>Also see `pyenv root`
|
`PYENV_ROOT` | `~/.pyenv` | Defines the directory under which Python versions and shims reside.<br>Also see [`pyenv root`](COMMANDS.md#pyenv-root)
|
||||||
`PYENV_DEBUG` | | Outputs debug information.<br>Also as: `pyenv --debug <subcommand>`
|
`PYENV_DEBUG` | | Outputs debug information.<br>Also as: `pyenv --debug <subcommand>`
|
||||||
`PYENV_HOOK_PATH` | [_see wiki_][hooks] | Colon-separated list of paths searched for pyenv hooks.
|
`PYENV_HOOK_PATH` | [_see wiki_][hooks] | Colon-separated list of paths searched for pyenv hooks.
|
||||||
`PYENV_DIR` | `$PWD` | Directory to start searching for `.python-version` files.
|
`PYENV_DIR` | `$PWD` | Directory to start searching for `.python-version` files.
|
||||||
`PYTHON_BUILD_ARIA2_OPTS` | | Used to pass additional parameters to [`aria2`](https://aria2.github.io/).<br>If the `aria2c` binary is available on PATH, pyenv uses `aria2c` instead of `curl` or `wget` to download the Python Source code. If you have an unstable internet connection, you can use this variable to instruct `aria2` to accelerate the download.<br>In most cases, you will only need to use `-x 10 -k 1M` as value to `PYTHON_BUILD_ARIA2_OPTS` environment variable
|
`PYTHON_BUILD_ARIA2_OPTS` | | Used to pass additional parameters to [`aria2`](https://aria2.github.io/).<br>If the `aria2c` binary is available on `PATH`, pyenv uses `aria2c` instead of `curl` or `wget` to download the Python Source code. If you have an unstable internet connection, you can use this variable to instruct `aria2` to accelerate the download.<br>In most cases, you will only need to use `-x 10 -k 1M` as value to `PYTHON_BUILD_ARIA2_OPTS` environment variable
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
@@ -511,9 +596,6 @@ Please feel free to submit pull requests and file bugs on the [issue
|
|||||||
tracker](https://github.com/pyenv/pyenv/issues).
|
tracker](https://github.com/pyenv/pyenv/issues).
|
||||||
|
|
||||||
|
|
||||||
[pyenv-virtualenv]: https://github.com/pyenv/pyenv-virtualenv#readme
|
|
||||||
[hooks]: https://github.com/pyenv/pyenv/wiki/Authoring-plugins#pyenv-hooks
|
|
||||||
|
|
||||||
### Version History
|
### Version History
|
||||||
|
|
||||||
See [CHANGELOG.md](CHANGELOG.md).
|
See [CHANGELOG.md](CHANGELOG.md).
|
||||||
@@ -521,3 +603,7 @@ See [CHANGELOG.md](CHANGELOG.md).
|
|||||||
### License
|
### License
|
||||||
|
|
||||||
[The MIT License](LICENSE)
|
[The MIT License](LICENSE)
|
||||||
|
|
||||||
|
|
||||||
|
[pyenv-virtualenv]: https://github.com/pyenv/pyenv-virtualenv#readme
|
||||||
|
[hooks]: https://github.com/pyenv/pyenv/wiki/Authoring-plugins#pyenv-hooks
|
||||||
|
|||||||
@@ -80,9 +80,13 @@ bin_path="$(abs_dirname "$0")"
|
|||||||
for plugin_bin in "${bin_path%/*}"/plugins/*/bin; do
|
for plugin_bin in "${bin_path%/*}"/plugins/*/bin; do
|
||||||
PATH="${plugin_bin}:${PATH}"
|
PATH="${plugin_bin}:${PATH}"
|
||||||
done
|
done
|
||||||
for plugin_bin in "${PYENV_ROOT}"/plugins/*/bin; do
|
# PYENV_ROOT can be set to anything, so it may happen to be equal to the base path above,
|
||||||
|
# resulting in duplicate PATH entries
|
||||||
|
if [ "${bin_path%/*}" != "$PYENV_ROOT" ]; then
|
||||||
|
for plugin_bin in "${PYENV_ROOT}"/plugins/*/bin; do
|
||||||
PATH="${plugin_bin}:${PATH}"
|
PATH="${plugin_bin}:${PATH}"
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
export PATH="${bin_path}:${PATH}"
|
export PATH="${bin_path}:${PATH}"
|
||||||
|
|
||||||
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${PYENV_ROOT}/pyenv.d"
|
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${PYENV_ROOT}/pyenv.d"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
version="2.0.5"
|
version="2.3.0"
|
||||||
git_revision=""
|
git_revision=""
|
||||||
|
|
||||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
# version's `bin' directory is at the front.
|
# version's `bin' directory is at the front.
|
||||||
#
|
#
|
||||||
# For example, if the currently selected Python version is 2.7.6:
|
# For example, if the currently selected Python version is 2.7.6:
|
||||||
# pyenv exec pip install -rrequirements.txt
|
# pyenv exec pip install -r requirements.txt
|
||||||
#
|
#
|
||||||
# is equivalent to:
|
# is equivalent to:
|
||||||
# PATH="$PYENV_ROOT/versions/2.7.6/bin:$PATH" pip install -rrequirements.txt
|
# PATH="$PYENV_ROOT/versions/2.7.6/bin:$PATH" pip install -r requirements.txt
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|||||||
@@ -44,8 +44,9 @@ extract_initial_comment_block() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
collect_documentation() {
|
collect_documentation() {
|
||||||
# shellcheck disable=SC2016
|
# `tail` prevents "broken pipe" errors due to `head` closing thge pipe without reading everything
|
||||||
$(type -P gawk awk | head -1) '
|
# https://superuser.com/questions/554855/how-can-i-fix-a-broken-pipe-error/642932#642932
|
||||||
|
$(type -P gawk awk | tail -n +1 | head -1) '
|
||||||
/^Summary:/ {
|
/^Summary:/ {
|
||||||
summary = substr($0, 10)
|
summary = substr($0, 10)
|
||||||
next
|
next
|
||||||
|
|||||||
@@ -57,12 +57,15 @@ function main() {
|
|||||||
;;
|
;;
|
||||||
"path")
|
"path")
|
||||||
print_path
|
print_path
|
||||||
|
print_rehash
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
"print")
|
"print")
|
||||||
init_dirs
|
init_dirs
|
||||||
|
print_path
|
||||||
print_env
|
print_env
|
||||||
print_completion
|
print_completion
|
||||||
|
print_rehash
|
||||||
print_shell_function
|
print_shell_function
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
@@ -74,7 +77,12 @@ function main() {
|
|||||||
function help_() {
|
function help_() {
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
bash )
|
bash )
|
||||||
|
if [ -e '~/.bash_profile' ]; then
|
||||||
profile='~/.bash_profile'
|
profile='~/.bash_profile'
|
||||||
|
else
|
||||||
|
profile='~/.profile'
|
||||||
|
fi
|
||||||
|
profile_explain="~/.bash_profile if it exists, otherwise ~/.profile"
|
||||||
rc='~/.bashrc'
|
rc='~/.bashrc'
|
||||||
;;
|
;;
|
||||||
zsh )
|
zsh )
|
||||||
@@ -92,11 +100,6 @@ function help_() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
{
|
{
|
||||||
echo
|
|
||||||
echo '# (The below instructions are intended for common'
|
|
||||||
echo '# shell setups. See the README for more guidance'
|
|
||||||
echo '# if they don'\''t apply and/or don'\''t work for you.)'
|
|
||||||
echo
|
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
echo "# Add pyenv executable to PATH by running"
|
echo "# Add pyenv executable to PATH by running"
|
||||||
@@ -108,53 +111,28 @@ function help_() {
|
|||||||
echo "# Load pyenv automatically by appending"
|
echo "# Load pyenv automatically by appending"
|
||||||
echo "# the following to ~/.config/fish/config.fish:"
|
echo "# the following to ~/.config/fish/config.fish:"
|
||||||
echo
|
echo
|
||||||
echo 'status is-interactive; and pyenv init --path | source'
|
|
||||||
echo 'pyenv init - | source'
|
echo 'pyenv init - | source'
|
||||||
echo
|
echo
|
||||||
echo "# If fish is not your login shell,"
|
|
||||||
echo "# add the following to ~/.profile:"
|
|
||||||
echo
|
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
|
||||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
|
|
||||||
echo 'eval "$(pyenv init --path)"'
|
|
||||||
echo
|
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo '# Add pyenv executable to PATH and'
|
echo '# Load pyenv automatically by appending'
|
||||||
echo '# enable shims by adding the following'
|
echo -n "# the following to "
|
||||||
case "$shell" in
|
if [ "$profile" == "$rc" ]; then
|
||||||
bash|ksh )
|
echo "$profile :"
|
||||||
echo '# to ~/.profile:'
|
else
|
||||||
;;
|
|
||||||
* )
|
|
||||||
echo '# to ~/.profile and '"${profile}"':'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo
|
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
|
||||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
|
|
||||||
echo 'eval "$(pyenv init --path)"'
|
|
||||||
echo
|
|
||||||
if [[ $shell == "bash" ]]; then
|
|
||||||
echo '# If your ~/.profile sources '"${rc}"','
|
|
||||||
echo '# the lines need to be inserted before the part'
|
|
||||||
echo '# that does that. See the README for another option.'
|
|
||||||
echo
|
|
||||||
echo '# If you have '"${profile}"', make sure that it'
|
|
||||||
echo '# also executes the above lines -- e.g. by'
|
|
||||||
echo '# copying them there or by sourcing ~/.profile'
|
|
||||||
echo
|
echo
|
||||||
|
echo "${profile_explain:-$profile} (for login shells)"
|
||||||
|
echo "and $rc (for interactive shells) :"
|
||||||
fi
|
fi
|
||||||
echo "# Load pyenv into the shell by adding"
|
|
||||||
echo "# the following to ${rc}:"
|
|
||||||
echo
|
echo
|
||||||
|
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
||||||
|
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"'
|
||||||
echo 'eval "$(pyenv init -)"'
|
echo 'eval "$(pyenv init -)"'
|
||||||
echo
|
|
||||||
echo '# Make sure to restart your entire logon session'
|
|
||||||
echo '# for changes to profile files to take effect.'
|
|
||||||
echo
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
echo
|
||||||
|
echo '# Restart your shell for the changes to take effect.'
|
||||||
|
echo
|
||||||
} >&2
|
} >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,13 +141,15 @@ function init_dirs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function print_path() {
|
function print_path() {
|
||||||
# Need to use the login shell rather than the current one
|
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
echo "set -gx PATH '${PYENV_ROOT}/shims' \$PATH"
|
echo 'while set index (contains -i -- '\'"${PYENV_ROOT}/shims"\'' $PATH)'
|
||||||
|
echo 'set -eg PATH[$index]; end; set -e index'
|
||||||
|
echo 'set -gx PATH '\'"${PYENV_ROOT}/shims"\'' $PATH'
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo 'export PATH="'${PYENV_ROOT}'/shims:${PATH}"'
|
echo 'PATH="$(bash -ec '\''IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "'\'"${PYENV_ROOT}/shims"\''" ]]; then unset '\'\\\'\''paths[i]'\'\\\'\''; fi; done; echo "${paths[*]}"'\'')"'
|
||||||
|
echo 'export PATH="'"${PYENV_ROOT}"'/shims:${PATH}"'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -190,7 +170,9 @@ function print_completion() {
|
|||||||
if [ -r "$completion" ]; then
|
if [ -r "$completion" ]; then
|
||||||
echo "source '$completion'"
|
echo "source '$completion'"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function print_rehash() {
|
||||||
if [ -z "$no_rehash" ]; then
|
if [ -z "$no_rehash" ]; then
|
||||||
echo 'command pyenv rehash 2>/dev/null'
|
echo 'command pyenv rehash 2>/dev/null'
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Summary: Display prefix for a Python version
|
# Summary: Display prefixes for Python versions
|
||||||
# Usage: pyenv prefix [<version>]
|
# Usage: pyenv prefix [<version>...]
|
||||||
#
|
#
|
||||||
# Displays the directory where a Python version is installed. If no
|
# Displays the directories where the given Python versions are installed,
|
||||||
# version is given, `pyenv prefix' displays the location of the
|
# separated by colons. If no version is given, `pyenv prefix' displays the
|
||||||
# currently selected version.
|
# locations of the currently selected versions.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
@@ -33,7 +33,9 @@ OLDIFS="$IFS"
|
|||||||
if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python 2>/dev/null)" || \
|
if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python 2>/dev/null)" || \
|
||||||
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python3 2>/dev/null)" || \
|
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python3 2>/dev/null)" || \
|
||||||
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python2 2>/dev/null)"; then
|
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python2 2>/dev/null)"; then
|
||||||
PYENV_PREFIX_PATH="${PYTHON_PATH%/bin/*}"
|
shopt -s extglob
|
||||||
|
# In some distros (Arch), Python can be found in sbin as well as bin
|
||||||
|
PYENV_PREFIX_PATH="${PYTHON_PATH%/?(s)bin/*}"
|
||||||
PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH:-/}"
|
PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH:-/}"
|
||||||
else
|
else
|
||||||
echo "pyenv: system version not found in PATH" >&2
|
echo "pyenv: system version not found in PATH" >&2
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ unset VERBOSE
|
|||||||
unset HAS_PATCH
|
unset HAS_PATCH
|
||||||
unset DEBUG
|
unset DEBUG
|
||||||
|
|
||||||
|
[ -n "$PYENV_DEBUG" ] && VERBOSE="-v"
|
||||||
|
|
||||||
parse_options "$@"
|
parse_options "$@"
|
||||||
for option in "${OPTIONS[@]}"; do
|
for option in "${OPTIONS[@]}"; do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ if [ -z "$FORCE" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "pyenv: remove $PREFIX? [y|N]"
|
read -p "pyenv: remove $PREFIX? [y|N] "
|
||||||
case "$REPLY" in
|
case "$REPLY" in
|
||||||
y | Y | yes | YES ) ;;
|
y | Y | yes | YES ) ;;
|
||||||
* ) exit 1 ;;
|
* ) exit 1 ;;
|
||||||
|
|||||||
@@ -766,9 +766,13 @@ build_package_standard_build() {
|
|||||||
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
||||||
|
|
||||||
if [ "$package_var_name" = "PYTHON" ]; then
|
if [ "$package_var_name" = "PYTHON" ]; then
|
||||||
|
use_homebrew || true
|
||||||
|
use_tcltk || true
|
||||||
use_homebrew_readline || use_freebsd_pkg || true
|
use_homebrew_readline || use_freebsd_pkg || true
|
||||||
if is_mac -ge 1014; then
|
if is_mac -ge 1014; then
|
||||||
use_xcode_sdk_zlib || use_homebrew_zlib || true
|
use_xcode_sdk_zlib || use_homebrew_zlib || true
|
||||||
|
else
|
||||||
|
use_homebrew_zlib || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -850,8 +854,8 @@ build_package_jython_builder() {
|
|||||||
( cd "dist" && build_package_jython )
|
( cd "dist" && build_package_jython )
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_pyston() {
|
build_package_pyston2_2() {
|
||||||
# currently supported version 2.2 and upper
|
# currently supported version 2.2 and 2.3
|
||||||
build_package_copy
|
build_package_copy
|
||||||
mkdir -p "${PREFIX_PATH}/bin" "${PREFIX_PATH}/lib"
|
mkdir -p "${PREFIX_PATH}/bin" "${PREFIX_PATH}/lib"
|
||||||
local bin
|
local bin
|
||||||
@@ -868,6 +872,11 @@ build_package_pyston() {
|
|||||||
shopt -u nullglob
|
shopt -u nullglob
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_package_pyston() {
|
||||||
|
# currently supported version 2.3.1v2 and higher
|
||||||
|
build_package_copy
|
||||||
|
}
|
||||||
|
|
||||||
build_package_ironpython() {
|
build_package_ironpython() {
|
||||||
mkdir -p "${PREFIX_PATH}/bin"
|
mkdir -p "${PREFIX_PATH}/bin"
|
||||||
cp -fR . "${PREFIX_PATH}/bin"
|
cp -fR . "${PREFIX_PATH}/bin"
|
||||||
@@ -1034,7 +1043,9 @@ build_package_anaconda() {
|
|||||||
|
|
||||||
build_package_miniconda() {
|
build_package_miniconda() {
|
||||||
build_package_anaconda "$@"
|
build_package_anaconda "$@"
|
||||||
"${PREFIX_PATH}/bin/conda" install --yes "pip"
|
# Workaround to not upgrade conda when installing pip
|
||||||
|
# see https://github.com/pyenv/pyenv/issues/2070
|
||||||
|
"${PREFIX_PATH}/bin/conda" install --yes "pip" "conda=$(${PREFIX_PATH}/bin/conda --version | cut -d ' ' -f 2)"
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_copy() {
|
build_package_copy() {
|
||||||
@@ -1310,12 +1321,27 @@ configured_with_package_dir() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use_homebrew() {
|
||||||
|
is_mac || return 1
|
||||||
|
# unless Homebrew is at the default /usr/local, need to add its paths to
|
||||||
|
# compiler search to be able to use non-keg-only deps from there
|
||||||
|
if is_mac && command -v brew &>/dev/null; then
|
||||||
|
local brew_prefix="$(brew --prefix 2>/dev/null || true)"
|
||||||
|
# /usr/local/lib:/usr/lib is the default library search path
|
||||||
|
if [[ -n $brew_prefix && $brew_prefix != "/usr" && $brew_prefix != "/usr/local" ]]; then
|
||||||
|
export CPPFLAGS="${CPPFLAGS:+${CPPFLAGS% } }-I${brew_prefix}/include"
|
||||||
|
export LDFLAGS="${LDFLAGS:+${LDFLAGS% } }-L${brew_prefix}/lib"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
needs_yaml() {
|
needs_yaml() {
|
||||||
! configured_with_package_dir "python" "yaml.h" &&
|
! configured_with_package_dir "python" "yaml.h" &&
|
||||||
! use_homebrew_yaml
|
! use_homebrew_yaml
|
||||||
}
|
}
|
||||||
|
|
||||||
use_homebrew_yaml() {
|
use_homebrew_yaml() {
|
||||||
|
is_mac || return 1
|
||||||
local libdir="$(brew --prefix libyaml 2>/dev/null || true)"
|
local libdir="$(brew --prefix libyaml 2>/dev/null || true)"
|
||||||
if [ -d "$libdir" ]; then
|
if [ -d "$libdir" ]; then
|
||||||
echo "python-build: use libyaml from homebrew"
|
echo "python-build: use libyaml from homebrew"
|
||||||
@@ -1359,6 +1385,7 @@ has_broken_mac_readline() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
use_homebrew_readline() {
|
use_homebrew_readline() {
|
||||||
|
is_mac || return 1
|
||||||
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
|
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
|
||||||
local libdir="$(brew --prefix readline 2>/dev/null || true)"
|
local libdir="$(brew --prefix readline 2>/dev/null || true)"
|
||||||
if [ -d "$libdir" ]; then
|
if [ -d "$libdir" ]; then
|
||||||
@@ -1399,6 +1426,7 @@ has_broken_mac_openssl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
use_homebrew_openssl() {
|
use_homebrew_openssl() {
|
||||||
|
is_mac || return 1
|
||||||
command -v brew >/dev/null || return 1
|
command -v brew >/dev/null || return 1
|
||||||
for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do
|
for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do
|
||||||
local ssldir="$(brew --prefix "${openssl}" || true)"
|
local ssldir="$(brew --prefix "${openssl}" || true)"
|
||||||
@@ -1498,6 +1526,7 @@ build_package_verify_openssl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
use_homebrew_zlib() {
|
use_homebrew_zlib() {
|
||||||
|
is_mac || return 1
|
||||||
local brew_zlib="$(brew --prefix zlib 2>/dev/null || true)"
|
local brew_zlib="$(brew --prefix zlib 2>/dev/null || true)"
|
||||||
if [ -d "$brew_zlib" ]; then
|
if [ -d "$brew_zlib" ]; then
|
||||||
echo "python-build: use zlib from homebrew"
|
echo "python-build: use zlib from homebrew"
|
||||||
@@ -1516,6 +1545,79 @@ use_xcode_sdk_zlib() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use_homebrew_tcltk() {
|
||||||
|
is_mac || 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"
|
||||||
|
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"
|
||||||
|
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# FIXME: this function is a workaround for #1125
|
||||||
|
# once fixed, it should be removed.
|
||||||
|
use_custom_tcltk() {
|
||||||
|
local tcltk_ops="$1"
|
||||||
|
local tcltk_ops_flag="--with-tcltk-libs="
|
||||||
|
# get tcltk libs
|
||||||
|
local tcltk_libs="${tcltk_ops//$tcltk_ops_flag/}"
|
||||||
|
# remove tcltk-flag from configure_opts
|
||||||
|
# this allows for weird input such as
|
||||||
|
# --with-tcltk-libs=' -L/custom-tcl-tk/lib -ltcl8.6 -ltk8.4 '
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//"$tcltk_ops_flag"/}"
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//$tcltk_libs/}"
|
||||||
|
|
||||||
|
# remove quotes, because there mess up compilations
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//"''"/}"
|
||||||
|
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//'""'/}"
|
||||||
|
|
||||||
|
echo "python-build: use tcl-tk from \$PYTHON_CONFIGURE_OPTS"
|
||||||
|
# echo "PYTHON_CONFIGURE_OPTS=${PYTHON_CONFIGURE_OPTS}"
|
||||||
|
package_option python configure --with-tcltk-libs="${tcltk_libs}"
|
||||||
|
# IFS="$OLDIFS"
|
||||||
|
}
|
||||||
|
|
||||||
|
# FIXME: this function is a workaround for #1125
|
||||||
|
# once fixed, it should be removed.
|
||||||
|
# Get tcltk-flag and options from `$1`
|
||||||
|
# expects one argument containing a string of configure opts, eg. `PYTHON_CONFIGURE_OPTS`
|
||||||
|
# returns tcl_tk flag or an empty string if nothing was found.
|
||||||
|
get_tcltk_flag_from() {
|
||||||
|
IFS=$'\n'
|
||||||
|
# parse input string into array
|
||||||
|
local opts_arr=( $(xargs -n1 <<<"$1") )
|
||||||
|
|
||||||
|
# iterate through `opts_arr`, break if `--with-tcltk-libs=` was found.
|
||||||
|
for opts in ${opts_arr[@]}; do
|
||||||
|
# `--with-tcltk-libs=` must be the prefix.
|
||||||
|
if [[ "$opts" == "--with-tcltk-libs="* ]]; then
|
||||||
|
# return
|
||||||
|
echo "$opts"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
IFS="$OLDIFS"
|
||||||
|
}
|
||||||
|
|
||||||
|
use_tcltk() {
|
||||||
|
if is_mac; 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
|
||||||
|
}
|
||||||
|
|
||||||
build_package_enable_shared() {
|
build_package_enable_shared() {
|
||||||
package_option python configure --enable-shared
|
package_option python configure --enable-shared
|
||||||
}
|
}
|
||||||
@@ -1547,7 +1649,7 @@ apply_python_patch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_package_symlink_version_suffix() {
|
build_package_symlink_version_suffix() {
|
||||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||||
if [ -e "${PREFIX_PATH}/bin" ]; then
|
if [ -e "${PREFIX_PATH}/bin" ]; then
|
||||||
# Always create `bin` as symlink to framework path if the version was built with `--enable-frameowrk` (#590)
|
# Always create `bin` as symlink to framework path if the version was built with `--enable-frameowrk` (#590)
|
||||||
rm -rf "${PREFIX_PATH}/bin.orig"
|
rm -rf "${PREFIX_PATH}/bin.orig"
|
||||||
@@ -1996,7 +2098,7 @@ fi
|
|||||||
package_option python configure --libdir="${PREFIX_PATH}/lib"
|
package_option python configure --libdir="${PREFIX_PATH}/lib"
|
||||||
|
|
||||||
# python-build: Set `RPATH` if `--enable-shared` was given (#65, #66, #82)
|
# python-build: Set `RPATH` if `--enable-shared` was given (#65, #66, #82)
|
||||||
if [[ "$CONFIGURE_OPTS" == *"--enable-shared"* ]] || [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-shared"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-shared"* ]]; then
|
||||||
# The ld on Darwin embeds the full paths to each dylib by default
|
# The ld on Darwin embeds the full paths to each dylib by default
|
||||||
if [[ "$LDFLAGS" != *"-rpath="* ]] && ! is_mac; then
|
if [[ "$LDFLAGS" != *"-rpath="* ]] && ! is_mac; then
|
||||||
export LDFLAGS="-Wl,-rpath=${PREFIX_PATH}/lib ${LDFLAGS}"
|
export LDFLAGS="-Wl,-rpath=${PREFIX_PATH}/lib ${LDFLAGS}"
|
||||||
@@ -2009,7 +2111,7 @@ if [[ "$PYPY_OPTS" == *"--shared"* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Add support for framework installation (`--enable-framework`) of CPython (#55, #99)
|
# Add support for framework installation (`--enable-framework`) of CPython (#55, #99)
|
||||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||||
if ! is_mac; then
|
if ! is_mac; then
|
||||||
echo "python-build: framework installation is not supported." >&2
|
echo "python-build: framework installation is not supported." >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -2029,13 +2131,21 @@ if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
|||||||
package_option python configure --enable-framework="${PREFIX_PATH}/Library/Frameworks"
|
package_option python configure --enable-framework="${PREFIX_PATH}/Library/Frameworks"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build against universal SDK (#219, #220)
|
# Build against universal SDK
|
||||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
||||||
if ! is_mac; then
|
if ! is_mac; then
|
||||||
echo "python-build: universal installation is not supported." >&2
|
echo "python-build: universal installation is not supported." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
package_option python configure --enable-universalsdk=/ --with-universal-archs=intel
|
package_option python configure --enable-universalsdk=/
|
||||||
|
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--with-universal-archs"* ]]; then
|
||||||
|
# in CPython's configure.ac, --with-universal-archs defaults to 'intel' which means i386 + x86_64
|
||||||
|
# since 2.7.5 and 3.3.0 -- i.e. in all non-EOL versions
|
||||||
|
# Apple Silicon cannot build these, in it, it rather makes sense to default to Universal2 binaries
|
||||||
|
if [[ $(arch) == "arm64" ]]; then
|
||||||
|
package_option python configure --with-universal-archs=universal2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compile with `--enable-unicode=ucs4` by default (#257)
|
# Compile with `--enable-unicode=ucs4` by default (#257)
|
||||||
@@ -2053,19 +2163,6 @@ if [[ "$PYTHON_CONFIGURE_OPTS" != *"--enable-unicode="* ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# regex_to_match="(--with-tcltk-libs='([^']+)')"
|
|
||||||
if [[ "$PYTHON_CONFIGURE_OPTS" =~ (--with-tcltk-libs=\'([^\']+)\') ]]; then
|
|
||||||
tcltk_match="${BASH_REMATCH[1]}"
|
|
||||||
tcltk_match_quoted="${tcltk_match//--with-tcltk-libs=/}"
|
|
||||||
# remove it from PYTHON_CONFIGURE_OPTS since it will mess up compile
|
|
||||||
PYTHON_CONFIGURE_OPTS="${PYTHON_CONFIGURE_OPTS//$tcltk_match/}"
|
|
||||||
|
|
||||||
# having issues passing the single quoted part, couldnt pass as single var and still work
|
|
||||||
package_option python configure "--with-tcltk-libs='${tcltk_match_quoted}'"
|
|
||||||
unset tcltk_match
|
|
||||||
unset tcltk_match_quoted
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Unset `PIP_REQUIRE_VENV` during build (#216)
|
# Unset `PIP_REQUIRE_VENV` during build (#216)
|
||||||
unset PIP_REQUIRE_VENV
|
unset PIP_REQUIRE_VENV
|
||||||
unset PIP_REQUIRE_VIRTUALENV
|
unset PIP_REQUIRE_VIRTUALENV
|
||||||
@@ -2115,6 +2212,9 @@ if [ -z "${GET_PIP_URL}" ]; then
|
|||||||
3.5 | 3.5.* )
|
3.5 | 3.5.* )
|
||||||
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.5/get-pip.py"
|
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.5/get-pip.py"
|
||||||
;;
|
;;
|
||||||
|
3.6 | 3.6.* )
|
||||||
|
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.6/get-pip.py"
|
||||||
|
;;
|
||||||
* )
|
* )
|
||||||
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
|
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ esac
|
|||||||
|
|
||||||
install_line_fmt = """
|
install_line_fmt = """
|
||||||
"{os}-{arch}" )
|
"{os}-{arch}" )
|
||||||
install_script "Miniconda{suffix}-{version_str}-{os}-{arch}" "{repo}/Miniconda{suffix}-{version_str}-{os}-{arch}.sh#{md5}" "miniconda" verify_{py_version}
|
install_script "Miniconda{suffix}-{version_py_version}{version_str}-{os}-{arch}" "{repo}/Miniconda{suffix}-{version_py_version}{version_str}-{os}-{arch}.sh#{md5}" "miniconda" verify_{py_version}
|
||||||
;;
|
;;
|
||||||
""".strip()
|
""".strip()
|
||||||
|
|
||||||
@@ -126,17 +126,35 @@ class VersionStr(str):
|
|||||||
class MinicondaVersion(NamedTuple):
|
class MinicondaVersion(NamedTuple):
|
||||||
suffix: Suffix
|
suffix: Suffix
|
||||||
version_str: VersionStr
|
version_str: VersionStr
|
||||||
|
py_version: Optional[PyVersion]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_str(cls, s):
|
def from_str(cls, s):
|
||||||
miniconda_n, ver = s.split("-")
|
"""
|
||||||
return MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver))
|
Convert a string of the form "miniconda_n-ver" or "miniconda_n-py_ver-ver" to a :class:`MinicondaVersion` object.
|
||||||
|
"""
|
||||||
|
components = s.split("-")
|
||||||
|
if len(components) == 3:
|
||||||
|
miniconda_n, py_ver, ver = components
|
||||||
|
py_ver = PyVersion(f"py{py_ver.replace('.', '')}")
|
||||||
|
else:
|
||||||
|
miniconda_n, ver = components
|
||||||
|
py_ver = None
|
||||||
|
return MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver), py_ver)
|
||||||
|
|
||||||
def to_filename(self):
|
def to_filename(self):
|
||||||
|
if self.py_version:
|
||||||
|
return f"miniconda{self.suffix}-{self.py_version.version()}-{self.version_str}"
|
||||||
|
else:
|
||||||
return f"miniconda{self.suffix}-{self.version_str}"
|
return f"miniconda{self.suffix}-{self.version_str}"
|
||||||
|
|
||||||
def default_py_version(self):
|
def default_py_version(self):
|
||||||
if self.suffix == Suffix.TWO:
|
"""
|
||||||
|
:class:`PyVersion` of Python used with this Miniconda version
|
||||||
|
"""
|
||||||
|
if self.py_version:
|
||||||
|
return self.py_version
|
||||||
|
elif self.suffix == Suffix.TWO:
|
||||||
return PyVersion.PY27
|
return PyVersion.PY27
|
||||||
elif self.version_str.info() < (4, 7):
|
elif self.version_str.info() < (4, 7):
|
||||||
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-python.html
|
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-python.html
|
||||||
@@ -146,7 +164,7 @@ class MinicondaVersion(NamedTuple):
|
|||||||
|
|
||||||
def with_version_triple(self):
|
def with_version_triple(self):
|
||||||
return MinicondaVersion(
|
return MinicondaVersion(
|
||||||
self.suffix, VersionStr.from_info(self.version_str.info()[:3])
|
self.suffix, VersionStr.from_info(self.version_str.info()[:3]), self.py_version
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -160,8 +178,13 @@ class MinicondaSpec(NamedTuple):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def from_filestem(cls, stem, md5, py_version=None):
|
def from_filestem(cls, stem, md5, py_version=None):
|
||||||
miniconda_n, ver, os, arch = stem.split("-")
|
miniconda_n, ver, os, arch = stem.split("-")
|
||||||
|
if ver.startswith("py"):
|
||||||
|
py_ver, ver = ver.split("_", maxsplit=1)
|
||||||
|
py_ver = PyVersion(py_ver)
|
||||||
|
else:
|
||||||
|
py_ver = None
|
||||||
spec = MinicondaSpec(
|
spec = MinicondaSpec(
|
||||||
MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver)),
|
MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver), py_ver),
|
||||||
SupportedOS(os),
|
SupportedOS(os),
|
||||||
SupportedArch(arch),
|
SupportedArch(arch),
|
||||||
md5,
|
md5,
|
||||||
@@ -171,10 +194,14 @@ class MinicondaSpec(NamedTuple):
|
|||||||
return spec
|
return spec
|
||||||
|
|
||||||
def to_install_lines(self):
|
def to_install_lines(self):
|
||||||
|
"""
|
||||||
|
Installation command for this version of Miniconda for use in a Pyenv installation script
|
||||||
|
"""
|
||||||
return install_line_fmt.format(
|
return install_line_fmt.format(
|
||||||
repo=MINICONDA_REPO,
|
repo=MINICONDA_REPO,
|
||||||
suffix=self.version.suffix,
|
suffix=self.version.suffix,
|
||||||
version_str=self.version.version_str,
|
version_str=self.version.version_str,
|
||||||
|
version_py_version=f"{self.version.py_version}_" if self.version.py_version else "",
|
||||||
os=self.os,
|
os=self.os,
|
||||||
arch=self.arch,
|
arch=self.arch,
|
||||||
md5=self.md5,
|
md5=self.md5,
|
||||||
@@ -195,6 +222,11 @@ def make_script(specs: List[MinicondaSpec]):
|
|||||||
|
|
||||||
|
|
||||||
def get_existing_minicondas():
|
def get_existing_minicondas():
|
||||||
|
"""
|
||||||
|
Enumerate existing Miniconda installation scripts in share/python-build/ except rolling releases.
|
||||||
|
|
||||||
|
:returns: A generator of :class:`MinicondaVersion` objects.
|
||||||
|
"""
|
||||||
logger.info("Getting known miniconda versions")
|
logger.info("Getting known miniconda versions")
|
||||||
for p in out_dir.iterdir():
|
for p in out_dir.iterdir():
|
||||||
name = p.name
|
name = p.name
|
||||||
@@ -210,6 +242,12 @@ def get_existing_minicondas():
|
|||||||
|
|
||||||
|
|
||||||
def get_available_minicondas():
|
def get_available_minicondas():
|
||||||
|
"""
|
||||||
|
Fetch remote miniconda versions.
|
||||||
|
|
||||||
|
:returns: A generator of :class:`MinicondaSpec` objects for each release available for download
|
||||||
|
except rolling releases.
|
||||||
|
"""
|
||||||
logger.info("Fetching remote miniconda versions")
|
logger.info("Fetching remote miniconda versions")
|
||||||
session = requests_html.HTMLSession()
|
session = requests_html.HTMLSession()
|
||||||
response = session.get(MINICONDA_REPO)
|
response = session.get(MINICONDA_REPO)
|
||||||
@@ -250,7 +288,7 @@ if __name__ == "__main__":
|
|||||||
help="Do not write scripts, just report them to stdout",
|
help="Do not write scripts, just report them to stdout",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-v", "--verbose", action="count",
|
"-v", "--verbose", action="count", default=0,
|
||||||
help="Increase verbosity of logging",
|
help="Increase verbosity of logging",
|
||||||
)
|
)
|
||||||
parsed = parser.parse_args()
|
parsed = parser.parse_args()
|
||||||
|
|||||||
4
plugins/python-build/share/python-build/2.6.0
Normal file
4
plugins/python-build/share/python-build/2.6.0
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#require_gcc
|
||||||
|
install_package "openssl-1.0.2k" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6" "https://www.python.org/ftp/python/2.6/Python-2.6.tgz#7c2f21a968a737a59ed0729f4b1dc154dc3aa183c20be96055186fe43c6742d0" standard verify_py26 ensurepip
|
||||||
4
plugins/python-build/share/python-build/2.6.1
Normal file
4
plugins/python-build/share/python-build/2.6.1
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#require_gcc
|
||||||
|
install_package "openssl-1.0.2k" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.1" "https://www.python.org/ftp/python/2.6.1/Python-2.6.1.tgz#fb65e93678e1327e3e8559cc56e1e00ed8c07162b21287a3502677892c5c515c" standard verify_py26 ensurepip
|
||||||
4
plugins/python-build/share/python-build/2.6.2
Normal file
4
plugins/python-build/share/python-build/2.6.2
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#require_gcc
|
||||||
|
install_package "openssl-1.0.2k" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.2" "https://www.python.org/ftp/python/2.6.2/Python-2.6.2.tgz#e37ecdf249f248f4fea227adbca09c778670b64fcb5e45947ec3e093cbc12c86" standard verify_py26 ensurepip
|
||||||
4
plugins/python-build/share/python-build/2.6.3
Normal file
4
plugins/python-build/share/python-build/2.6.3
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#require_gcc
|
||||||
|
install_package "openssl-1.0.2k" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.3" "https://www.python.org/ftp/python/2.6.3/Python-2.6.3.tgz#a71b55540690425fd82ab00819aeb92c1b23cbb4730a0ccd2e25c833b22a812e" standard verify_py26 ensurepip
|
||||||
4
plugins/python-build/share/python-build/2.6.4
Normal file
4
plugins/python-build/share/python-build/2.6.4
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#require_gcc
|
||||||
|
install_package "openssl-1.0.2k" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.4" "https://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz#1a25a47506e4165704cfe2b07c0a064b0b5762a2d18b8fbdad5af688aeacd252" standard verify_py26 ensurepip
|
||||||
4
plugins/python-build/share/python-build/2.6.5
Normal file
4
plugins/python-build/share/python-build/2.6.5
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#require_gcc
|
||||||
|
install_package "openssl-1.0.2k" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz#6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.5" "https://www.python.org/ftp/python/2.6.5/Python-2.6.5.tgz#b331dafdce3361834fee783795d4f68ae7cf7d379e9137c2d8e8531cea615ede" standard verify_py26 ensurepip
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#require_gcc
|
export PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA="openssl@1.1 openssl@1.0 openssl"
|
||||||
install_package "openssl-1.0.2q" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
|
install_package "openssl-1.0.2q" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" mac_openssl --if has_broken_mac_openssl
|
||||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
if has_tar_xz_support; then
|
if has_tar_xz_support; then
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#require_gcc
|
#require_gcc
|
||||||
prefer_openssl11
|
prefer_openssl11
|
||||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
install_git "Python-3.10-dev" "https://github.com/python/cpython" 3.10 standard verify_py310 copy_python_gdb ensurepip
|
install_git "Python-3.10-dev" "https://github.com/python/cpython" 3.10 standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
|||||||
10
plugins/python-build/share/python-build/3.10.0
Normal file
10
plugins/python-build/share/python-build/3.10.0
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.10.0" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz#5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.10.0" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz#c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#require_gcc
|
|
||||||
prefer_openssl11
|
|
||||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
|
||||||
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
|
||||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
|
||||||
if has_tar_xz_support; then
|
|
||||||
install_package "Python-3.10.0rc1" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc1.tar.xz#797061692282d0e573a0093476e57e39cf52cad56782ab2dfb79afadb3c1e638" standard verify_py310 copy_python_gdb ensurepip
|
|
||||||
else
|
|
||||||
install_package "Python-3.10.0rc1" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc1.tgz#b7efa6edd72bfeae57295f1ccc7c38c9ede8087f9f082382f16f92aa38f684d3" standard verify_py310 copy_python_gdb ensurepip
|
|
||||||
fi
|
|
||||||
10
plugins/python-build/share/python-build/3.10.1
Normal file
10
plugins/python-build/share/python-build/3.10.1
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.10.1" "https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tar.xz#a7f1265b6e1a5de1ec5c3ec7019ab53413469934758311e9d240c46e5ae6e177" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.10.1" "https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tgz#b76117670e7c5064344b9c138e141a377e686b9063f3a8a620ff674fa8ec90d3" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.10.2
Normal file
10
plugins/python-build/share/python-build/3.10.2
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.10.2" "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tar.xz#17de3ac7da9f2519aa9d64378c603a73a0e9ad58dffa8812e45160c086de64c7" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.10.2" "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz#3c0ede893011319f9b0a56b44953a3d52c7abf9657c23fb4bc9ced93b86e9c97" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.10.3
Normal file
10
plugins/python-build/share/python-build/3.10.3
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.10.3" "https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tar.xz#596c72de998dc39205bc4f70ef0dbf7edec740a306d09b49a9bd0a77806730dc" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.10.3" "https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tgz#5a3b029bad70ba2a019ebff08a65060a8b9b542ffc1a83c697f1449ecca9813b" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.10.4
Normal file
10
plugins/python-build/share/python-build/3.10.4
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.10.4" "https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tar.xz#80bf925f571da436b35210886cf79f6eb5fa5d6c571316b73568343451f77a19" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.10.4" "https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz#f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28" standard verify_py310 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.11.0a7
Normal file
10
plugins/python-build/share/python-build/3.11.0a7
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.11.0a7" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0a7.tar.xz#b7c56dd74c2f472d496b5a8d356bd6ad9ef9b03f26288c3237d3ff698ab03d74" standard verify_py311 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.11.0a7" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0a7.tgz#6cc20b9b53a8e7a29e0fd56a0d502ff64a5677507fcf2c503decf732a31c513d" standard verify_py311 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
9
plugins/python-build/share/python-build/3.6.15
Normal file
9
plugins/python-build/share/python-build/3.6.15
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.6.15" "https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tar.xz#6e28d7cdd6dd513dd190e49bca3972e20fcf455090ccf2ef3f1a227614135d91" standard verify_py36 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.6.15" "https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz#54570b7e339e2cfd72b29c7e2fdb47c0b7b18b7412e61de5b463fc087c13b043" standard verify_py36 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.7.12
Normal file
10
plugins/python-build/share/python-build/3.7.12
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.7.12" "https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tar.xz#f77bf7fb47839f213e5cbf7827281078ea90de7e72b44f10d7ef385ea8c43210" standard verify_py37 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.7.12" "https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz#33b4daaf831be19219659466d12645f87ecec6eb21d4d9f9711018a7b66cce46" standard verify_py37 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.7.13
Normal file
10
plugins/python-build/share/python-build/3.7.13
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.7.13" "https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tar.xz#99f106275df8899c3e8cb9d7c01ce686c202ef275953301427194693de5bef84" standard verify_py37 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.7.13" "https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz#e405417f50984bc5870c7e7a9f9aeb93e9d270f5ac67f667a0cd3a09439682b5" standard verify_py37 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.8.12
Normal file
10
plugins/python-build/share/python-build/3.8.12
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.8.12" "https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz#b1d3a76420375343b5e8a22fceb1ac65b77193e9ed27146524f0a9db058728ea" standard verify_py38 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.8.12" "https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz#316aa33f3b7707d041e73f246efedb297a70898c4b91f127f66dc8d80c596f1a" standard verify_py38 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.8.13
Normal file
10
plugins/python-build/share/python-build/3.8.13
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.8.13" "https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tar.xz#6f309077012040aa39fe8f0c61db8c0fa1c45136763299d375c9e5756f09cf57" standard verify_py38 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.8.13" "https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz#903b92d76354366b1d9c4434d0c81643345cef87c1600adfa36095d7b00eede4" standard verify_py38 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.9.10
Normal file
10
plugins/python-build/share/python-build/3.9.10
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.9.10" "https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tar.xz#0a8fbfb5287ebc3a13e9baf3d54e08fa06778ffeccf6311aef821bb3a6586cc8" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.9.10" "https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz#1aa9c0702edbae8f6a2c95f70a49da8420aaa76b7889d3419c186bfc8c0e571e" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.9.11
Normal file
10
plugins/python-build/share/python-build/3.9.11
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.9.11" "https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tar.xz#66767a35309d724f370df9e503c172b4ee444f49d62b98bc4eca725123e26c49" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.9.11" "https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tgz#3442400072f582ac2f0df30895558f08883b416c8c7877ea55d40d00d8a93112" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.9.12
Normal file
10
plugins/python-build/share/python-build/3.9.12
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.9.12" "https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tar.xz#2cd94b20670e4159c6d9ab57f91dbf255b97d8c1a1451d1c35f4ec1968adf971" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.9.12" "https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz#70e08462ebf265012bd2be88a63d2149d880c73e53f1712b7bbbe93750560ae8" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.9.7
Normal file
10
plugins/python-build/share/python-build/3.9.7
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.9.7" "https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tar.xz#f8145616e68c00041d1a6399b76387390388f8359581abc24432bb969b5e3c57" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.9.7" "https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz#a838d3f9360d157040142b715db34f0218e535333696a5569dc6f854604eb9d1" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.9.8
Normal file
10
plugins/python-build/share/python-build/3.9.8
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.9.8" "https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tar.xz#675ce09bf23c09836bf1969b744b1ea4c1a18c32788626632525f08444ebad5c" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.9.8" "https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tgz#7447fb8bb270942d620dd24faa7814b1383b61fa99029a240025fd81c1db8283" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
10
plugins/python-build/share/python-build/3.9.9
Normal file
10
plugins/python-build/share/python-build/3.9.9
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
if has_tar_xz_support; then
|
||||||
|
install_package "Python-3.9.9" "https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz#06828c04a573c073a4e51c4292a27c1be4ae26621c3edc7cf9318418ce3b6d27" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
else
|
||||||
|
install_package "Python-3.9.9" "https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz#2cc7b67c1f3f66c571acc42479cdf691d8ed6b47bee12c9b68430413a17a44ea" standard verify_py39 copy_python_gdb ensurepip
|
||||||
|
fi
|
||||||
19
plugins/python-build/share/python-build/anaconda3-2021.11
Normal file
19
plugins/python-build/share/python-build/anaconda3-2021.11
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Anaconda3-2021.11-Linux-ppc64le" "https://repo.continuum.io/archive/Anaconda3-2021.11-Linux-ppc64le.sh#7eb6a95925ee756240818599f8dcbba7a155adfb05ef6cd5336aa3c083de65f3" "anaconda" verify_py39
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Anaconda3-2021.11-Linux-x86_64" "https://repo.continuum.io/archive/Anaconda3-2021.11-Linux-x86_64.sh#fedf9e340039557f7b5e8a8a86affa9d299f5e9820144bd7b92ae9f7ee08ac60" "anaconda" verify_py39
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Anaconda3-2021.11-MacOSX-x86_64" "https://repo.continuum.io/archive/Anaconda3-2021.11-MacOSX-x86_64.sh#6a9217d1a08c599f860045d56ef64fc6c3e3112b55cc97f3d07c573d7bbcdb58" "anaconda" verify_py39
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Anaconda3 is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
48
plugins/python-build/share/python-build/graalpython-21.3.0
Normal file
48
plugins/python-build/share/python-build/graalpython-21.3.0
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
# the Software without restriction, including without limitation the rights to
|
||||||
|
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
# of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
# so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
VERSION='21.3.0'
|
||||||
|
BUILD=''
|
||||||
|
|
||||||
|
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||||
|
"linux64" )
|
||||||
|
graalpython_arch="linux"
|
||||||
|
checksum="b17bbc9753fb04f03290660952acfd212020676603970323780f190509b061b9"
|
||||||
|
;;
|
||||||
|
"osx64" )
|
||||||
|
graalpython_arch="macos"
|
||||||
|
checksum="feecbd2567a43aeaeb5ca6a7385ef3d5bd2c94e563b64afee7dcce0c8f87a1c9"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": No binary distribution of GraalPython is available for $(pypy_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "${BUILD}" ]; then
|
||||||
|
urlprefix="https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${VERSION}-${BUILD}"
|
||||||
|
else
|
||||||
|
urlprefix="https://github.com/oracle/graalpython/releases/download/vm-${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_package "graalpython-${VERSION}${BUILD}" "${urlprefix}/graalpython-${VERSION}-${graalpython_arch}-amd64.tar.gz#${checksum}" "graalpython" ensurepip
|
||||||
48
plugins/python-build/share/python-build/graalpython-22.0.0
Normal file
48
plugins/python-build/share/python-build/graalpython-22.0.0
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
# the Software without restriction, including without limitation the rights to
|
||||||
|
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
# of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
# so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
VERSION='22.0.0.2'
|
||||||
|
BUILD=''
|
||||||
|
|
||||||
|
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||||
|
"linux64" )
|
||||||
|
graalpython_arch="linux"
|
||||||
|
checksum="e80c6051a609e7e1403b96992951814e967cf6deb9ca2507e691769d01970d55"
|
||||||
|
;;
|
||||||
|
"osx64" )
|
||||||
|
graalpython_arch="macos"
|
||||||
|
checksum="5b0476321162557a7b43e6cdadfc187280bc40a3452d327a4ae8d624afaa5336"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": No binary distribution of GraalPython is available for $(pypy_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "${BUILD}" ]; then
|
||||||
|
urlprefix="https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${VERSION}-${BUILD}"
|
||||||
|
else
|
||||||
|
urlprefix="https://github.com/oracle/graalpython/releases/download/vm-${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_package "graalpython-${VERSION}${BUILD}" "${urlprefix}/graalpython-${VERSION}-${graalpython_arch}-amd64.tar.gz#${checksum}" "graalpython" ensurepip
|
||||||
48
plugins/python-build/share/python-build/graalpython-22.1.0
Normal file
48
plugins/python-build/share/python-build/graalpython-22.1.0
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
# the Software without restriction, including without limitation the rights to
|
||||||
|
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
# of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
# so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
VERSION='22.1.0'
|
||||||
|
BUILD=''
|
||||||
|
|
||||||
|
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||||
|
"linux64" )
|
||||||
|
graalpython_arch="linux"
|
||||||
|
checksum="06862993573b64bd64c802aace9135192a4ba28a15d8260c42c5de632ad616bc"
|
||||||
|
;;
|
||||||
|
"osx64" )
|
||||||
|
graalpython_arch="macos"
|
||||||
|
checksum="88b22ea4a5cb8345b680d15cc385dff7a8ab858fdf0e182c79c6c3b74755de6c"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": No binary distribution of GraalPython is available for $(pypy_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "${BUILD}" ]; then
|
||||||
|
urlprefix="https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${VERSION}-${BUILD}"
|
||||||
|
else
|
||||||
|
urlprefix="https://github.com/oracle/graalpython/releases/download/vm-${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_package "graalpython-${VERSION}${BUILD}" "${urlprefix}/graalpython-${VERSION}-${graalpython_arch}-amd64.tar.gz#${checksum}" "graalpython" ensurepip
|
||||||
22
plugins/python-build/share/python-build/mambaforge-4.10.3-10
Normal file
22
plugins/python-build/share/python-build/mambaforge-4.10.3-10
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Mambaforge-4.10.3-10-Linux-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-Linux-x86_64.sh#8b789c619d03760e606a9c9b3d098414653f6037b80f16174ad94f0ee0c679d8" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"Linux-aarch64" )
|
||||||
|
install_script "Mambaforge-4.10.3-10-Linux-aarch64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-Linux-aarch64.sh#60a1d50c92fe1d48e2744effca9e7b51bfd5cc4e863dbcdb762ed48020703e3a" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"MacOSX-arm64" )
|
||||||
|
install_script "Mambaforge-4.10.3-10-MacOSX-arm64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-MacOSX-arm64.sh#72bc86612ab9435915b616c2edb076737cbabe2c33fd684d58c2f9ae72e1957c" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Mambaforge-4.10.3-10-MacOSX-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-MacOSX-x86_64.sh#7c44259a0982cd3ef212649678af5f0dd4e0bb7306e8fffc93601dd1d739ec0b" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniforge is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
ase "$(anaconda_architecture 2>/dev/null || true)" in
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
"Linux-ppc64le" )
|
"Linux-ppc64le" )
|
||||||
install_script "Mambaforge-pypy3-Linux-ppc64le" "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pypy3-Linux-ppc64le.sh" "miniconda" verify_py3_latest
|
install_script "Mambaforge-pypy3-Linux-ppc64le" "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pypy3-Linux-ppc64le.sh" "miniconda" verify_py3_latest
|
||||||
;;
|
;;
|
||||||
|
|||||||
4
plugins/python-build/share/python-build/micropython-1.16
Normal file
4
plugins/python-build/share/python-build/micropython-1.16
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
has_tar_xz_support \
|
||||||
|
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.16.tar.xz#48271fb5da97efc22325c3fc1d87ba45b32bab25673206d8d8136c25e4ff29a9"; } \
|
||||||
|
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.16.zip#427adc00d2a99d102e4ce46d9eb4933d168e863f859bb3ce5b84735f0899c1ed"; }
|
||||||
|
$install micropython-1.16 "$src" micropython
|
||||||
4
plugins/python-build/share/python-build/micropython-1.17
Normal file
4
plugins/python-build/share/python-build/micropython-1.17
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
has_tar_xz_support \
|
||||||
|
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.17.tar.xz#e322f915cee784de0f8614779cdb88fce175956975b3864e2d1898a53638a2f7"; } \
|
||||||
|
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.17.zip#4dfc60e2ba67e89c0b794c0533bb4e43a10d4e38095d0640b64b4faa9160f244"; }
|
||||||
|
$install micropython-1.17 "$src" micropython
|
||||||
19
plugins/python-build/share/python-build/miniconda2-2.7-4.8.3
Normal file
19
plugins/python-build/share/python-build/miniconda2-2.7-4.8.3
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda2-py27_4.8.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-ppc64le.sh#120b300120b1362831f2075cc0bd452f" "miniconda" verify_py27
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda2-py27_4.8.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-x86_64.sh#19ce7d0039ab349914d928e7f32b1c1b" "miniconda" verify_py27
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda2-py27_4.8.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-MacOSX-x86_64.sh#14e2d294decc5a48a449b588f5819c10" "miniconda" verify_py27
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda3-py37_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-ppc64le.sh#a926bbaf28d59ac1264799e3ca770a44" "miniconda" verify_py37
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda3-py37_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh#9f186c1d86c266acc47dbc1603f0e2ed" "miniconda" verify_py37
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda3-py37_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-MacOSX-x86_64.sh#b88a2eb66917c55a6bd1973fabaf05b3" "miniconda" verify_py37
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda3-py37_4.11.0-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-Linux-ppc64le.sh#cf7cbccc16bf82365bbf0129f646ff45" "miniconda" verify_py37
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda3-py37_4.11.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-Linux-x86_64.sh#7675bd23411179956bcc4692f16ef27d" "miniconda" verify_py37
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda3-py37_4.11.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-MacOSX-x86_64.sh#0dde31d693fbcb4feb1eb4292cba4371" "miniconda" verify_py37
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda3-py38_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-ppc64le.sh#12ddb1b94f30f8fc633c3223b0398d2f" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda3-py38_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh#14da4a9a44b337f7ccb8363537f65b9c" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda3-py38_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-MacOSX-x86_64.sh#cb609591c280423e999fc421cdb779d3" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda3-py38_4.11.0-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-ppc64le.sh#adec9893a69557f1eaadce56f24f6614" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda3-py38_4.11.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-x86_64.sh#252d3b0c863333639f99fbc465ee1d61" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda3-py38_4.11.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-MacOSX-x86_64.sh#e0ab9762f3d20d23bbff4b804a03cb08" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda3-py39_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-ppc64le.sh#07ea41c691bdcc7d9c71cae1a1a88151" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda3-py39_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh#8c69f65a4ae27fb41df0fe552b4a8a3b" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda3-py39_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.sh#09bb30a9204ced74ce3c06762cb442fc" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniconda3-py39_4.11.0-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-ppc64le.sh#305e55110a3ad9384230e5fe396ccd89" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniconda3-py39_4.11.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh#4e2f31e0b2598634c80daa12e4981647" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniconda3-py39_4.11.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-MacOSX-x86_64.sh#d1303e5c7510b2ef444b9ba474551733" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -5,9 +5,15 @@ case "$(anaconda_architecture 2>/dev/null || true)" in
|
|||||||
"Linux-x86_64" )
|
"Linux-x86_64" )
|
||||||
install_script "Miniconda3-latest-Linux-x86_64" "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" "miniconda" verify_py3_latest
|
install_script "Miniconda3-latest-Linux-x86_64" "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" "miniconda" verify_py3_latest
|
||||||
;;
|
;;
|
||||||
|
"Linux-aarch64" )
|
||||||
|
install_script "Miniconda3-latest-Linux-aarch64" "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-aarch64.sh" "miniconda" verify_py3_latest
|
||||||
|
;;
|
||||||
"MacOSX-x86_64" )
|
"MacOSX-x86_64" )
|
||||||
install_script "Miniconda3-latest-MacOSX-x86_64" "https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh" "miniconda" verify_py3_latest
|
install_script "Miniconda3-latest-MacOSX-x86_64" "https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh" "miniconda" verify_py3_latest
|
||||||
;;
|
;;
|
||||||
|
"MacOSX-arm64" )
|
||||||
|
install_script "Miniconda3-latest-MacOSX-arm64" "https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-arm64.sh" "miniconda" verify_py3_latest
|
||||||
|
;;
|
||||||
* )
|
* )
|
||||||
{ echo
|
{ echo
|
||||||
colorize 1 "ERROR"
|
colorize 1 "ERROR"
|
||||||
|
|||||||
25
plugins/python-build/share/python-build/miniforge3-4.10.3-10
Normal file
25
plugins/python-build/share/python-build/miniforge3-4.10.3-10
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||||
|
"Linux-ppc64le" )
|
||||||
|
install_script "Miniforge3-4.10.3-10-Linux-ppc64le" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-Linux-ppc64le.sh#8df85d4af3d2d24f86bb6784d4c196b770b7b9c0be8917d79aec9e08f517d0e9" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"Linux-x86_64" )
|
||||||
|
install_script "Miniforge3-4.10.3-10-Linux-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-Linux-x86_64.sh#8ed8cd582d16cd58e0ccd87e692fbe71de6365a51678b579b2f40d8d6f6e5771" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"Linux-aarch64" )
|
||||||
|
install_script "Miniforge3-4.10.3-10-Linux-aarch64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-Linux-aarch64.sh#b2d510c6cd0aac3964a7a7838a7f7376b804fbdd0ba04909ece53f883f624233" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
"MacOSX-arm64" )
|
||||||
|
install_script "Miniforge3-4.10.3-10-MacOSX-arm64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-MacOSX-arm64.sh#bd4d59ead779a6e2d9af69fd8cdcaac8e1446191c59ab446ae8547a1aecd75b7" "miniconda" verify_py39
|
||||||
|
;;
|
||||||
|
"MacOSX-x86_64" )
|
||||||
|
install_script "Miniforge3-4.10.3-10-MacOSX-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-MacOSX-x86_64.sh#7d325a5370664ec2fe1c09c3066c22fd905431f338c7eed31ad7e14c7ce4bd83" "miniconda" verify_py38
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
{ echo
|
||||||
|
colorize 1 "ERROR"
|
||||||
|
echo ": The binary distribution of Miniforge is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
6
plugins/python-build/share/python-build/nogil-3.9.10
Normal file
6
plugins/python-build/share/python-build/nogil-3.9.10
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#require_gcc
|
||||||
|
prefer_openssl11
|
||||||
|
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||||
|
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" mac_openssl --if has_broken_mac_openssl
|
||||||
|
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||||
|
install_package "nogil-3.9.10" "https://github.com/colesbury/nogil/archive/refs/tags/v3.9.10-nogil.tar.gz#5058c0ec07f0444673b86977c18e786183ca35617d9e6ada2329f7a87a4a0993" standard verify_py39 copy_python_gdb ensurepip
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff -r -u setup.py setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -308,10 +309,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1308,14 +1332,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
diff -r -u ../Python-2.6.orig/Modules/readline.c ./Modules/readline.c
|
||||||
|
--- ../Python-2.6.orig/Modules/readline.c 2013-11-10 16:36:41.000000000 +0900
|
||||||
|
+++ ./Modules/readline.c 2014-03-29 16:17:48.643305752 +0900
|
||||||
|
@@ -174,8 +174,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;
|
||||||
|
@@ -647,14 +646,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);
|
||||||
|
}
|
||||||
|
@@ -749,7 +756,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)
|
||||||
|
{
|
||||||
|
Py_XDECREF(begidx);
|
||||||
|
Py_XDECREF(endidx);
|
||||||
|
@@ -783,12 +790,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 */
|
||||||
|
rl_completer_word_break_characters =
|
||||||
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff -r -u ../Python-2.6.orig/setup.py ./setup.py
|
||||||
|
--- ../Python-2.6.orig/setup.py 2013-10-30 00:04:39.000000000 +0900
|
||||||
|
+++ ./setup.py 2014-04-03 22:28:49.122061684 +0900
|
||||||
|
@@ -1541,7 +1541,7 @@
|
||||||
|
# The versions with dots are used on Unix, and the versions without
|
||||||
|
# dots on Windows, for detection by cygwin.
|
||||||
|
tcllib = tklib = tcl_includes = tk_includes = None
|
||||||
|
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
|
||||||
|
+ for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
||||||
|
'82', '8.1', '81', '8.0', '80']:
|
||||||
|
tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
|
||||||
|
tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Lib/ssl.py ./Lib/ssl.py
|
||||||
|
--- ../Python-2.6.4.orig/Lib/ssl.py 2012-04-10 15:32:06.000000000 +0000
|
||||||
|
+++ ./Lib/ssl.py 2015-12-18 14:46:36.487188331 +0000
|
||||||
|
@@ -61,18 +61,24 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
-from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
-from _ssl import \
|
||||||
|
- SSL_ERROR_ZERO_RETURN, \
|
||||||
|
- SSL_ERROR_WANT_READ, \
|
||||||
|
- SSL_ERROR_WANT_WRITE, \
|
||||||
|
- SSL_ERROR_WANT_X509_LOOKUP, \
|
||||||
|
- SSL_ERROR_SYSCALL, \
|
||||||
|
- SSL_ERROR_SSL, \
|
||||||
|
- SSL_ERROR_WANT_CONNECT, \
|
||||||
|
- SSL_ERROR_EOF, \
|
||||||
|
- SSL_ERROR_INVALID_ERROR_CODE
|
||||||
|
+from _ssl import RAND_status, RAND_add
|
||||||
|
+try:
|
||||||
|
+ from _ssl import RAND_egd
|
||||||
|
+except ImportError:
|
||||||
|
+ # LibreSSL does not provide RAND_egd
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
+def _import_symbols(prefix):
|
||||||
|
+ for n in dir(_ssl):
|
||||||
|
+ if n.startswith(prefix):
|
||||||
|
+ globals()[n] = getattr(_ssl, n)
|
||||||
|
+
|
||||||
|
+_import_symbols('OP_')
|
||||||
|
+_import_symbols('ALERT_DESCRIPTION_')
|
||||||
|
+_import_symbols('SSL_ERROR_')
|
||||||
|
+_import_symbols('PROTOCOL_')
|
||||||
|
+
|
||||||
|
+_PROTOCOL_NAMES = dict([(value, name) for name, value in globals().items() if name.startswith('PROTOCOL_')])
|
||||||
|
|
||||||
|
from socket import socket, _fileobject
|
||||||
|
from socket import getnameinfo as _getnameinfo
|
||||||
|
@@ -394,7 +400,7 @@
|
||||||
|
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||||
|
return base64.decodestring(d)
|
||||||
|
|
||||||
|
-def get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||||
|
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||||
|
|
||||||
|
"""Retrieve the certificate from the server at the specified address,
|
||||||
|
and return it as a PEM-encoded string.
|
||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/_ssl.c ./Modules/_ssl.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/_ssl.c 2012-04-10 15:32:09.000000000 +0000
|
||||||
|
+++ ./Modules/_ssl.c 2015-12-18 14:45:30.419597074 +0000
|
||||||
|
@@ -61,8 +61,12 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1,
|
||||||
|
};
|
||||||
|
@@ -298,10 +302,14 @@
|
||||||
|
PySSL_BEGIN_ALLOW_THREADS
|
||||||
|
if (proto_version == PY_SSL_VERSION_TLS1)
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1627,10 +1635,14 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
|
PY_SSL_VERSION_SSL23);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff -r -u setup.py setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -308,10 +309,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1310,14 +1334,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/readline.c ./Modules/readline.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/readline.c 2013-11-10 16:36:41.000000000 +0900
|
||||||
|
+++ ./Modules/readline.c 2014-03-29 16:17:48.643305752 +0900
|
||||||
|
@@ -178,8 +178,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;
|
||||||
|
@@ -655,14 +655,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);
|
||||||
|
}
|
||||||
|
@@ -757,7 +757,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)
|
||||||
|
{
|
||||||
|
Py_XDECREF(begidx);
|
||||||
|
Py_XDECREF(endidx);
|
||||||
|
@@ -791,12 +791,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 */
|
||||||
|
rl_completer_word_break_characters =
|
||||||
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff -r -u ../Python-2.6.1.orig/setup.py ./setup.py
|
||||||
|
--- ../Python-2.6.1.orig/setup.py 2013-10-30 00:04:39.000000000 +0900
|
||||||
|
+++ ./setup.py 2014-04-03 22:28:49.122061684 +0900
|
||||||
|
@@ -1543,7 +1543,7 @@
|
||||||
|
# The versions with dots are used on Unix, and the versions without
|
||||||
|
# dots on Windows, for detection by cygwin.
|
||||||
|
tcllib = tklib = tcl_includes = tk_includes = None
|
||||||
|
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
|
||||||
|
+ for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
||||||
|
'82', '8.1', '81', '8.0', '80']:
|
||||||
|
tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
|
||||||
|
tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Lib/ssl.py ./Lib/ssl.py
|
||||||
|
--- ../Python-2.6.4.orig/Lib/ssl.py 2012-04-10 15:32:06.000000000 +0000
|
||||||
|
+++ ./Lib/ssl.py 2015-12-18 14:46:36.487188331 +0000
|
||||||
|
@@ -61,18 +61,24 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
-from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
-from _ssl import \
|
||||||
|
- SSL_ERROR_ZERO_RETURN, \
|
||||||
|
- SSL_ERROR_WANT_READ, \
|
||||||
|
- SSL_ERROR_WANT_WRITE, \
|
||||||
|
- SSL_ERROR_WANT_X509_LOOKUP, \
|
||||||
|
- SSL_ERROR_SYSCALL, \
|
||||||
|
- SSL_ERROR_SSL, \
|
||||||
|
- SSL_ERROR_WANT_CONNECT, \
|
||||||
|
- SSL_ERROR_EOF, \
|
||||||
|
- SSL_ERROR_INVALID_ERROR_CODE
|
||||||
|
+from _ssl import RAND_status, RAND_add
|
||||||
|
+try:
|
||||||
|
+ from _ssl import RAND_egd
|
||||||
|
+except ImportError:
|
||||||
|
+ # LibreSSL does not provide RAND_egd
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
+def _import_symbols(prefix):
|
||||||
|
+ for n in dir(_ssl):
|
||||||
|
+ if n.startswith(prefix):
|
||||||
|
+ globals()[n] = getattr(_ssl, n)
|
||||||
|
+
|
||||||
|
+_import_symbols('OP_')
|
||||||
|
+_import_symbols('ALERT_DESCRIPTION_')
|
||||||
|
+_import_symbols('SSL_ERROR_')
|
||||||
|
+_import_symbols('PROTOCOL_')
|
||||||
|
+
|
||||||
|
+_PROTOCOL_NAMES = dict([(value, name) for name, value in globals().items() if name.startswith('PROTOCOL_')])
|
||||||
|
|
||||||
|
from socket import socket, _fileobject
|
||||||
|
from socket import getnameinfo as _getnameinfo
|
||||||
|
@@ -394,7 +400,7 @@
|
||||||
|
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||||
|
return base64.decodestring(d)
|
||||||
|
|
||||||
|
-def get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||||
|
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||||
|
|
||||||
|
"""Retrieve the certificate from the server at the specified address,
|
||||||
|
and return it as a PEM-encoded string.
|
||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/_ssl.c ./Modules/_ssl.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/_ssl.c 2012-04-10 15:32:09.000000000 +0000
|
||||||
|
+++ ./Modules/_ssl.c 2015-12-18 14:45:30.419597074 +0000
|
||||||
|
@@ -61,8 +61,12 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1,
|
||||||
|
};
|
||||||
|
@@ -298,10 +302,14 @@
|
||||||
|
PySSL_BEGIN_ALLOW_THREADS
|
||||||
|
if (proto_version == PY_SSL_VERSION_TLS1)
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1627,10 +1635,14 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
|
PY_SSL_VERSION_SSL23);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff -r -u setup.py setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -308,10 +309,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1331,14 +1355,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/readline.c ./Modules/readline.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/readline.c 2013-11-10 16:36:41.000000000 +0900
|
||||||
|
+++ ./Modules/readline.c 2014-03-29 16:17:48.643305752 +0900
|
||||||
|
@@ -178,8 +178,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;
|
||||||
|
@@ -655,14 +654,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);
|
||||||
|
}
|
||||||
|
@@ -757,7 +764,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)
|
||||||
|
{
|
||||||
|
Py_XDECREF(begidx);
|
||||||
|
Py_XDECREF(endidx);
|
||||||
|
@@ -791,12 +798,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 */
|
||||||
|
rl_completer_word_break_characters =
|
||||||
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff -r -u ../Python-2.6.2.orig/setup.py ./setup.py
|
||||||
|
--- ../Python-2.6.2.orig/setup.py 2013-10-30 00:04:39.000000000 +0900
|
||||||
|
+++ ./setup.py 2014-04-03 22:28:49.122061684 +0900
|
||||||
|
@@ -1564,7 +1564,7 @@
|
||||||
|
# The versions with dots are used on Unix, and the versions without
|
||||||
|
# dots on Windows, for detection by cygwin.
|
||||||
|
tcllib = tklib = tcl_includes = tk_includes = None
|
||||||
|
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
|
||||||
|
+ for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
||||||
|
'82', '8.1', '81', '8.0', '80']:
|
||||||
|
tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
|
||||||
|
tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Lib/ssl.py ./Lib/ssl.py
|
||||||
|
--- ../Python-2.6.4.orig/Lib/ssl.py 2012-04-10 15:32:06.000000000 +0000
|
||||||
|
+++ ./Lib/ssl.py 2015-12-18 14:46:36.487188331 +0000
|
||||||
|
@@ -61,18 +61,24 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
-from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
-from _ssl import \
|
||||||
|
- SSL_ERROR_ZERO_RETURN, \
|
||||||
|
- SSL_ERROR_WANT_READ, \
|
||||||
|
- SSL_ERROR_WANT_WRITE, \
|
||||||
|
- SSL_ERROR_WANT_X509_LOOKUP, \
|
||||||
|
- SSL_ERROR_SYSCALL, \
|
||||||
|
- SSL_ERROR_SSL, \
|
||||||
|
- SSL_ERROR_WANT_CONNECT, \
|
||||||
|
- SSL_ERROR_EOF, \
|
||||||
|
- SSL_ERROR_INVALID_ERROR_CODE
|
||||||
|
+from _ssl import RAND_status, RAND_add
|
||||||
|
+try:
|
||||||
|
+ from _ssl import RAND_egd
|
||||||
|
+except ImportError:
|
||||||
|
+ # LibreSSL does not provide RAND_egd
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
+def _import_symbols(prefix):
|
||||||
|
+ for n in dir(_ssl):
|
||||||
|
+ if n.startswith(prefix):
|
||||||
|
+ globals()[n] = getattr(_ssl, n)
|
||||||
|
+
|
||||||
|
+_import_symbols('OP_')
|
||||||
|
+_import_symbols('ALERT_DESCRIPTION_')
|
||||||
|
+_import_symbols('SSL_ERROR_')
|
||||||
|
+_import_symbols('PROTOCOL_')
|
||||||
|
+
|
||||||
|
+_PROTOCOL_NAMES = dict([(value, name) for name, value in globals().items() if name.startswith('PROTOCOL_')])
|
||||||
|
|
||||||
|
from socket import socket, _fileobject
|
||||||
|
from socket import getnameinfo as _getnameinfo
|
||||||
|
@@ -394,7 +400,7 @@
|
||||||
|
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||||
|
return base64.decodestring(d)
|
||||||
|
|
||||||
|
-def get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||||
|
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||||
|
|
||||||
|
"""Retrieve the certificate from the server at the specified address,
|
||||||
|
and return it as a PEM-encoded string.
|
||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/_ssl.c ./Modules/_ssl.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/_ssl.c 2012-04-10 15:32:09.000000000 +0000
|
||||||
|
+++ ./Modules/_ssl.c 2015-12-18 14:45:30.419597074 +0000
|
||||||
|
@@ -61,8 +61,12 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1,
|
||||||
|
};
|
||||||
|
@@ -298,10 +302,14 @@
|
||||||
|
PySSL_BEGIN_ALLOW_THREADS
|
||||||
|
if (proto_version == PY_SSL_VERSION_TLS1)
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1627,10 +1635,14 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
|
PY_SSL_VERSION_SSL23);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff -r -u setup.py setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -308,10 +309,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1331,14 +1355,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/readline.c ./Modules/readline.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/readline.c 2013-11-10 16:36:41.000000000 +0900
|
||||||
|
+++ ./Modules/readline.c 2014-03-29 16:17:48.643305752 +0900
|
||||||
|
@@ -178,8 +178,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;
|
||||||
|
@@ -655,14 +654,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);
|
||||||
|
}
|
||||||
|
@@ -757,7 +764,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)
|
||||||
|
{
|
||||||
|
Py_XDECREF(begidx);
|
||||||
|
Py_XDECREF(endidx);
|
||||||
|
@@ -791,12 +798,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 */
|
||||||
|
rl_completer_word_break_characters =
|
||||||
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/setup.py ./setup.py
|
||||||
|
--- ../Python-2.6.4.orig/setup.py 2013-10-30 00:04:39.000000000 +0900
|
||||||
|
+++ ./setup.py 2014-04-03 22:28:49.122061684 +0900
|
||||||
|
@@ -1573,7 +1573,7 @@
|
||||||
|
# The versions with dots are used on Unix, and the versions without
|
||||||
|
# dots on Windows, for detection by cygwin.
|
||||||
|
tcllib = tklib = tcl_includes = tk_includes = None
|
||||||
|
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
|
||||||
|
+ for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
||||||
|
'82', '8.1', '81', '8.0', '80']:
|
||||||
|
tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
|
||||||
|
tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Lib/ssl.py ./Lib/ssl.py
|
||||||
|
--- ../Python-2.6.4.orig/Lib/ssl.py 2012-04-10 15:32:06.000000000 +0000
|
||||||
|
+++ ./Lib/ssl.py 2015-12-18 14:46:36.487188331 +0000
|
||||||
|
@@ -61,18 +61,24 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
-from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
-from _ssl import \
|
||||||
|
- SSL_ERROR_ZERO_RETURN, \
|
||||||
|
- SSL_ERROR_WANT_READ, \
|
||||||
|
- SSL_ERROR_WANT_WRITE, \
|
||||||
|
- SSL_ERROR_WANT_X509_LOOKUP, \
|
||||||
|
- SSL_ERROR_SYSCALL, \
|
||||||
|
- SSL_ERROR_SSL, \
|
||||||
|
- SSL_ERROR_WANT_CONNECT, \
|
||||||
|
- SSL_ERROR_EOF, \
|
||||||
|
- SSL_ERROR_INVALID_ERROR_CODE
|
||||||
|
+from _ssl import RAND_status, RAND_add
|
||||||
|
+try:
|
||||||
|
+ from _ssl import RAND_egd
|
||||||
|
+except ImportError:
|
||||||
|
+ # LibreSSL does not provide RAND_egd
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
+def _import_symbols(prefix):
|
||||||
|
+ for n in dir(_ssl):
|
||||||
|
+ if n.startswith(prefix):
|
||||||
|
+ globals()[n] = getattr(_ssl, n)
|
||||||
|
+
|
||||||
|
+_import_symbols('OP_')
|
||||||
|
+_import_symbols('ALERT_DESCRIPTION_')
|
||||||
|
+_import_symbols('SSL_ERROR_')
|
||||||
|
+_import_symbols('PROTOCOL_')
|
||||||
|
+
|
||||||
|
+_PROTOCOL_NAMES = dict([(value, name) for name, value in globals().items() if name.startswith('PROTOCOL_')])
|
||||||
|
|
||||||
|
from socket import socket, _fileobject
|
||||||
|
from socket import getnameinfo as _getnameinfo
|
||||||
|
@@ -394,7 +400,7 @@
|
||||||
|
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||||
|
return base64.decodestring(d)
|
||||||
|
|
||||||
|
-def get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||||
|
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||||
|
|
||||||
|
"""Retrieve the certificate from the server at the specified address,
|
||||||
|
and return it as a PEM-encoded string.
|
||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/_ssl.c ./Modules/_ssl.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/_ssl.c 2012-04-10 15:32:09.000000000 +0000
|
||||||
|
+++ ./Modules/_ssl.c 2015-12-18 14:45:30.419597074 +0000
|
||||||
|
@@ -61,8 +61,12 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1,
|
||||||
|
};
|
||||||
|
@@ -298,10 +302,14 @@
|
||||||
|
PySSL_BEGIN_ALLOW_THREADS
|
||||||
|
if (proto_version == PY_SSL_VERSION_TLS1)
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1627,10 +1635,14 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
|
PY_SSL_VERSION_SSL23);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff -r -u setup.py setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -308,10 +309,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1331,14 +1355,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/readline.c ./Modules/readline.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/readline.c 2013-11-10 16:36:41.000000000 +0900
|
||||||
|
+++ ./Modules/readline.c 2014-03-29 16:17:48.643305752 +0900
|
||||||
|
@@ -178,8 +178,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;
|
||||||
|
@@ -655,14 +654,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);
|
||||||
|
}
|
||||||
|
@@ -757,7 +764,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)
|
||||||
|
{
|
||||||
|
Py_XDECREF(begidx);
|
||||||
|
Py_XDECREF(endidx);
|
||||||
|
@@ -791,12 +798,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 */
|
||||||
|
rl_completer_word_break_characters =
|
||||||
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/setup.py ./setup.py
|
||||||
|
--- ../Python-2.6.4.orig/setup.py 2013-10-30 00:04:39.000000000 +0900
|
||||||
|
+++ ./setup.py 2014-04-03 22:28:49.122061684 +0900
|
||||||
|
@@ -1573,7 +1573,7 @@
|
||||||
|
# The versions with dots are used on Unix, and the versions without
|
||||||
|
# dots on Windows, for detection by cygwin.
|
||||||
|
tcllib = tklib = tcl_includes = tk_includes = None
|
||||||
|
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
|
||||||
|
+ for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
||||||
|
'82', '8.1', '81', '8.0', '80']:
|
||||||
|
tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
|
||||||
|
tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
diff -r -u ../Python-2.6.4.orig/Lib/ssl.py ./Lib/ssl.py
|
||||||
|
--- ../Python-2.6.4.orig/Lib/ssl.py 2012-04-10 15:32:06.000000000 +0000
|
||||||
|
+++ ./Lib/ssl.py 2015-12-18 14:46:36.487188331 +0000
|
||||||
|
@@ -61,18 +61,24 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
-from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
-from _ssl import \
|
||||||
|
- SSL_ERROR_ZERO_RETURN, \
|
||||||
|
- SSL_ERROR_WANT_READ, \
|
||||||
|
- SSL_ERROR_WANT_WRITE, \
|
||||||
|
- SSL_ERROR_WANT_X509_LOOKUP, \
|
||||||
|
- SSL_ERROR_SYSCALL, \
|
||||||
|
- SSL_ERROR_SSL, \
|
||||||
|
- SSL_ERROR_WANT_CONNECT, \
|
||||||
|
- SSL_ERROR_EOF, \
|
||||||
|
- SSL_ERROR_INVALID_ERROR_CODE
|
||||||
|
+from _ssl import RAND_status, RAND_add
|
||||||
|
+try:
|
||||||
|
+ from _ssl import RAND_egd
|
||||||
|
+except ImportError:
|
||||||
|
+ # LibreSSL does not provide RAND_egd
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
+def _import_symbols(prefix):
|
||||||
|
+ for n in dir(_ssl):
|
||||||
|
+ if n.startswith(prefix):
|
||||||
|
+ globals()[n] = getattr(_ssl, n)
|
||||||
|
+
|
||||||
|
+_import_symbols('OP_')
|
||||||
|
+_import_symbols('ALERT_DESCRIPTION_')
|
||||||
|
+_import_symbols('SSL_ERROR_')
|
||||||
|
+_import_symbols('PROTOCOL_')
|
||||||
|
+
|
||||||
|
+_PROTOCOL_NAMES = dict([(value, name) for name, value in globals().items() if name.startswith('PROTOCOL_')])
|
||||||
|
|
||||||
|
from socket import socket, _fileobject
|
||||||
|
from socket import getnameinfo as _getnameinfo
|
||||||
|
@@ -394,7 +400,7 @@
|
||||||
|
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||||
|
return base64.decodestring(d)
|
||||||
|
|
||||||
|
-def get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||||
|
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||||
|
|
||||||
|
"""Retrieve the certificate from the server at the specified address,
|
||||||
|
and return it as a PEM-encoded string.
|
||||||
|
diff -r -u ../Python-2.6.4.orig/Modules/_ssl.c ./Modules/_ssl.c
|
||||||
|
--- ../Python-2.6.4.orig/Modules/_ssl.c 2012-04-10 15:32:09.000000000 +0000
|
||||||
|
+++ ./Modules/_ssl.c 2015-12-18 14:45:30.419597074 +0000
|
||||||
|
@@ -61,8 +61,12 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1,
|
||||||
|
};
|
||||||
|
@@ -298,10 +302,14 @@
|
||||||
|
PySSL_BEGIN_ALLOW_THREADS
|
||||||
|
if (proto_version == PY_SSL_VERSION_TLS1)
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1627,10 +1635,14 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
|
PY_SSL_VERSION_SSL23);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff -r -u setup.py setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -15,6 +15,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -308,10 +309,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1339,14 +1363,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
diff -r -u ../Python-2.6.5.orig/Modules/readline.c ./Modules/readline.c
|
||||||
|
--- ../Python-2.6.5.orig/Modules/readline.c 2013-11-10 16:36:41.000000000 +0900
|
||||||
|
+++ ./Modules/readline.c 2014-03-29 16:17:48.643305752 +0900
|
||||||
|
@@ -199,8 +199,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;
|
||||||
|
@@ -699,14 +698,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);
|
||||||
|
}
|
||||||
|
@@ -801,7 +808,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';
|
||||||
|
@@ -841,12 +848,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 */
|
||||||
|
rl_completer_word_break_characters =
|
||||||
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff -r -u ../Python-2.6.5.orig/setup.py ./setup.py
|
||||||
|
--- ../Python-2.6.5.orig/setup.py 2013-10-30 00:04:39.000000000 +0900
|
||||||
|
+++ ./setup.py 2014-04-03 22:28:49.122061684 +0900
|
||||||
|
@@ -1581,7 +1581,7 @@
|
||||||
|
# The versions with dots are used on Unix, and the versions without
|
||||||
|
# dots on Windows, for detection by cygwin.
|
||||||
|
tcllib = tklib = tcl_includes = tk_includes = None
|
||||||
|
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
|
||||||
|
+ for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
||||||
|
'82', '8.1', '81', '8.0', '80']:
|
||||||
|
tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
|
||||||
|
tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
diff -r -u ../Python-2.6.5.orig/Lib/ssl.py ./Lib/ssl.py
|
||||||
|
--- ../Python-2.6.5.orig/Lib/ssl.py 2012-04-10 15:32:06.000000000 +0000
|
||||||
|
+++ ./Lib/ssl.py 2015-12-18 14:46:36.487188331 +0000
|
||||||
|
@@ -61,18 +61,24 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
-from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
-from _ssl import \
|
||||||
|
- SSL_ERROR_ZERO_RETURN, \
|
||||||
|
- SSL_ERROR_WANT_READ, \
|
||||||
|
- SSL_ERROR_WANT_WRITE, \
|
||||||
|
- SSL_ERROR_WANT_X509_LOOKUP, \
|
||||||
|
- SSL_ERROR_SYSCALL, \
|
||||||
|
- SSL_ERROR_SSL, \
|
||||||
|
- SSL_ERROR_WANT_CONNECT, \
|
||||||
|
- SSL_ERROR_EOF, \
|
||||||
|
- SSL_ERROR_INVALID_ERROR_CODE
|
||||||
|
+from _ssl import RAND_status, RAND_add
|
||||||
|
+try:
|
||||||
|
+ from _ssl import RAND_egd
|
||||||
|
+except ImportError:
|
||||||
|
+ # LibreSSL does not provide RAND_egd
|
||||||
|
+ pass
|
||||||
|
+
|
||||||
|
+def _import_symbols(prefix):
|
||||||
|
+ for n in dir(_ssl):
|
||||||
|
+ if n.startswith(prefix):
|
||||||
|
+ globals()[n] = getattr(_ssl, n)
|
||||||
|
+
|
||||||
|
+_import_symbols('OP_')
|
||||||
|
+_import_symbols('ALERT_DESCRIPTION_')
|
||||||
|
+_import_symbols('SSL_ERROR_')
|
||||||
|
+_import_symbols('PROTOCOL_')
|
||||||
|
+
|
||||||
|
+_PROTOCOL_NAMES = dict([(value, name) for name, value in globals().items() if name.startswith('PROTOCOL_')])
|
||||||
|
|
||||||
|
from socket import socket, _fileobject
|
||||||
|
from socket import getnameinfo as _getnameinfo
|
||||||
|
@@ -394,7 +400,7 @@
|
||||||
|
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
|
||||||
|
return base64.decodestring(d)
|
||||||
|
|
||||||
|
-def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
|
||||||
|
+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
|
||||||
|
|
||||||
|
"""Retrieve the certificate from the server at the specified address,
|
||||||
|
and return it as a PEM-encoded string.
|
||||||
|
diff -r -u ../Python-2.6.5.orig/Modules/_ssl.c ./Modules/_ssl.c
|
||||||
|
--- ../Python-2.6.5.orig/Modules/_ssl.c 2012-04-10 15:32:09.000000000 +0000
|
||||||
|
+++ ./Modules/_ssl.c 2015-12-18 14:45:30.419597074 +0000
|
||||||
|
@@ -61,8 +61,12 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1,
|
||||||
|
};
|
||||||
|
@@ -298,10 +302,14 @@
|
||||||
|
PySSL_BEGIN_ALLOW_THREADS
|
||||||
|
if (proto_version == PY_SSL_VERSION_TLS1)
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1627,10 +1635,14 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
+#ifndef OPENSSL_NO_SSL3
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
|
PY_SSL_VERSION_SSL23);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
|
||||||
@@ -44,4 +44,20 @@ diff -r -u setup.py setup.py
|
|||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1443,14 +1443,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|||||||
@@ -44,4 +44,20 @@ diff -r -u setup.py setup.py
|
|||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1443,14 +1443,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|||||||
@@ -44,4 +44,20 @@ diff -r -u setup.py setup.py
|
|||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1443,14 +1443,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|||||||
@@ -44,4 +44,20 @@ diff -r -u setup.py setup.py
|
|||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1443,14 +1443,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform == 'linux2':
|
||||||
|
+ if platform.startswith('linux'):
|
||||||
|
# Linux-specific modules
|
||||||
|
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('linuxaudiodev')
|
||||||
|
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
From 5495fb4719fa67ea3abeda0434699c8b28c77bb3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 16:50:14 +0900
|
||||||
|
Subject: [PATCH 1/7] Detect arm64 in configure
|
||||||
|
|
||||||
|
---
|
||||||
|
configure | 3 +++
|
||||||
|
configure.ac | 3 +++
|
||||||
|
2 files changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/configure b/configure
|
||||||
|
index 63d675312d..c40ec120de 100755
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -8474,6 +8474,9 @@ fi
|
||||||
|
ppc)
|
||||||
|
MACOSX_DEFAULT_ARCH="ppc64"
|
||||||
|
;;
|
||||||
|
+ arm64)
|
||||||
|
+ MACOSX_DEFAULT_ARCH="arm64"
|
||||||
|
+ ;;
|
||||||
|
*)
|
||||||
|
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
|
||||||
|
;;
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index efe6922b5d..df05bee87b 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -2066,6 +2066,9 @@ case $ac_sys_system/$ac_sys_release in
|
||||||
|
ppc)
|
||||||
|
MACOSX_DEFAULT_ARCH="ppc64"
|
||||||
|
;;
|
||||||
|
+ arm64)
|
||||||
|
+ MACOSX_DEFAULT_ARCH="arm64"
|
||||||
|
+ ;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
||||||
|
;;
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
From f17b9e30bd295b1eec68105e3f04568477ce6286 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 17:14:34 +0900
|
||||||
|
Subject: [PATCH 2/7] Fix macOS _tkinter use of Tck/Tk in /Library/Framework
|
||||||
|
|
||||||
|
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||||
|
---
|
||||||
|
setup.py | 148 +++++++++++++++++++++++++++++++++++++++----------------
|
||||||
|
1 file changed, 106 insertions(+), 42 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index f764223d06..da1d34efaf 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -50,6 +50,7 @@ def add_dir_to_list(dirlist, dir):
|
||||||
|
dirlist.insert(0, dir)
|
||||||
|
|
||||||
|
MACOS_SDK_ROOT = None
|
||||||
|
+MACOS_SDK_SPECIFIED = None
|
||||||
|
|
||||||
|
def macosx_sdk_root():
|
||||||
|
"""Return the directory of the current macOS SDK.
|
||||||
|
@@ -61,8 +62,9 @@ def macosx_sdk_root():
|
||||||
|
(The SDK may be supplied via Xcode or via the Command Line Tools).
|
||||||
|
The SDK paths used by Apple-supplied tool chains depend on the
|
||||||
|
setting of various variables; see the xcrun man page for more info.
|
||||||
|
+ Also sets MACOS_SDK_SPECIFIED for use by macosx_sdk_specified().
|
||||||
|
"""
|
||||||
|
- global MACOS_SDK_ROOT
|
||||||
|
+ global MACOS_SDK_ROOT, MACOS_SDK_SPECIFIED
|
||||||
|
|
||||||
|
# If already called, return cached result.
|
||||||
|
if MACOS_SDK_ROOT:
|
||||||
|
@@ -72,8 +74,10 @@ def macosx_sdk_root():
|
||||||
|
m = re.search(r'-isysroot\s+(\S+)', cflags)
|
||||||
|
if m is not None:
|
||||||
|
MACOS_SDK_ROOT = m.group(1)
|
||||||
|
+ MACOS_SDK_SPECIFIED = MACOS_SDK_ROOT != '/'
|
||||||
|
else:
|
||||||
|
MACOS_SDK_ROOT = '/'
|
||||||
|
+ MACOS_SDK_SPECIFIED = False
|
||||||
|
cc = sysconfig.get_config_var('CC')
|
||||||
|
tmpfile = '/tmp/setup_sdk_root.%d' % os.getpid()
|
||||||
|
try:
|
||||||
|
@@ -101,6 +105,27 @@ def macosx_sdk_root():
|
||||||
|
|
||||||
|
return MACOS_SDK_ROOT
|
||||||
|
|
||||||
|
+def macosx_sdk_specified():
|
||||||
|
+ """Returns true if an SDK was explicitly configured.
|
||||||
|
+
|
||||||
|
+ True if an SDK was selected at configure time, either by specifying
|
||||||
|
+ --enable-universalsdk=(something other than no or /) or by adding a
|
||||||
|
+ -isysroot option to CFLAGS. In some cases, like when making
|
||||||
|
+ decisions about macOS Tk framework paths, we need to be able to
|
||||||
|
+ know whether the user explicitly asked to build with an SDK versus
|
||||||
|
+ the implicit use of an SDK when header files are no longer
|
||||||
|
+ installed on a running system by the Command Line Tools.
|
||||||
|
+ """
|
||||||
|
+ global MACOS_SDK_SPECIFIED
|
||||||
|
+
|
||||||
|
+ # If already called, return cached result.
|
||||||
|
+ if MACOS_SDK_SPECIFIED:
|
||||||
|
+ return MACOS_SDK_SPECIFIED
|
||||||
|
+
|
||||||
|
+ # Find the sdk root and set MACOS_SDK_SPECIFIED
|
||||||
|
+ macosx_sdk_root()
|
||||||
|
+ return MACOS_SDK_SPECIFIED
|
||||||
|
+
|
||||||
|
def is_macosx_sdk_path(path):
|
||||||
|
"""
|
||||||
|
Returns True if 'path' can be located in an OSX SDK
|
||||||
|
@@ -1834,31 +1859,72 @@ class PyBuildExt(build_ext):
|
||||||
|
return 1
|
||||||
|
|
||||||
|
def detect_tkinter_darwin(self, inc_dirs, lib_dirs):
|
||||||
|
- # The _tkinter module, using frameworks. Since frameworks are quite
|
||||||
|
- # different the UNIX search logic is not sharable.
|
||||||
|
- from os.path import join, exists
|
||||||
|
- framework_dirs = [
|
||||||
|
- '/Library/Frameworks',
|
||||||
|
- '/System/Library/Frameworks/',
|
||||||
|
- join(os.getenv('HOME'), '/Library/Frameworks')
|
||||||
|
- ]
|
||||||
|
+ # Build default _tkinter on macOS using Tcl and Tk frameworks.
|
||||||
|
+ #
|
||||||
|
+ # The macOS native Tk (AKA Aqua Tk) and Tcl are most commonly
|
||||||
|
+ # built and installed as macOS framework bundles. However,
|
||||||
|
+ # for several reasons, we cannot take full advantage of the
|
||||||
|
+ # Apple-supplied compiler chain's -framework options here.
|
||||||
|
+ # Instead, we need to find and pass to the compiler the
|
||||||
|
+ # absolute paths of the Tcl and Tk headers files we want to use
|
||||||
|
+ # and the absolute path to the directory containing the Tcl
|
||||||
|
+ # and Tk frameworks for linking.
|
||||||
|
+ #
|
||||||
|
+ # We want to handle here two common use cases on macOS:
|
||||||
|
+ # 1. Build and link with system-wide third-party or user-built
|
||||||
|
+ # Tcl and Tk frameworks installed in /Library/Frameworks.
|
||||||
|
+ # 2. Build and link using a user-specified macOS SDK so that the
|
||||||
|
+ # built Python can be exported to other systems. In this case,
|
||||||
|
+ # search only the SDK's /Library/Frameworks (normally empty)
|
||||||
|
+ # and /System/Library/Frameworks.
|
||||||
|
+ #
|
||||||
|
+ # Any other use case should be able to be handled explicitly by
|
||||||
|
+ # using the options described above in detect_tkinter_explicitly().
|
||||||
|
+ # In particular it would be good to handle here the case where
|
||||||
|
+ # you want to build and link with a framework build of Tcl and Tk
|
||||||
|
+ # that is not in /Library/Frameworks, say, in your private
|
||||||
|
+ # $HOME/Library/Frameworks directory or elsewhere. It turns
|
||||||
|
+ # out to be difficult to make that work automtically here
|
||||||
|
+ # without bringing into play more tools and magic. That case
|
||||||
|
+ # can be hamdled using a recipe with the right arguments
|
||||||
|
+ # to detect_tkinter_explicitly().
|
||||||
|
+ #
|
||||||
|
+ # Note also that the fallback case here is to try to use the
|
||||||
|
+ # Apple-supplied Tcl and Tk frameworks in /System/Library but
|
||||||
|
+ # be forewarned that they are deprecated by Apple and typically
|
||||||
|
+ # out-of-date and buggy; their use should be avoided if at
|
||||||
|
+ # all possible by installing a newer version of Tcl and Tk in
|
||||||
|
+ # /Library/Frameworks before bwfore building Python without
|
||||||
|
+ # an explicit SDK or by configuring build arguments explicitly.
|
||||||
|
|
||||||
|
- sysroot = macosx_sdk_root()
|
||||||
|
+ from os.path import join, exists
|
||||||
|
+ sysroot = macosx_sdk_root() # path to the SDK or '/'
|
||||||
|
+
|
||||||
|
+ if macosx_sdk_specified():
|
||||||
|
+ # Use case #2: an SDK other than '/' was specified.
|
||||||
|
+ # Only search there.
|
||||||
|
+ framework_dirs = [
|
||||||
|
+ join(sysroot, 'Library', 'Frameworks'),
|
||||||
|
+ join(sysroot, 'System', 'Library', 'Frameworks'),
|
||||||
|
+ ]
|
||||||
|
+ else:
|
||||||
|
+ # Use case #1: no explicit SDK selected.
|
||||||
|
+ # Search the local system-wide /Library/Frameworks,
|
||||||
|
+ # not the one in the default SDK, othewise fall back to
|
||||||
|
+ # /System/Library/Frameworks whose header files may be in
|
||||||
|
+ # the default SDK or, on older systems, actually installed.
|
||||||
|
+ framework_dirs = [
|
||||||
|
+ join('/', 'Library', 'Frameworks'),
|
||||||
|
+ join(sysroot, 'System', 'Library', 'Frameworks'),
|
||||||
|
+ ]
|
||||||
|
|
||||||
|
- # Find the directory that contains the Tcl.framework and Tk.framework
|
||||||
|
- # bundles.
|
||||||
|
- # XXX distutils should support -F!
|
||||||
|
+ # Find the directory that contains the Tcl.framework and
|
||||||
|
+ # Tk.framework bundles.
|
||||||
|
for F in framework_dirs:
|
||||||
|
# both Tcl.framework and Tk.framework should be present
|
||||||
|
-
|
||||||
|
-
|
||||||
|
for fw in 'Tcl', 'Tk':
|
||||||
|
- if is_macosx_sdk_path(F):
|
||||||
|
- if not exists(join(sysroot, F[1:], fw + '.framework')):
|
||||||
|
- break
|
||||||
|
- else:
|
||||||
|
- if not exists(join(F, fw + '.framework')):
|
||||||
|
- break
|
||||||
|
+ if not exists(join(F, fw + '.framework')):
|
||||||
|
+ break
|
||||||
|
else:
|
||||||
|
# ok, F is now directory with both frameworks. Continure
|
||||||
|
# building
|
||||||
|
@@ -1868,32 +1934,20 @@ class PyBuildExt(build_ext):
|
||||||
|
# will now resume.
|
||||||
|
return 0
|
||||||
|
|
||||||
|
- # For 8.4a2, we must add -I options that point inside the Tcl and Tk
|
||||||
|
- # frameworks. In later release we should hopefully be able to pass
|
||||||
|
- # the -F option to gcc, which specifies a framework lookup path.
|
||||||
|
- #
|
||||||
|
include_dirs = [
|
||||||
|
join(F, fw + '.framework', H)
|
||||||
|
for fw in 'Tcl', 'Tk'
|
||||||
|
- for H in 'Headers', 'Versions/Current/PrivateHeaders'
|
||||||
|
+ for H in ('Headers',)
|
||||||
|
]
|
||||||
|
|
||||||
|
- # For 8.4a2, the X11 headers are not included. Rather than include a
|
||||||
|
- # complicated search, this is a hard-coded path. It could bail out
|
||||||
|
- # if X11 libs are not found...
|
||||||
|
- include_dirs.append('/usr/X11R6/include')
|
||||||
|
- frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
|
||||||
|
+ # Add the base framework directory as well
|
||||||
|
+ compile_args = ['-F', F]
|
||||||
|
|
||||||
|
- # All existing framework builds of Tcl/Tk don't support 64-bit
|
||||||
|
- # architectures.
|
||||||
|
+ # Do not build tkinter for archs that this Tk was not built with.
|
||||||
|
cflags = sysconfig.get_config_vars('CFLAGS')[0]
|
||||||
|
archs = re.findall('-arch\s+(\w+)', cflags)
|
||||||
|
|
||||||
|
- if is_macosx_sdk_path(F):
|
||||||
|
- fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(os.path.join(sysroot, F[1:]),))
|
||||||
|
- else:
|
||||||
|
- fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,))
|
||||||
|
-
|
||||||
|
+ fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,))
|
||||||
|
detected_archs = []
|
||||||
|
for ln in fp:
|
||||||
|
a = ln.split()[-1]
|
||||||
|
@@ -1901,16 +1955,26 @@ class PyBuildExt(build_ext):
|
||||||
|
detected_archs.append(ln.split()[-1])
|
||||||
|
fp.close()
|
||||||
|
|
||||||
|
+ arch_args = []
|
||||||
|
for a in detected_archs:
|
||||||
|
- frameworks.append('-arch')
|
||||||
|
- frameworks.append(a)
|
||||||
|
+ arch_args.append('-arch')
|
||||||
|
+ arch_args.append(a)
|
||||||
|
+
|
||||||
|
+ compile_args += arch_args
|
||||||
|
+ link_args = [','.join(['-Wl', '-F', F, '-framework', 'Tcl', '-framework', 'Tk'])] + arch_args
|
||||||
|
+
|
||||||
|
+ # The X11/xlib.h file bundled in the Tk sources can cause function
|
||||||
|
+ # prototype warnings from the compiler. Since we cannot easily fix
|
||||||
|
+ # that, suppress the warnings here instead.
|
||||||
|
+ if '-Wstrict-prototypes' in cflags.split():
|
||||||
|
+ compile_args.append('-Wno-strict-prototypes')
|
||||||
|
|
||||||
|
ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
|
||||||
|
define_macros=[('WITH_APPINIT', 1)],
|
||||||
|
include_dirs = include_dirs,
|
||||||
|
libraries = [],
|
||||||
|
- extra_compile_args = frameworks[2:],
|
||||||
|
- extra_link_args = frameworks,
|
||||||
|
+ extra_compile_args = compile_args,
|
||||||
|
+ extra_link_args = link_args,
|
||||||
|
)
|
||||||
|
self.extensions.append(ext)
|
||||||
|
return 1
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
From d93a26fee21a5f91c51d8cb14ecaf29122f1b222 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 17:25:00 +0900
|
||||||
|
Subject: [PATCH 3/7] Support "arm64" in Mac/Tools/pythonw
|
||||||
|
|
||||||
|
Imported from: https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||||
|
---
|
||||||
|
Mac/Tools/pythonw.c | 6 ++++++
|
||||||
|
1 file changed, 6 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c
|
||||||
|
index 76734c1063..ebe5e8d975 100644
|
||||||
|
--- a/Mac/Tools/pythonw.c
|
||||||
|
+++ b/Mac/Tools/pythonw.c
|
||||||
|
@@ -116,10 +116,16 @@ setup_spawnattr(posix_spawnattr_t* spawnattr)
|
||||||
|
|
||||||
|
#elif defined(__ppc__)
|
||||||
|
cpu_types[0] = CPU_TYPE_POWERPC;
|
||||||
|
+
|
||||||
|
#elif defined(__i386__)
|
||||||
|
cpu_types[0] = CPU_TYPE_X86;
|
||||||
|
+
|
||||||
|
+#elif defined(__arm64__)
|
||||||
|
+ cpu_types[0] = CPU_TYPE_ARM64;
|
||||||
|
+
|
||||||
|
#else
|
||||||
|
# error "Unknown CPU"
|
||||||
|
+
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (posix_spawnattr_setbinpref_np(spawnattr, count,
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
From a1b08c7de72c27d80a86b92c263d1f5b351e581b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 18:07:48 +0900
|
||||||
|
Subject: [PATCH 4/7] Use system libffi for Mac OS 10.15 and up
|
||||||
|
|
||||||
|
Modified and imported from: https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||||
|
---
|
||||||
|
setup.py | 37 ++++++++++++++++++++++++++++---------
|
||||||
|
1 file changed, 28 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index da1d34efaf..c92d0552e3 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -126,6 +126,13 @@ def macosx_sdk_specified():
|
||||||
|
macosx_sdk_root()
|
||||||
|
return MACOS_SDK_SPECIFIED
|
||||||
|
|
||||||
|
+def is_macosx_at_least(vers):
|
||||||
|
+ if host_platform == 'darwin':
|
||||||
|
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
||||||
|
+ if dep_target:
|
||||||
|
+ return tuple(map(int, str(dep_target).split('.'))) >= vers
|
||||||
|
+ return False
|
||||||
|
+
|
||||||
|
def is_macosx_sdk_path(path):
|
||||||
|
"""
|
||||||
|
Returns True if 'path' can be located in an OSX SDK
|
||||||
|
@@ -2180,7 +2187,11 @@ class PyBuildExt(build_ext):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def detect_ctypes(self, inc_dirs, lib_dirs):
|
||||||
|
- self.use_system_libffi = False
|
||||||
|
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
|
||||||
|
+ self.use_system_libffi = True
|
||||||
|
+ else:
|
||||||
|
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
|
||||||
|
+
|
||||||
|
include_dirs = []
|
||||||
|
extra_compile_args = []
|
||||||
|
extra_link_args = []
|
||||||
|
@@ -2224,15 +2235,24 @@ class PyBuildExt(build_ext):
|
||||||
|
sources=['_ctypes/_ctypes_test.c'])
|
||||||
|
self.extensions.extend([ext, ext_test])
|
||||||
|
|
||||||
|
- if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||||
|
- return
|
||||||
|
+ ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||||
|
+ ffi_lib = None
|
||||||
|
|
||||||
|
+ #inc_dirs = self.inc_dirs.copy()
|
||||||
|
+ inc_dirs = self.compiler.include_dirs[:]
|
||||||
|
if host_platform == 'darwin':
|
||||||
|
- # OS X 10.5 comes with libffi.dylib; the include files are
|
||||||
|
- # in /usr/include/ffi
|
||||||
|
- inc_dirs.append('/usr/include/ffi')
|
||||||
|
+ if not self.use_system_libffi:
|
||||||
|
+ return
|
||||||
|
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
|
||||||
|
+ if os.path.exists(ffi_in_sdk):
|
||||||
|
+ ffi_inc = [ffi_in_sdk]
|
||||||
|
+ ffi_lib = 'ffi'
|
||||||
|
+ sources.remove('_ctypes/malloc_closure.c')
|
||||||
|
+ else:
|
||||||
|
+ # OS X 10.5 comes with libffi.dylib; the include files are
|
||||||
|
+ # in /usr/include/ffi
|
||||||
|
+ inc_dirs.append('/usr/include/ffi')
|
||||||
|
|
||||||
|
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||||
|
if not ffi_inc or ffi_inc[0] == '':
|
||||||
|
ffi_inc = find_file('ffi.h', [], inc_dirs)
|
||||||
|
if ffi_inc is not None:
|
||||||
|
@@ -2247,8 +2267,7 @@ class PyBuildExt(build_ext):
|
||||||
|
ffi_inc = None
|
||||||
|
print('Header file {} does not define LIBFFI_H or '
|
||||||
|
'ffi_wrapper_h'.format(ffi_h))
|
||||||
|
- ffi_lib = None
|
||||||
|
- if ffi_inc is not None:
|
||||||
|
+ if ffi_lib is None and ffi_inc is not None:
|
||||||
|
for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
|
||||||
|
if (self.compiler.find_library_file(lib_dirs, lib_name)):
|
||||||
|
ffi_lib = lib_name
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
From 4394ec26842b04335b30b9a0595fcc8591c68496 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 18:59:44 +0900
|
||||||
|
Subject: [PATCH 5/7] ctypes: use the correct ABI for variadic functions
|
||||||
|
|
||||||
|
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||||
|
---
|
||||||
|
Doc/library/ctypes.rst | 6 +++++
|
||||||
|
Lib/test/test_str.py | 2 ++
|
||||||
|
Lib/test/test_unicode.py | 3 +++
|
||||||
|
Modules/_ctypes/_ctypes.c | 31 +++++++++++++++++++++++
|
||||||
|
Modules/_ctypes/callproc.c | 51 +++++++++++++++++++++++++++++---------
|
||||||
|
Modules/_ctypes/ctypes.h | 1 +
|
||||||
|
6 files changed, 82 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
|
||||||
|
index 6a5299145f..ec97da607f 100644
|
||||||
|
--- a/Doc/library/ctypes.rst
|
||||||
|
+++ b/Doc/library/ctypes.rst
|
||||||
|
@@ -1584,6 +1584,12 @@ They are instances of a private class:
|
||||||
|
value usable as argument (integer, string, ctypes instance). This allows
|
||||||
|
defining adapters that can adapt custom objects as function parameters.
|
||||||
|
|
||||||
|
+ .. attribute:: variadic
|
||||||
|
+
|
||||||
|
+ Assign a boolean to specify that the function takes a variable number of
|
||||||
|
+ arguments. This does not matter on most platforms, but for Apple arm64
|
||||||
|
+ platforms variadic functions have a different calling convention than
|
||||||
|
+ normal functions.
|
||||||
|
|
||||||
|
.. attribute:: errcheck
|
||||||
|
|
||||||
|
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
|
||||||
|
index 73ed542a51..131f6d13e0 100644
|
||||||
|
--- a/Lib/test/test_str.py
|
||||||
|
+++ b/Lib/test/test_str.py
|
||||||
|
@@ -489,6 +489,8 @@ class CAPITest(unittest.TestCase):
|
||||||
|
c_char_p)
|
||||||
|
|
||||||
|
PyString_FromFormat = pythonapi.PyString_FromFormat
|
||||||
|
+ PyString_FromFormat.variadic = True
|
||||||
|
+ PyString_FromFormat.argtypes = (c_char_p,)
|
||||||
|
PyString_FromFormat.restype = py_object
|
||||||
|
|
||||||
|
# basic tests
|
||||||
|
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
|
||||||
|
index 92476f68a5..23e9e643e0 100644
|
||||||
|
--- a/Lib/test/test_unicode.py
|
||||||
|
+++ b/Lib/test/test_unicode.py
|
||||||
|
@@ -1676,6 +1676,7 @@ class CAPITest(unittest.TestCase):
|
||||||
|
def test_from_format(self):
|
||||||
|
test_support.import_module('ctypes')
|
||||||
|
from ctypes import (
|
||||||
|
+ c_char_p,
|
||||||
|
pythonapi, py_object, sizeof,
|
||||||
|
c_int, c_long, c_longlong, c_ssize_t,
|
||||||
|
c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
|
||||||
|
@@ -1684,6 +1685,8 @@ class CAPITest(unittest.TestCase):
|
||||||
|
else:
|
||||||
|
name = "PyUnicodeUCS4_FromFormat"
|
||||||
|
_PyUnicode_FromFormat = getattr(pythonapi, name)
|
||||||
|
+ _PyUnicode_FromFormat.argtypes = (c_char_p,)
|
||||||
|
+ _PyUnicode_FromFormat.variadic = True
|
||||||
|
_PyUnicode_FromFormat.restype = py_object
|
||||||
|
|
||||||
|
def PyUnicode_FromFormat(format, *args):
|
||||||
|
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
|
||||||
|
index bef251ef04..d03b98d09c 100644
|
||||||
|
--- a/Modules/_ctypes/_ctypes.c
|
||||||
|
+++ b/Modules/_ctypes/_ctypes.c
|
||||||
|
@@ -3253,6 +3253,34 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+static int
|
||||||
|
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
|
+{
|
||||||
|
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||||
|
+ assert(dict);
|
||||||
|
+ int r = PyObject_IsTrue(ob);
|
||||||
|
+ if (r == 1) {
|
||||||
|
+ dict->flags |= FUNCFLAG_VARIADIC;
|
||||||
|
+ return 0;
|
||||||
|
+ } else if (r == 0) {
|
||||||
|
+ dict->flags &= ~FUNCFLAG_VARIADIC;
|
||||||
|
+ return 0;
|
||||||
|
+ } else {
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static PyObject *
|
||||||
|
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self)
|
||||||
|
+{
|
||||||
|
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||||
|
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
|
||||||
|
+ if (dict->flags & FUNCFLAG_VARIADIC)
|
||||||
|
+ Py_RETURN_TRUE;
|
||||||
|
+ else
|
||||||
|
+ Py_RETURN_FALSE;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int
|
||||||
|
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob)
|
||||||
|
{
|
||||||
|
@@ -3299,6 +3327,8 @@ static PyGetSetDef PyCFuncPtr_getsets[] = {
|
||||||
|
{ "argtypes", (getter)PyCFuncPtr_get_argtypes,
|
||||||
|
(setter)PyCFuncPtr_set_argtypes,
|
||||||
|
"specify the argument types", NULL },
|
||||||
|
+ { "variadic", (getter)PyCFuncPtr_get_variadic, (setter)PyCFuncPtr_set_variadic,
|
||||||
|
+ "specify if function takes variable number of arguments", NULL },
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -5838,6 +5868,7 @@ init_ctypes(void)
|
||||||
|
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyInt_FromLong(FUNCFLAG_USE_ERRNO));
|
||||||
|
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyInt_FromLong(FUNCFLAG_USE_LASTERROR));
|
||||||
|
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyInt_FromLong(FUNCFLAG_PYTHONAPI));
|
||||||
|
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyInt_FromLong(FUNCFLAG_VARIADIC));
|
||||||
|
PyModule_AddStringConstant(m, "__version__", "1.1.0");
|
||||||
|
|
||||||
|
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
|
||||||
|
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
|
||||||
|
index 066fefc0cc..39a539db47 100644
|
||||||
|
--- a/Modules/_ctypes/callproc.c
|
||||||
|
+++ b/Modules/_ctypes/callproc.c
|
||||||
|
@@ -88,6 +88,9 @@
|
||||||
|
#define DONT_USE_SEH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if defined(__APPLE__) && __arm64__
|
||||||
|
+#define HAVE_FFI_PREP_CIF_VAR 1
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#define CTYPES_CAPSULE_ERROROBJ "_ctypes/callproc.c error object"
|
||||||
|
CTYPES_CAPSULE_INSTANTIATE_DESTRUCTOR(CTYPES_CAPSULE_ERROROBJ)
|
||||||
|
@@ -773,7 +776,8 @@ static int _call_function_pointer(int flags,
|
||||||
|
ffi_type **atypes,
|
||||||
|
ffi_type *restype,
|
||||||
|
void *resmem,
|
||||||
|
- int argcount)
|
||||||
|
+ int argcount,
|
||||||
|
+ int argtypecount)
|
||||||
|
{
|
||||||
|
#ifdef WITH_THREAD
|
||||||
|
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
|
||||||
|
@@ -801,15 +805,39 @@ static int _call_function_pointer(int flags,
|
||||||
|
if ((flags & FUNCFLAG_CDECL) == 0)
|
||||||
|
cc = FFI_STDCALL;
|
||||||
|
#endif
|
||||||
|
- if (FFI_OK != ffi_prep_cif(&cif,
|
||||||
|
- cc,
|
||||||
|
- argcount,
|
||||||
|
- restype,
|
||||||
|
- atypes)) {
|
||||||
|
- PyErr_SetString(PyExc_RuntimeError,
|
||||||
|
- "ffi_prep_cif failed");
|
||||||
|
- return -1;
|
||||||
|
+
|
||||||
|
+#if HAVE_FFI_PREP_CIF_VAR
|
||||||
|
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
|
||||||
|
+ * lots of existing code will not. If there's at least one arg and more
|
||||||
|
+ * args are passed than are defined in the prototype, then it must be a
|
||||||
|
+ * variadic function. */
|
||||||
|
+ if ((flags & FUNCFLAG_VARIADIC) ||
|
||||||
|
+ (argtypecount != 0 && argcount > argtypecount))
|
||||||
|
+ {
|
||||||
|
+ if (FFI_OK != ffi_prep_cif_var(&cif,
|
||||||
|
+ cc,
|
||||||
|
+ argtypecount,
|
||||||
|
+ argcount,
|
||||||
|
+ restype,
|
||||||
|
+ atypes)) {
|
||||||
|
+ PyErr_SetString(PyExc_RuntimeError,
|
||||||
|
+ "ffi_prep_cif_var failed");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+#endif
|
||||||
|
+ if (FFI_OK != ffi_prep_cif(&cif,
|
||||||
|
+ cc,
|
||||||
|
+ argcount,
|
||||||
|
+ restype,
|
||||||
|
+ atypes)) {
|
||||||
|
+ PyErr_SetString(PyExc_RuntimeError,
|
||||||
|
+ "ffi_prep_cif failed");
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+#if HAVE_FFI_PREP_CIF_VAR
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
|
||||||
|
error_object = _ctypes_get_errobj(&space);
|
||||||
|
@@ -1181,9 +1209,8 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||||
|
|
||||||
|
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
|
||||||
|
rtype, resbuf,
|
||||||
|
- Py_SAFE_DOWNCAST(argcount,
|
||||||
|
- Py_ssize_t,
|
||||||
|
- int)))
|
||||||
|
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
|
||||||
|
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
|
||||||
|
index 12b56c4342..8aec3d1ade 100644
|
||||||
|
--- a/Modules/_ctypes/ctypes.h
|
||||||
|
+++ b/Modules/_ctypes/ctypes.h
|
||||||
|
@@ -325,6 +325,7 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||||
|
#define FUNCFLAG_PYTHONAPI 0x4
|
||||||
|
#define FUNCFLAG_USE_ERRNO 0x8
|
||||||
|
#define FUNCFLAG_USE_LASTERROR 0x10
|
||||||
|
+#define FUNCFLAG_VARIADIC 0x20
|
||||||
|
|
||||||
|
#define TYPEFLAG_ISPOINTER 0x100
|
||||||
|
#define TYPEFLAG_HASPOINTER 0x200
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
From 43819cd35cddd189cbe513032e76f1c1a6ec6d8c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 19:14:50 +0900
|
||||||
|
Subject: [PATCH 6/7] ctypes: probe libffi for ffi_closure_alloc and
|
||||||
|
ffi_prep_cif_var
|
||||||
|
|
||||||
|
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||||
|
---
|
||||||
|
Modules/_ctypes/callproc.c | 4 ----
|
||||||
|
setup.py | 34 +++++++++++++++++++++++++---------
|
||||||
|
2 files changed, 25 insertions(+), 13 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
|
||||||
|
index 39a539db47..5273e8d246 100644
|
||||||
|
--- a/Modules/_ctypes/callproc.c
|
||||||
|
+++ b/Modules/_ctypes/callproc.c
|
||||||
|
@@ -88,10 +88,6 @@
|
||||||
|
#define DONT_USE_SEH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if defined(__APPLE__) && __arm64__
|
||||||
|
-#define HAVE_FFI_PREP_CIF_VAR 1
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
#define CTYPES_CAPSULE_ERROROBJ "_ctypes/callproc.c error object"
|
||||||
|
CTYPES_CAPSULE_INSTANTIATE_DESTRUCTOR(CTYPES_CAPSULE_ERROROBJ)
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index c92d0552e3..beaf60f3e5 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -141,6 +141,13 @@ def is_macosx_sdk_path(path):
|
||||||
|
or path.startswith('/System/')
|
||||||
|
or path.startswith('/Library/') )
|
||||||
|
|
||||||
|
+def grep_headers_for(function, headers):
|
||||||
|
+ for header in headers:
|
||||||
|
+ with open(header, 'r') as f:
|
||||||
|
+ if function in f.read():
|
||||||
|
+ return True
|
||||||
|
+ return False
|
||||||
|
+
|
||||||
|
def find_file(filename, std_dirs, paths):
|
||||||
|
"""Searches for the directory where a given file is located,
|
||||||
|
and returns a possibly-empty list of additional directories, or None
|
||||||
|
@@ -2235,7 +2242,7 @@ class PyBuildExt(build_ext):
|
||||||
|
sources=['_ctypes/_ctypes_test.c'])
|
||||||
|
self.extensions.extend([ext, ext_test])
|
||||||
|
|
||||||
|
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||||
|
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
|
||||||
|
ffi_lib = None
|
||||||
|
|
||||||
|
#inc_dirs = self.inc_dirs.copy()
|
||||||
|
@@ -2245,18 +2252,19 @@ class PyBuildExt(build_ext):
|
||||||
|
return
|
||||||
|
ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
|
||||||
|
if os.path.exists(ffi_in_sdk):
|
||||||
|
- ffi_inc = [ffi_in_sdk]
|
||||||
|
+ ffi_inc = ffi_in_sdk
|
||||||
|
ffi_lib = 'ffi'
|
||||||
|
- sources.remove('_ctypes/malloc_closure.c')
|
||||||
|
else:
|
||||||
|
# OS X 10.5 comes with libffi.dylib; the include files are
|
||||||
|
# in /usr/include/ffi
|
||||||
|
inc_dirs.append('/usr/include/ffi')
|
||||||
|
|
||||||
|
- if not ffi_inc or ffi_inc[0] == '':
|
||||||
|
- ffi_inc = find_file('ffi.h', [], inc_dirs)
|
||||||
|
- if ffi_inc is not None:
|
||||||
|
- ffi_h = ffi_inc[0] + '/ffi.h'
|
||||||
|
+ if not ffi_inc:
|
||||||
|
+ found = find_file('ffi.h', [], inc_dirs)
|
||||||
|
+ if found:
|
||||||
|
+ ffi_inc = found[0]
|
||||||
|
+ if ffi_inc:
|
||||||
|
+ ffi_h = ffi_inc + '/ffi.h'
|
||||||
|
with open(ffi_h) as f:
|
||||||
|
for line in f:
|
||||||
|
line = line.strip()
|
||||||
|
@@ -2267,14 +2275,22 @@ class PyBuildExt(build_ext):
|
||||||
|
ffi_inc = None
|
||||||
|
print('Header file {} does not define LIBFFI_H or '
|
||||||
|
'ffi_wrapper_h'.format(ffi_h))
|
||||||
|
- if ffi_lib is None and ffi_inc is not None:
|
||||||
|
+ if ffi_lib is None and ffi_inc:
|
||||||
|
for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
|
||||||
|
if (self.compiler.find_library_file(lib_dirs, lib_name)):
|
||||||
|
ffi_lib = lib_name
|
||||||
|
break
|
||||||
|
|
||||||
|
if ffi_inc and ffi_lib:
|
||||||
|
- ext.include_dirs.extend(ffi_inc)
|
||||||
|
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
|
||||||
|
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
|
||||||
|
+ try:
|
||||||
|
+ sources.remove('_ctypes/malloc_closure.c')
|
||||||
|
+ except ValueError:
|
||||||
|
+ pass
|
||||||
|
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
|
||||||
|
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
|
||||||
|
+ ext.include_dirs.append(ffi_inc)
|
||||||
|
ext.libraries.append(ffi_lib)
|
||||||
|
self.use_system_libffi = True
|
||||||
|
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
From 41ee254166bb690feb665991fc2442e335631314 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Takumi Sueda <puhitaku@gmail.com>
|
||||||
|
Date: Sat, 11 Sep 2021 19:20:30 +0900
|
||||||
|
Subject: [PATCH 7/7] Remove QuickTime from link args
|
||||||
|
|
||||||
|
---
|
||||||
|
Mac/Modules/qt/setup.py | 2 +-
|
||||||
|
setup.py | 3 +--
|
||||||
|
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Mac/Modules/qt/setup.py b/Mac/Modules/qt/setup.py
|
||||||
|
index 8442011ab9..4b5bc2bc20 100644
|
||||||
|
--- a/Mac/Modules/qt/setup.py
|
||||||
|
+++ b/Mac/Modules/qt/setup.py
|
||||||
|
@@ -6,7 +6,7 @@ from distutils.core import Extension, setup
|
||||||
|
setup(name="QuickTime", version="0.2",
|
||||||
|
ext_modules=[
|
||||||
|
Extension('QuickTime._Qt', ['_Qtmodule.c'],
|
||||||
|
- extra_link_args=['-framework', 'Carbon', '-framework', 'QuickTime'])
|
||||||
|
+ extra_link_args=['-framework', 'Carbon'])
|
||||||
|
],
|
||||||
|
py_modules=['QuickTime.Qt', 'QuickTime.QuickTime'],
|
||||||
|
package_dir={'QuickTime':'../../../Lib/plat-mac/Carbon'}
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index beaf60f3e5..ff2298af91 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -1819,8 +1819,7 @@ class PyBuildExt(build_ext):
|
||||||
|
|
||||||
|
exts.append( Extension('_Qt', ['qt/_Qtmodule.c'],
|
||||||
|
extra_compile_args=carbon_extra_compile_args,
|
||||||
|
- extra_link_args=['-framework', 'QuickTime',
|
||||||
|
- '-framework', 'Carbon']) )
|
||||||
|
+ extra_link_args=['-framework', 'Carbon']) )
|
||||||
|
|
||||||
|
|
||||||
|
self.extensions.extend(exts)
|
||||||
|
--
|
||||||
|
2.30.1
|
||||||
|
|
||||||
@@ -43,3 +43,13 @@ diff -r -u ../Python-3.1/setup.py ./setup.py
|
|||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1203,8 +1203,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|||||||
@@ -43,3 +43,13 @@ diff -r -u ../Python-3.1/setup.py ./setup.py
|
|||||||
|
|
||||||
# Add paths specified in the environment variables LDFLAGS and
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
# CPPFLAGS for header and library files.
|
# CPPFLAGS for header and library files.
|
||||||
|
@@ -1203,8 +1203,7 @@
|
||||||
|
# End multiprocessing
|
||||||
|
|
||||||
|
# Platform-specific libraries
|
||||||
|
- if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
|
||||||
|
- 'freebsd7', 'freebsd8'):
|
||||||
|
+ if platform.startswith('linux') or platform.startswith('freebsd'):
|
||||||
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
||||||
|
else:
|
||||||
|
missing.append('ossaudiodev')
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user