mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee84e89ef1 | ||
|
|
a39449bc50 | ||
|
|
3bc0d858cc | ||
|
|
0f8b2b2b84 | ||
|
|
c424717a39 | ||
|
|
81632f0ab4 | ||
|
|
a79440470e | ||
|
|
84037dff4e | ||
|
|
a7a0354da9 | ||
|
|
6140619301 | ||
|
|
61c0f25ef5 | ||
|
|
1e8e96b8a2 | ||
|
|
707e8d1ef8 | ||
|
|
04b32e2d46 | ||
|
|
6393a4dfce | ||
|
|
b0d6a67881 | ||
|
|
d64d1aa1e0 | ||
|
|
96b3fb2fc3 | ||
|
|
7f60ef0b54 | ||
|
|
37ad06f7ce | ||
|
|
6711e9a21d | ||
|
|
f3e288c6ad | ||
|
|
770eb66ec8 | ||
|
|
630b3700ad | ||
|
|
fb9880e460 | ||
|
|
050f88c78b | ||
|
|
3ced1c4751 | ||
|
|
03b60aafec | ||
|
|
6a7ecfe409 | ||
|
|
d201daeb33 | ||
|
|
468dc81107 | ||
|
|
5180c3cfb5 | ||
|
|
95917cb753 | ||
|
|
55134ea1a1 | ||
|
|
3f2ef9e00a |
2
.github/workflows/macos_build.yml
vendored
2
.github/workflows/macos_build.yml
vendored
@@ -10,11 +10,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
- "3.13"
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
3
.github/workflows/modified_scripts_build.yml
vendored
3
.github/workflows/modified_scripts_build.yml
vendored
@@ -21,8 +21,7 @@ jobs:
|
||||
echo "$EOF" >> $GITHUB_ENV;
|
||||
- id: modified-versions
|
||||
run: |
|
||||
echo -n "::set-output name=versions::"
|
||||
echo "${{ env.versions }}" | jq -R . | jq -sc .
|
||||
echo "versions=`echo "${{ env.versions }}" | jq -R . | jq -sc .`" >> $GITHUB_OUTPUT
|
||||
macos_build:
|
||||
needs: discover_modified_scripts
|
||||
if: needs.discover_modified_scripts.outputs.versions != '[""]'
|
||||
|
||||
2
.github/workflows/ubuntu_build.yml
vendored
2
.github/workflows/ubuntu_build.yml
vendored
@@ -10,11 +10,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
- "3.12"
|
||||
- "3.13"
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
35
CHANGELOG.md
35
CHANGELOG.md
@@ -1,5 +1,40 @@
|
||||
# Version History
|
||||
|
||||
## Release v2.4.21
|
||||
* Add CPython 3.13.1t by @makukha in https://github.com/pyenv/pyenv/pull/3120
|
||||
* Prefer tcl-tk@8 from Homebrew due to release of Tcl/Tk 9 with which only 3.12+ are compatible by @native-api in https://github.com/pyenv/pyenv/pull/3118
|
||||
|
||||
## Release v2.4.20
|
||||
* README: Fix Markdown in "Notes about python releases" by @noelleleigh in https://github.com/pyenv/pyenv/pull/3112
|
||||
* README: correct link to shell setup instructions by @shortcuts in https://github.com/pyenv/pyenv/pull/3113
|
||||
* Add CPython 3.9.21, 3.10.16, 3.11.11, 3.12.8 and 3.13.1 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3117
|
||||
|
||||
## Release v2.4.19
|
||||
* Add CPython 3.14.0a2 by @nedbat in https://github.com/pyenv/pyenv/pull/3110
|
||||
* Add quick start section and gif demo to accompany it. by @madhu-GG in https://github.com/pyenv/pyenv/pull/3044
|
||||
|
||||
## Release v2.4.18
|
||||
* Add miniforge3-24.9.2-0 by @goerz in https://github.com/pyenv/pyenv/pull/3106
|
||||
|
||||
## Release v2.4.17
|
||||
* Add miniconda3-24.9.2-0 by @binbjz in https://github.com/pyenv/pyenv/pull/3096
|
||||
* Add Anaconda3-2024.10-1 by @binbjz in https://github.com/pyenv/pyenv/pull/3097
|
||||
|
||||
## Release v2.4.16
|
||||
* Add GraalPy 24.1.1 by @msimacek in https://github.com/pyenv/pyenv/pull/3092
|
||||
* Add CPython 3.14.0a1 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3093
|
||||
|
||||
## Release v2.4.15
|
||||
* CI: replace set-output with GITHUB_OUTPUT by @tuzi3040 in https://github.com/pyenv/pyenv/pull/3079
|
||||
* Make uninstall yes/no prompt consistent with others by @dpoznik in https://github.com/pyenv/pyenv/pull/3080
|
||||
* Add CPython 3.13.0 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3081
|
||||
* Avoid shadowing of virtualenvs with the name starting with "python-" by @aarbouin in https://github.com/pyenv/pyenv/pull/3086
|
||||
* Support free-threaded CPython flavor in prefix resolution by @native-api in https://github.com/pyenv/pyenv/pull/3090
|
||||
|
||||
## Release v2.4.14
|
||||
* Add CPython 3.12.7 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3078
|
||||
* Add CPython 3.13.0rc3 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3077
|
||||
|
||||
## Release v2.4.13
|
||||
* docs: Use `--verbose` with performance CPython build instructions by @caerulescens in https://github.com/pyenv/pyenv/pull/3053
|
||||
* Fix latest version resolution when using `python-` prefix by @edmorley in https://github.com/pyenv/pyenv/pull/3056
|
||||
|
||||
@@ -4,12 +4,14 @@ Creating a release
|
||||
The release of the new version of Pyenv is done via GitHub Releases.
|
||||
|
||||
Release checklist:
|
||||
* Start [drafting a new release on GitHub](https://github.com/pyenv/pyenv/releases) to generate a summary of changes. Save the summary locally.
|
||||
* Start [drafting a new release on GitHub](https://github.com/pyenv/pyenv/releases) to generate a summary of changes.
|
||||
Type the would-be tag name in the "Choose a tag" field and press "Generate release notes"
|
||||
* The summary may need editing. E.g. rephrase entries, delete/merge entries that are too minor or irrelevant to the users (e.g. typo fixes, CI)
|
||||
* Update `CHANGELOG.md` with the new version number and the edited summary (only the changes section)
|
||||
* Push the version number in `libexec/pyenv---version`
|
||||
* Minor version is pushed if there are significant functional changes (not e.g. bugfixes/formula adaptations/supporting niche use cases).
|
||||
* Major version is pushed if there are breaking changes
|
||||
* Update `CHANGELOG.md` with the new version number and the edited summary (only the changes section), reformatting it like the rest of the changelog sections
|
||||
* Commit the changes locally into `master`
|
||||
* Create a new tag with the new version number and push the changes including the tag
|
||||
* Create a new release on GitHub based on the tag, using the saved summary
|
||||
* Create a new tag locally with the same name as specified in the new release window
|
||||
* Push the changes including the tag
|
||||
* In the still open new release window, press "Publish release". The now-existing tag will be used.
|
||||
852
README.md
852
README.md
@@ -9,9 +9,6 @@ tools that do one thing well.
|
||||
This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
[ruby-build](https://github.com/rbenv/ruby-build), and modified for Python.
|
||||
|
||||

|
||||
|
||||
|
||||
### What pyenv _does..._
|
||||
|
||||
* Lets you **change the global Python version** on a per-user basis.
|
||||
@@ -32,30 +29,27 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
yourself, or [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
|
||||
to automate the process.
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* **[How It Works](#how-it-works)**
|
||||
* [Understanding PATH](#understanding-path)
|
||||
* [Understanding Shims](#understanding-shims)
|
||||
* [Understanding Python version selection](#understanding-python-version-selection)
|
||||
* [Locating Pyenv-provided Python Installations](#locating-pyenv-provided-python-installations)
|
||||
* **[Installation](#installation)**
|
||||
* [Getting Pyenv](#getting-pyenv)
|
||||
* [UNIX/MacOS](#unixmacos)
|
||||
* [Getting Pyenv](#a-getting-pyenv)
|
||||
* [Linux/UNIX](#linuxunix)
|
||||
* [Automatic Installer](#1-automatic-installer-recommended)
|
||||
* [Basic GitHub Checkout](#2-basic-github-checkout)
|
||||
* [MacOS](#macos)
|
||||
* [Homebrew in macOS](#homebrew-in-macos)
|
||||
* [Automatic installer](#automatic-installer)
|
||||
* [Basic GitHub Checkout](#basic-github-checkout)
|
||||
* [Windows](#windows)
|
||||
* [Set up your shell environment for Pyenv](#set-up-your-shell-environment-for-pyenv)
|
||||
* [Restart your shell](#restart-your-shell)
|
||||
* [Install Python build dependencies](#install-python-build-dependencies)
|
||||
* [Set up your shell environment for Pyenv](#b-set-up-your-shell-environment-for-pyenv)
|
||||
* [Restart your shell](#c-restart-your-shell)
|
||||
* [Install Python build dependencies](#d-install-python-build-dependencies)
|
||||
* [Upgrade Notes](#e-upgrade-notes)
|
||||
* **[Usage](#usage)**
|
||||
* [Install additional Python versions](#install-additional-python-versions)
|
||||
* [Prefix auto-resolution to the latest version](#prefix-auto-resolution-to-the-latest-version)
|
||||
* [Python versions with extended support](#python-versions-with-extended-support)
|
||||
* [Switch between Python versions](#switch-between-python-versions)
|
||||
* [Uninstall Python versions](#uninstall-python-versions)
|
||||
* [Other operations](#other-operations)
|
||||
@@ -64,6 +58,11 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
* [Upgrading with Installer or Git checkout](#upgrading-with-installer-or-git-checkout)
|
||||
* [Uninstalling pyenv](#uninstalling-pyenv)
|
||||
* [Pyenv plugins](#pyenv-plugins)
|
||||
* **[How It Works](#how-it-works)**
|
||||
* [Understanding PATH](#understanding-path)
|
||||
* [Understanding Shims](#understanding-shims)
|
||||
* [Understanding Python version selection](#understanding-python-version-selection)
|
||||
* [Locating Pyenv-provided Python Installations](#locating-pyenv-provided-python-installations)
|
||||
* [Advanced Configuration](#advanced-configuration)
|
||||
* [Using Pyenv without shims](#using-pyenv-without-shims)
|
||||
* [Environment variables](#environment-variables)
|
||||
@@ -75,6 +74,438 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
|
||||
----
|
||||
|
||||
## Installation
|
||||
|
||||
### A. Getting Pyenv
|
||||
----
|
||||
#### Linux/Unix
|
||||
<details>
|
||||
|
||||
The Homebrew option from the [MacOS section below](#macos) would also work if you have Homebrew installed.
|
||||
|
||||
##### 1. Automatic installer (Recommended)
|
||||
|
||||
```bash
|
||||
curl https://pyenv.run | bash
|
||||
```
|
||||
|
||||
For more details visit our other project:
|
||||
https://github.com/pyenv/pyenv-installer
|
||||
|
||||
|
||||
##### 2. Basic GitHub Checkout
|
||||
|
||||
This will get you going with the latest version of Pyenv and make it
|
||||
easy to fork and contribute any changes back upstream.
|
||||
|
||||
* **Check out Pyenv where you want it installed.**
|
||||
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else):
|
||||
```
|
||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||
```
|
||||
* Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
||||
worry if it fails; Pyenv will still work normally:
|
||||
```
|
||||
cd ~/.pyenv && src/configure && make -C src
|
||||
```
|
||||
</details>
|
||||
|
||||
#### MacOS
|
||||
|
||||
<details>
|
||||
|
||||
The options from the [Linux section above](#linuxunix) also work but Homebrew is recommended for basic usage.
|
||||
|
||||
##### [Homebrew](https://brew.sh) in macOS
|
||||
|
||||
1. Update homebrew and install pyenv:
|
||||
```sh
|
||||
brew update
|
||||
brew install pyenv
|
||||
```
|
||||
If you want to install (and update to) the latest development head of Pyenv
|
||||
rather than the latest release, instead run:
|
||||
```sh
|
||||
brew install pyenv --head
|
||||
```
|
||||
3. Then follow the rest of the post-installation steps, starting with
|
||||
[Set up your shell environment for Pyenv](#b-set-up-your-shell-environment-for-pyenv).
|
||||
|
||||
4. OPTIONAL. To fix `brew doctor`'s warning _""config" scripts exist outside your system or Homebrew directories"_
|
||||
|
||||
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"
|
||||
~~~
|
||||
</details>
|
||||
|
||||
#### Windows
|
||||
|
||||
<details>
|
||||
|
||||
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.
|
||||
|
||||
</details>
|
||||
|
||||
### B. Set up your shell environment for Pyenv
|
||||
----
|
||||
|
||||
The below setup should work for the vast majority of users for common use cases.
|
||||
See [Advanced configuration](#advanced-configuration) for details and more configuration options.
|
||||
|
||||
#### Bash
|
||||
<details>
|
||||
|
||||
Stock Bash startup files vary widely between distributions 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).
|
||||
|
||||
1. First, add the commands to `~/.bashrc` by running the following in your terminal:
|
||||
|
||||
```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
|
||||
```
|
||||
3. Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
||||
If you have none of these, create a `~/.profile` and add the commands there.
|
||||
|
||||
* to add to `~/.profile`:
|
||||
``` bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.profile
|
||||
```
|
||||
* to add to `~/.bash_profile`:
|
||||
```bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
|
||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
|
||||
```
|
||||
|
||||
**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
|
||||
`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.
|
||||
See [#264](https://github.com/pyenv/pyenv/issues/264) for details.
|
||||
|
||||
</details>
|
||||
|
||||
#### Zsh
|
||||
|
||||
<details>
|
||||
|
||||
```zsh
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
```
|
||||
|
||||
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
|
||||
</details>
|
||||
|
||||
#### Fish
|
||||
|
||||
<details>
|
||||
|
||||
1. If you have Fish 3.2.0 or newer, execute this interactively:
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
fish_add_path $PYENV_ROOT/bin
|
||||
~~~
|
||||
|
||||
2. Otherwise, execute the snippet below:
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||
~~~
|
||||
|
||||
3. Now, add this to `~/.config/fish/config.fish`:
|
||||
~~~ fish
|
||||
pyenv init - | source
|
||||
~~~
|
||||
</details>
|
||||
|
||||
### C. Restart your shell
|
||||
----
|
||||
|
||||
for the `PATH` changes to take effect.
|
||||
|
||||
```sh
|
||||
exec "$SHELL"
|
||||
```
|
||||
|
||||
### D. Install Python build dependencies
|
||||
----
|
||||
|
||||
[**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
|
||||
before attempting to install a new Python version.
|
||||
|
||||
You can now begin using Pyenv.
|
||||
|
||||
### E. Upgrade Notes
|
||||
----
|
||||
|
||||
**if you have upgraded from pyenv version 2.0.x-2.2.x**
|
||||
|
||||
<details>
|
||||
|
||||
The startup logic and instructions have been updated for simplicity in 2.3.0.
|
||||
The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works.
|
||||
|
||||
* Define environment variable `PYENV_ROOT` to point to the path where
|
||||
Pyenv will store its data. `$HOME/.pyenv` is the default.
|
||||
If you installed Pyenv via Git checkout, we recommend
|
||||
to set it to the same location as where you cloned it.
|
||||
* 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
|
||||
|
||||
</details>
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||

|
||||
|
||||
### Install additional Python versions
|
||||
|
||||
To install additional 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
|
||||
```
|
||||
|
||||
Running `pyenv install -l` gives the list of all available versions.
|
||||
|
||||
----
|
||||
|
||||
<details> <summary> Notes about python releases </summary>
|
||||
|
||||
**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 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).
|
||||
|
||||
**NOTE:** If you want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
||||
environment variables.
|
||||
|
||||
**NOTE:** If you'd like a faster interpreter at the cost of longer build times,
|
||||
see [_Building for maximum performance_ in Python-Build's README](plugins/python-build/README.md#building-for-maximum-performance).
|
||||
|
||||
</details>
|
||||
|
||||
----
|
||||
|
||||
#### Prefix auto-resolution to the latest version
|
||||
|
||||
All Pyenv subcommands except `uninstall` automatically resolve full prefixes to the latest version in the corresponding version line.
|
||||
|
||||
`pyenv install` picks the latest known version, while other subcommands pick the latest installed version.
|
||||
|
||||
E.g. to install and then switch to the latest 3.10 release:
|
||||
|
||||
```sh
|
||||
pyenv install 3.10
|
||||
pyenv global 3.10
|
||||
```
|
||||
|
||||
You can run [`pyenv latest -k <prefix>`](COMMANDS.md#pyenv-latest) to see how `pyenv install` would resolve a specific prefix, or [`pyenv latest <prefix>`](COMMANDS.md#pyenv-latest) to see how other subcommands would resolve it.
|
||||
|
||||
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details.
|
||||
|
||||
|
||||
<details> <summary> Python versions with extended support </summary>
|
||||
|
||||
For the following Python releases, Pyenv applies user-provided patches that add support for some newer environments.
|
||||
Though we don't actively maintain those patches, since existing releases never change,
|
||||
it's safe to assume that they will continue working until there are further incompatible changes
|
||||
in a later version of those environments.
|
||||
|
||||
* *3.7.8-3.7.15, 3.8.4-3.8.12, 3.9.0-3.9.7* : XCode 13.3
|
||||
* *3.5.10, 3.6.15* : MacOS 11+ and XCode 13.3
|
||||
* *2.7.18* : MacOS 10.15+ and Apple Silicon
|
||||
</details>
|
||||
|
||||
----
|
||||
|
||||
### 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 <versions>`](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
|
||||
|
||||
### Upgrading with Homebrew
|
||||
|
||||
If you've installed Pyenv using Homebrew, upgrade using:
|
||||
```sh
|
||||
brew upgrade pyenv
|
||||
```
|
||||
|
||||
To switch from a release to the latest development head of Pyenv, use:
|
||||
|
||||
```sh
|
||||
brew uninstall pyenv
|
||||
brew install pyenv --head
|
||||
```
|
||||
|
||||
then you can upgrade it with `brew upgrade pyenv` as usual.
|
||||
|
||||
|
||||
### Upgrading with Installer or Git checkout
|
||||
|
||||
If you've installed Pyenv with Pyenv-installer, you likely have the
|
||||
[Pyenv-Update](https://github.com/pyenv/pyenv-update) plugin that would
|
||||
upgrade Pyenv and all installed plugins:
|
||||
|
||||
```sh
|
||||
pyenv update
|
||||
```
|
||||
|
||||
If you've installed Pyenv using Pyenv-installer or Git checkout, you can also
|
||||
upgrade your installation at any time using Git.
|
||||
|
||||
To upgrade to the latest development version of pyenv, use `git pull`:
|
||||
|
||||
```sh
|
||||
cd $(pyenv root)
|
||||
git pull
|
||||
```
|
||||
|
||||
To upgrade to a specific release of Pyenv, check out the corresponding tag:
|
||||
|
||||
```sh
|
||||
cd $(pyenv root)
|
||||
git fetch
|
||||
git tag
|
||||
git checkout v0.1.0
|
||||
```
|
||||
|
||||
## Uninstalling pyenv
|
||||
|
||||
The simplicity of pyenv makes it easy to temporarily disable it, or
|
||||
uninstall from the system.
|
||||
|
||||
1. To **disable** Pyenv managing your Python versions, simply remove the
|
||||
`pyenv init` invocations from your shell startup configuration. This will
|
||||
remove Pyenv shims directory from `PATH`, and future invocations like
|
||||
`python` will execute the system Python version, as it was before Pyenv.
|
||||
|
||||
`pyenv` will still be accessible on the command line, but your Python
|
||||
apps won't be affected by version switching.
|
||||
|
||||
2. To completely **uninstall** Pyenv, remove _all_ Pyenv configuration lines
|
||||
from your shell startup configuration, and then remove
|
||||
its root directory. This will **delete all Python versions** that were
|
||||
installed under the `` $(pyenv root)/versions/ `` directory:
|
||||
|
||||
```sh
|
||||
rm -rf $(pyenv root)
|
||||
```
|
||||
|
||||
If you've installed Pyenv using a package manager, as a final step,
|
||||
perform the Pyenv package removal. For instance, for Homebrew:
|
||||
|
||||
```
|
||||
brew uninstall pyenv
|
||||
```
|
||||
|
||||
|
||||
## Pyenv plugins
|
||||
|
||||
Pyenv provides a simple way to extend and customize its functionality with plugins --
|
||||
as simple as creating a plugin directory and dropping a shell script on a certain subpath of it
|
||||
with whatever extra logic you need to be run at certain moments.
|
||||
|
||||
The main idea is that most things that you can put under `$PYENV_ROOT/<whatever>` you can also put
|
||||
under `$PYENV_ROOT/plugins/your_plugin_name/<whatever>`.
|
||||
|
||||
See [_Plugins_ on the wiki](https://github.com/pyenv/pyenv/wiki/Plugins) on how to install and use plugins
|
||||
as well as a catalog of some useful existing plugins for common needs.
|
||||
|
||||
See [_Authoring plugins_ on the wiki](https://github.com/pyenv/pyenv/wiki/Authoring-plugins) on writing your own plugins.
|
||||
|
||||
----
|
||||
|
||||
## How It Works
|
||||
|
||||
@@ -198,395 +629,6 @@ As far as Pyenv is concerned, version names are simply directories under
|
||||
----
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### Getting Pyenv
|
||||
#### UNIX/MacOS
|
||||
##### Homebrew in macOS
|
||||
|
||||
1. Consider installing with [Homebrew](https://brew.sh):
|
||||
```sh
|
||||
brew update
|
||||
brew install pyenv
|
||||
```
|
||||
If you want to install (and update to) the latest development head of Pyenv
|
||||
rather than the latest release, instead run:
|
||||
```sh
|
||||
brew install pyenv --head
|
||||
```
|
||||
3. 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).
|
||||
|
||||
4. OPTIONAL. To fix `brew doctor`'s warning _""config" scripts exist outside your system or Homebrew directories"_
|
||||
|
||||
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"
|
||||
~~~
|
||||
|
||||
|
||||
##### Automatic installer
|
||||
|
||||
```bash
|
||||
curl https://pyenv.run | bash
|
||||
```
|
||||
|
||||
For more details visit our other project:
|
||||
https://github.com/pyenv/pyenv-installer
|
||||
|
||||
|
||||
##### Basic GitHub Checkout
|
||||
|
||||
This will get you going with the latest version of Pyenv and make it
|
||||
easy to fork and contribute any changes back upstream.
|
||||
|
||||
* **Check out Pyenv where you want it installed.**
|
||||
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else):
|
||||
```
|
||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||
```
|
||||
* Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
||||
worry if it fails; Pyenv will still work normally:
|
||||
```
|
||||
cd ~/.pyenv && src/configure && make -C src
|
||||
```
|
||||
|
||||
#### 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.
|
||||
|
||||
|
||||
### Set up your shell environment for Pyenv
|
||||
|
||||
**Upgrade note:** The startup logic and instructions have been updated for simplicity in 2.3.0.
|
||||
The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works.
|
||||
|
||||
* Define environment variable `PYENV_ROOT` to point to the path where
|
||||
Pyenv will store its data. `$HOME/.pyenv` is the default.
|
||||
If you installed Pyenv via Git checkout, we recommend
|
||||
to set it to the same location as where you cloned it.
|
||||
* 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
|
||||
|
||||
The below setup should work for the vast majority of users for common use cases.
|
||||
See [Advanced configuration](#advanced-configuration) for details and more configuration options.
|
||||
|
||||
- For **bash**:
|
||||
|
||||
Stock Bash startup files vary widely between distributions 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` by running the following in your terminal:
|
||||
|
||||
~~~ 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
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.profile
|
||||
~~~
|
||||
|
||||
* to add to `~/.bash_profile`:
|
||||
~~~ bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
|
||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
|
||||
~~~
|
||||
|
||||
- For **Zsh**:
|
||||
~~~ zsh
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
~~~
|
||||
|
||||
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
|
||||
|
||||
- For **Fish shell**:
|
||||
|
||||
If you have Fish 3.2.0 or newer, execute this interactively:
|
||||
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
fish_add_path $PYENV_ROOT/bin
|
||||
~~~
|
||||
|
||||
Otherwise, execute the snippet below:
|
||||
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||
~~~
|
||||
|
||||
Now, add this to `~/.config/fish/config.fish`:
|
||||
|
||||
~~~ fish
|
||||
pyenv init - | source
|
||||
~~~
|
||||
|
||||
**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
|
||||
`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.
|
||||
See [#264](https://github.com/pyenv/pyenv/issues/264) for details.
|
||||
|
||||
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
|
||||
|
||||
### Restart your shell
|
||||
|
||||
for the `PATH` changes to take effect.
|
||||
|
||||
```sh
|
||||
exec "$SHELL"
|
||||
```
|
||||
|
||||
### Install Python build dependencies
|
||||
|
||||
[**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
|
||||
before attempting to install a new Python version.
|
||||
|
||||
You can now begin using Pyenv.
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### Install additional Python versions
|
||||
|
||||
To install additional 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
|
||||
```
|
||||
|
||||
Running `pyenv install -l` gives the list of all available versions.
|
||||
|
||||
**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 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).
|
||||
|
||||
**NOTE:** If you want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
||||
environment variables.
|
||||
|
||||
**NOTE:** If you'd like a faster interpreter at the cost of longer build times,
|
||||
see [_Building for maximum performance_ in Python-Build's README](plugins/python-build/README.md#building-for-maximum-performance).
|
||||
|
||||
|
||||
#### Prefix auto-resolution to the latest version
|
||||
|
||||
All Pyenv subcommands except `uninstall` automatically resolve full prefixes to the latest version in the corresponding version line.
|
||||
|
||||
`pyenv install` picks the latest known version, while other subcommands pick the latest installed version.
|
||||
|
||||
E.g. to install and then switch to the latest 3.10 release:
|
||||
|
||||
```sh
|
||||
pyenv install 3.10
|
||||
pyenv global 3.10
|
||||
```
|
||||
|
||||
You can run [`pyenv latest -k <prefix>`](COMMANDS.md#pyenv-latest) to see how `pyenv install` would resolve a specific prefix, or [`pyenv latest <prefix>`](COMMANDS.md#pyenv-latest) to see how other subcommands would resolve it.
|
||||
|
||||
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details.
|
||||
|
||||
|
||||
#### Python versions with extended support
|
||||
|
||||
For the following Python releases, Pyenv applies user-provided patches that add support for some newer environments.
|
||||
Though we don't actively maintain those patches, since existing releases never change,
|
||||
it's safe to assume that they will continue working until there are further incompatible changes
|
||||
in a later version of those environments.
|
||||
|
||||
* *3.7.8-3.7.15, 3.8.4-3.8.12, 3.9.0-3.9.7* : XCode 13.3
|
||||
* *3.5.10, 3.6.15* : MacOS 11+ and XCode 13.3
|
||||
* *2.7.18* : MacOS 10.15+ and Apple Silicon
|
||||
|
||||
|
||||
### 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 <versions>`](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
|
||||
|
||||
### Upgrading with Homebrew
|
||||
|
||||
If you've installed Pyenv using Homebrew, upgrade using:
|
||||
```sh
|
||||
brew upgrade pyenv
|
||||
```
|
||||
|
||||
To switch from a release to the latest development head of Pyenv, use:
|
||||
|
||||
```sh
|
||||
brew uninstall pyenv
|
||||
brew install pyenv --head
|
||||
```
|
||||
|
||||
then you can upgrade it with `brew upgrade pyenv` as usual.
|
||||
|
||||
|
||||
### Upgrading with Installer or Git checkout
|
||||
|
||||
If you've installed Pyenv with Pyenv-installer, you likely have the
|
||||
[Pyenv-Update](https://github.com/pyenv/pyenv-update) plugin that would
|
||||
upgrade Pyenv and all installed plugins:
|
||||
|
||||
```sh
|
||||
pyenv update
|
||||
```
|
||||
|
||||
If you've installed Pyenv using Pyenv-installer or Git checkout, you can also
|
||||
upgrade your installation at any time using Git.
|
||||
|
||||
To upgrade to the latest development version of pyenv, use `git pull`:
|
||||
|
||||
```sh
|
||||
cd $(pyenv root)
|
||||
git pull
|
||||
```
|
||||
|
||||
To upgrade to a specific release of Pyenv, check out the corresponding tag:
|
||||
|
||||
```sh
|
||||
cd $(pyenv root)
|
||||
git fetch
|
||||
git tag
|
||||
git checkout v0.1.0
|
||||
```
|
||||
|
||||
## Uninstalling pyenv
|
||||
|
||||
The simplicity of pyenv makes it easy to temporarily disable it, or
|
||||
uninstall from the system.
|
||||
|
||||
1. To **disable** Pyenv managing your Python versions, simply remove the
|
||||
`pyenv init` invocations from your shell startup configuration. This will
|
||||
remove Pyenv shims directory from `PATH`, and future invocations like
|
||||
`python` will execute the system Python version, as it was before Pyenv.
|
||||
|
||||
`pyenv` will still be accessible on the command line, but your Python
|
||||
apps won't be affected by version switching.
|
||||
|
||||
2. To completely **uninstall** Pyenv, remove _all_ Pyenv configuration lines
|
||||
from your shell startup configuration, and then remove
|
||||
its root directory. This will **delete all Python versions** that were
|
||||
installed under the `` $(pyenv root)/versions/ `` directory:
|
||||
|
||||
```sh
|
||||
rm -rf $(pyenv root)
|
||||
```
|
||||
|
||||
If you've installed Pyenv using a package manager, as a final step,
|
||||
perform the Pyenv package removal. For instance, for Homebrew:
|
||||
|
||||
```
|
||||
brew uninstall pyenv
|
||||
```
|
||||
|
||||
|
||||
## Pyenv plugins
|
||||
|
||||
Pyenv provides a simple way to extend and customize its functionality with plugins --
|
||||
as simple as creating a plugin directory and dropping a shell script on a certain subpath of it
|
||||
with whatever extra logic you need to be run at certain moments.
|
||||
|
||||
The main idea is that most things that you can put under `$PYENV_ROOT/<whatever>` you can also put
|
||||
under `$PYENV_ROOT/plugins/your_plugin_name/<whatever>`.
|
||||
|
||||
See [_Plugins_ on the wiki](https://github.com/pyenv/pyenv/wiki/Plugins) on how to install and use plugins
|
||||
as well as a catalog of some useful existing plugins for common needs.
|
||||
|
||||
See [_Authoring plugins_ on the wiki](https://github.com/pyenv/pyenv/wiki/Authoring-plugins) on writing your own plugins.
|
||||
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
Skip this section unless you must know what every line in your shell
|
||||
|
||||
BIN
install_local_python.gif
Normal file
BIN
install_local_python.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 531 KiB |
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="2.4.13"
|
||||
version="2.4.21"
|
||||
git_revision=""
|
||||
|
||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||
|
||||
@@ -48,16 +48,25 @@ IFS=$'\n'
|
||||
exit $exitcode;
|
||||
fi
|
||||
|
||||
suffix=""
|
||||
if [[ $prefix =~ ^(.*[0-9])t$ ]]; then
|
||||
suffix="t"
|
||||
prefix="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
# https://stackoverflow.com/questions/11856054/is-there-an-easy-way-to-pass-a-raw-string-to-grep/63483807#63483807
|
||||
prefix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$prefix")"
|
||||
suffix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$suffix")"
|
||||
# FIXME: more reliable and readable would probably be to loop over them and transform in pure Bash
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
||||
grep -Ee "^$prefix_re[-.]" || true))
|
||||
grep -Ee "^$prefix_re[-.].*$suffix_re\$" || true))
|
||||
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
||||
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d' -e '/[0-9]+t$/d'));
|
||||
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d' \
|
||||
$(if [[ -z $suffix ]]; then echo "-e /[0-9]t\$/d"; fi)
|
||||
));
|
||||
|
||||
# Compose a sorting key, followed by | and original value
|
||||
DEFINITION_CANDIDATES=(\
|
||||
|
||||
@@ -32,8 +32,12 @@ OLDIFS="$IFS"
|
||||
for version in ${PYENV_VERSION}; do
|
||||
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
||||
normalised_version="${version#python-}"
|
||||
if version_exists "${normalised_version}" || [ "$version" = "system" ]; then
|
||||
if version_exists "${version}" || [ "$version" = "system" ]; then
|
||||
versions=("${versions[@]}" "${version}")
|
||||
elif version_exists "${normalised_version}"; then
|
||||
versions=("${versions[@]}" "${normalised_version}")
|
||||
elif resolved_version="$(pyenv-latest -b "${version}")"; then
|
||||
versions=("${versions[@]}" "${resolved_version}")
|
||||
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
||||
versions=("${versions[@]}" "${resolved_version}")
|
||||
else
|
||||
|
||||
@@ -75,7 +75,7 @@ uninstall-python() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -p "pyenv: remove $PREFIX? [y|N] "
|
||||
read -p "pyenv: remove $PREFIX? (y/N) "
|
||||
case "$REPLY" in
|
||||
y | Y | yes | YES ) ;;
|
||||
* ) exit 1 ;;
|
||||
|
||||
@@ -814,7 +814,7 @@ build_package_standard_build() {
|
||||
|
||||
if [ "$package_var_name" = "PYTHON" ]; then
|
||||
use_homebrew || true
|
||||
use_tcltk || true
|
||||
use_custom_tcltk || use_homebrew_tcltk || true
|
||||
use_homebrew_readline || use_freebsd_pkg || true
|
||||
use_homebrew_ncurses || true
|
||||
if is_mac -ge 1014; then
|
||||
@@ -1671,31 +1671,43 @@ use_xcode_sdk_zlib() {
|
||||
|
||||
use_homebrew_tcltk() {
|
||||
can_use_homebrew || return 1
|
||||
# get the version from the folder that homebrew versions
|
||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||
if [ -d "$tcltk_libdir" ]; then
|
||||
echo "python-build: use tcl-tk from homebrew"
|
||||
if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
|
||||
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
|
||||
package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
||||
# In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir.
|
||||
# We're not using tclConfig.sh here 'cuz it produces the version-specific path to <brew prefix>/Cellar
|
||||
# and we'd rather have rpath set to <brew prefix>/opt/<...> to allow micro release upgrades without rebuilding
|
||||
# XXX: do use tclConfig.sh and translate the paths if more path shenanigans appear in later releases
|
||||
if [ -d "$tcltk_libdir/include/tcl-tk" ]; then
|
||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include/tcl-tk"
|
||||
else
|
||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
||||
# Since https://github.com/Homebrew/homebrew-core/commit/f10e88617b41555193c22fdcba6109fe82155ee2 (10.11.2024),
|
||||
# tcl-tk is 9.0 which is not compatible with CPython as of this writing
|
||||
# but we'll keep it as backup for cases like non-updated Homebrew
|
||||
local tcltk
|
||||
for tcltk in "tcl-tk@8" "tcl-tk"; do
|
||||
local tcltk_libdir="$(brew --prefix "${tcltk}" 2>/dev/null || true)"
|
||||
if [ -d "$tcltk_libdir" ]; then
|
||||
echo "python-build: use tcl-tk from homebrew"
|
||||
if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
|
||||
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
|
||||
package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
||||
# In Homebrew Tcl/Tk 8.6.13, headers have been moved to the 'tcl-tk' subdir.
|
||||
# We're not using tclConfig.sh here 'cuz it produces the version-specific path to <brew prefix>/Cellar
|
||||
# and we'd rather have rpath set to <brew prefix>/opt/<...> to allow micro release upgrades without rebuilding
|
||||
# XXX: do use tclConfig.sh and translate the paths if more path shenanigans appear in later releases
|
||||
if [ -d "$tcltk_libdir/include/tcl-tk" ]; then
|
||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include/tcl-tk"
|
||||
else
|
||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
||||
fi
|
||||
fi
|
||||
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
return 0
|
||||
fi
|
||||
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# FIXME: this function is a workaround for #1125
|
||||
# once fixed, it should be removed.
|
||||
# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk
|
||||
use_custom_tcltk() {
|
||||
local tcltk_ops="$1"
|
||||
local tcltk_ops="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")"
|
||||
|
||||
if [[ -z "$tcltk_ops" ]]; then
|
||||
return 1
|
||||
fi
|
||||
local tcltk_ops_flag="--with-tcltk-libs="
|
||||
# get tcltk libs
|
||||
local tcltk_libs="${tcltk_ops//$tcltk_ops_flag/}"
|
||||
@@ -1738,21 +1750,6 @@ get_tcltk_flag_from() {
|
||||
IFS="$OLDIFS"
|
||||
}
|
||||
|
||||
use_tcltk() {
|
||||
if can_use_homebrew; then
|
||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||
fi
|
||||
local tcl_tk_libs="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")"
|
||||
|
||||
# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk
|
||||
# otherwise default to homebrew-installed tcl-tk, if installed
|
||||
if [[ -n "$tcl_tk_libs" ]]; then
|
||||
use_custom_tcltk "$tcl_tk_libs"
|
||||
elif [ -d "$tcltk_libdir" ]; then
|
||||
use_homebrew_tcltk
|
||||
fi
|
||||
}
|
||||
|
||||
# Since 3.12, CPython can add DWARF debug information in MacOS
|
||||
# using Apple's nonstandard way, `dsymutil', that creates a "dSYM bundle"
|
||||
# that's supposed to be installed alongside executables
|
||||
|
||||
9
plugins/python-build/share/python-build/3.10.16
Normal file
9
plugins/python-build/share/python-build/3.10.16
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1o" "https://www.openssl.org/source/openssl-1.1.1o.tar.gz#9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f" 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.10.16" "https://www.python.org/ftp/python/3.10.16/Python-3.10.16.tar.xz#bfb249609990220491a1b92850a07135ed0831e41738cf681d63cf01b2a8fbd1" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.16" "https://www.python.org/ftp/python/3.10.16/Python-3.10.16.tgz#f2e22ed965a93cfeb642378ed6e6cdbc127682664b24123679f3d013fafe9cd0" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.11.11
Normal file
10
plugins/python-build/share/python-build/3.11.11
Normal file
@@ -0,0 +1,10 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||
install_package "openssl-3.2.2" "https://openssl.org/source/old/3.2/openssl-3.2.2.tar.gz#197149c18d9e9f292c43f0400acaba12e5f52cacfe050f3d199277ea738ec2e7" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.11.11" "https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tar.xz#2a9920c7a0cd236de33644ed980a13cbbc21058bfdc528febb6081575ed73be3" standard verify_py311 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.11.11" "https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tgz#883bddee3c92fcb91cf9c09c5343196953cbb9ced826213545849693970868ed" standard verify_py311 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -3,7 +3,7 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.3.2" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz#2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.13.0rc2" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0rc2.tar.xz#d60e8b7c10de4f71d2dffaf7c7be8efa54dc1e532fe931dbb84e5f625709e237" standard verify_py313 copy_python_gdb ensurepip
|
||||
install_package "Python-3.12.7" "https://www.python.org/ftp/python/3.12.7/Python-3.12.7.tar.xz#24887b92e2afd4a2ac602419ad4b596372f67ac9b077190f459aba390faf5550" standard verify_py312 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.13.0rc2" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0rc2.tgz#d08965c543f21d9949b2715b50d7e4619a5c13984a2ba6d2efcabf413d41479a" standard verify_py313 copy_python_gdb ensurepip
|
||||
install_package "Python-3.12.7" "https://www.python.org/ftp/python/3.12.7/Python-3.12.7.tgz#73ac8fe780227bf371add8373c3079f42a0dc62deff8d612cd15a618082ab623" standard verify_py312 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.12.8
Normal file
9
plugins/python-build/share/python-build/3.12.8
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.3.2" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz#2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.12.8" "https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tar.xz#c909157bb25ec114e5869124cc2a9c4a4d4c1e957ca4ff553f1edc692101154e" standard verify_py312 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.12.8" "https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tgz#5978435c479a376648cb02854df3b892ace9ed7d32b1fead652712bee9d03a45" standard verify_py312 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.13.0
Normal file
9
plugins/python-build/share/python-build/3.13.0
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.3.2" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz#2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.13.0" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0.tar.xz#086de5882e3cb310d4dca48457522e2e48018ecd43da9cdf827f6a0759efb07d" standard verify_py313 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.13.0" "https://www.python.org/ftp/python/3.13.0/Python-3.13.0.tgz#12445c7b3db3126c41190bfdc1c8239c39c719404e844babbd015a1bc3fafcd4" standard verify_py313 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,2 +0,0 @@
|
||||
export PYTHON_BUILD_FREE_THREADING=1
|
||||
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.0rc2
|
||||
2
plugins/python-build/share/python-build/3.13.0t
Normal file
2
plugins/python-build/share/python-build/3.13.0t
Normal file
@@ -0,0 +1,2 @@
|
||||
export PYTHON_BUILD_FREE_THREADING=1
|
||||
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.0
|
||||
9
plugins/python-build/share/python-build/3.13.1
Normal file
9
plugins/python-build/share/python-build/3.13.1
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.4.0" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.4.0.tar.gz#e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.13.1" "https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz#9cf9427bee9e2242e3877dd0f6b641c1853ca461f39d6503ce260a59c80bf0d9" standard verify_py313 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.13.1" "https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz#1513925a9f255ef0793dbf2f78bb4533c9f184bdd0ad19763fd7f47a400a7c55" standard verify_py313 copy_python_gdb ensurepip
|
||||
fi
|
||||
2
plugins/python-build/share/python-build/3.13.1t
Normal file
2
plugins/python-build/share/python-build/3.13.1t
Normal file
@@ -0,0 +1,2 @@
|
||||
export PYTHON_BUILD_FREE_THREADING=1
|
||||
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.1
|
||||
9
plugins/python-build/share/python-build/3.14.0a2
Normal file
9
plugins/python-build/share/python-build/3.14.0a2
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.3.2" "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz#2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.14.0a2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a2.tar.xz#2ff9e10147342b3efd69f5cd9cc06ec46250f2a046587599d18e2cac69c05920" standard verify_py313 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.14.0a2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0a2.tgz#b038eab7823e8a1c0500e3a26c95265656c2b8dd0bfa098aa341e9812be8f89c" standard verify_py313 copy_python_gdb ensurepip
|
||||
fi
|
||||
2
plugins/python-build/share/python-build/3.14.0a2t
Normal file
2
plugins/python-build/share/python-build/3.14.0a2t
Normal file
@@ -0,0 +1,2 @@
|
||||
export PYTHON_BUILD_FREE_THREADING=1
|
||||
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0a2
|
||||
12
plugins/python-build/share/python-build/3.9.21
Normal file
12
plugins/python-build/share/python-build/3.9.21
Normal file
@@ -0,0 +1,12 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
# Avoid a compilation error when linking against OpenSSL built with SSLv3 support (fixed in 3.10.0) (#2181)
|
||||
export PYTHON_CFLAGS="-DOPENSSL_NO_SSL3${PYTHON_CFLAGS:+ $PYTHON_CFLAGS}"
|
||||
|
||||
install_package "openssl-1.1.1u" "https://www.openssl.org/source/openssl-1.1.1u.tar.gz#e2f8d84b523eecd06c7be7626830370300fbcc15386bf5142d72758f6963ebc6" 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.21" "https://www.python.org/ftp/python/3.9.21/Python-3.9.21.tar.xz#3126f59592c9b0d798584755f2bf7b081fa1ca35ce7a6fea980108d752a05bb1" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.21" "https://www.python.org/ftp/python/3.9.21/Python-3.9.21.tgz#667c3ba2ca98d39ead1162f6548c3475768582e2ff89e0821d25eb956ac09944" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
25
plugins/python-build/share/python-build/anaconda3-2024.10-1
Normal file
25
plugins/python-build/share/python-build/anaconda3-2024.10-1
Normal file
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Anaconda3-2024.10-1-Linux-aarch64" "https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-aarch64.sh#489c608e8bddd2cf29dfbdd811cf99087cd6b6a0615d41c6f9058ce340594b65" "anaconda" verify_py312
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Anaconda3-2024.10-1-Linux-s390x" "https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-s390x.sh#e00bd5e6c275695e8050a45aa85790315f504c95243dfe3632f505284310f3c4" "anaconda" verify_py312
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Anaconda3-2024.10-1-Linux-x86_64" "https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-x86_64.sh#3ba0a298155c32fbfd80cbc238298560bf69a2df511783054adfc151b76d80d8" "anaconda" verify_py312
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Anaconda3-2024.10-1-MacOSX-arm64" "https://repo.anaconda.com/archive/Anaconda3-2024.10-1-MacOSX-arm64.sh#f64ed797ce23ae1d07ead949bfb6ff630b9fa8269ca8aef8ea2efa82172ece47" "anaconda" verify_py312
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Anaconda3-2024.10-1-MacOSX-x86_64" "https://repo.anaconda.com/archive/Anaconda3-2024.10-1-MacOSX-x86_64.sh#ad3eea1cc969e9dfd4d571fc266aae06ec119f651d7cb19c0dc187b73e2bfab1" "anaconda" verify_py312
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Anaconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
64
plugins/python-build/share/python-build/graalpy-24.1.1
Normal file
64
plugins/python-build/share/python-build/graalpy-24.1.1
Normal file
@@ -0,0 +1,64 @@
|
||||
# Copyright (c) 2024, 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='24.1.1'
|
||||
BUILD=''
|
||||
|
||||
colorize 1 "GraalPy 23.1 and later installed by python-build use the faster Oracle GraalVM distribution" && echo
|
||||
colorize 1 "Oracle GraalVM uses the GFTC license, which is free for development and production use, see https://medium.com/graalvm/161527df3d76" && echo
|
||||
colorize 1 "The GraalVM Community Edition variant of GraalPy is also available, under the name graalpy-community-${VERSION}" && echo
|
||||
|
||||
|
||||
graalpy_arch="$(graalpy_architecture 2>/dev/null || true)"
|
||||
|
||||
case "$graalpy_arch" in
|
||||
"linux-amd64" )
|
||||
checksum="b7ec8b6ead8f0ad19d212617f75c305b38d419bfd3ac6c9e82e9339282699ab9"
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
checksum="cb97bbef83372f00c7ea5f351bcb3c1ad36255ebd7d3cff9267d604ad183c28a"
|
||||
;;
|
||||
"macos-amd64" )
|
||||
checksum="3f4583cf8438237a2061460d4df9025d04eaaae0beadb3626ccdcebf9cfe725a"
|
||||
;;
|
||||
"macos-aarch64" )
|
||||
checksum="23d2397d90ebbd51747541f029ed80b7740fe36b23a45d4616ddad9b60f2c6cb"
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": No binary distribution of GraalPy is available for $(uname -sm)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "${BUILD}" ]; then
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo "Oracle GraalPy currently doesn't provide snapshot builds. Use graalpy-community if you need snapshots."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
url="https://github.com/oracle/graalpython/releases/download/graal-${VERSION}/graalpy-${VERSION}-${graalpy_arch}.tar.gz#${checksum}"
|
||||
|
||||
install_package "graalpy-${VERSION}" "${url}" "copy" ensurepip
|
||||
@@ -0,0 +1,54 @@
|
||||
# Copyright (c) 2024, 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='24.1.1'
|
||||
BUILD=''
|
||||
|
||||
graalpy_arch="$(graalpy_architecture 2>/dev/null || true)"
|
||||
|
||||
case "$graalpy_arch" in
|
||||
"linux-amd64" )
|
||||
checksum="42a6b563271174161a1abca4b045b0602d8e27c12204f3cadd31265fd3ff6d19"
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
checksum="a513ea3036a48a6cee8cfa666bff7b5e6b1a1b6cf623400109fbf856476e9bd3"
|
||||
;;
|
||||
"macos-amd64" )
|
||||
checksum="7f5591074dbd701faa6dec6ea10391bc2d8af736fe8370c5675a11842959edd7"
|
||||
;;
|
||||
"macos-aarch64" )
|
||||
checksum="53f6161d0f9871efaf1f62f2c1894152da0bb2b504a95ebad6f35b19de994f77"
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": No binary distribution of GraalPy is available for $(uname -sm)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "${BUILD}" ]; then
|
||||
url="https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${VERSION}-dev-${BUILD}/graalpy-community-dev-${graalpy_arch}.tar.gz"
|
||||
else
|
||||
url="https://github.com/oracle/graalpython/releases/download/graal-${VERSION}/graalpy-community-${VERSION}-${graalpy_arch}.tar.gz#${checksum}"
|
||||
fi
|
||||
|
||||
install_package "graalpy-community-${VERSION}${BUILD}" "${url}" "copy" ensurepip
|
||||
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py310_24.9.2-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.9.2-0-Linux-aarch64.sh#5d022f16ecb01d33ac8c85a87a0a8dccfb025dc90b20dbd56c4b9ae8f9727578" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py310_24.9.2-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.9.2-0-Linux-s390x.sh#93d75b306151f96a460a80d8849d85636929a90490f44004f4296a0b8399ccc5" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py310_24.9.2-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.9.2-0-Linux-x86_64.sh#364869f004c6259268b09a667ed476080bf4f44e9c4ab06a293146df8990d43f" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py310_24.9.2-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.9.2-0-MacOSX-arm64.sh#d666284d5dd9290b446de5dc20e8498545867c7730799cba8f52e97a45db42d2" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py310_24.9.2-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_24.9.2-0-MacOSX-x86_64.sh#7359ff3963ab3ccdc5eec244c610270b456a9584477cb645aa7539924bdd0482" "miniconda" verify_py310
|
||||
;;
|
||||
* )
|
||||
{ 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,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py311_24.9.2-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-aarch64.sh#c4c12d969be6a02cb7370a0c717400e8eec79dea722ef0fba98d745048948980" "miniconda" verify_py311
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py311_24.9.2-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-s390x.sh#8de1e23f3e0a097bc3b9173a1b4b56544bd34d2831b70a71a9d528eeab0dbe90" "miniconda" verify_py311
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py311_24.9.2-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-Linux-x86_64.sh#62ef806265659c47e37e22e8f9adce29e75c4ea0497e619c280f54c823887c4f" "miniconda" verify_py311
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py311_24.9.2-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-MacOSX-arm64.sh#7358a1d53e7f857a9b87af148d20cdd00f3a91eca9f663371dfa3d830c375033" "miniconda" verify_py311
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py311_24.9.2-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py311_24.9.2-0-MacOSX-x86_64.sh#5d4229c322629cf2932c3a4e181501c98dae35b866c96d208b6688b0e2381604" "miniconda" verify_py311
|
||||
;;
|
||||
* )
|
||||
{ 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,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py312_24.9.2-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-Linux-aarch64.sh#86b8df7481646cf87e77873e9789adb7569b58248d3aa629eb2da35e6f2e2eed" "miniconda" verify_py312
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py312_24.9.2-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-Linux-s390x.sh#876db345b31db6d2b96ab1e2aedfbcea8af6b951a3218e6fd36f657452d1305c" "miniconda" verify_py312
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py312_24.9.2-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-Linux-x86_64.sh#8d936ba600300e08eca3d874dee88c61c6f39303597b2b66baee54af4f7b4122" "miniconda" verify_py312
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py312_24.9.2-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-MacOSX-arm64.sh#08d8a82ed21d2dae707554d540b172fe03327347db747644fbb33abfaf07fddd" "miniconda" verify_py312
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py312_24.9.2-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py312_24.9.2-0-MacOSX-x86_64.sh#ce3b440c32c9c636bbe529477fd496798c35b96d9db1838e3df6b0a80714da4e" "miniconda" verify_py312
|
||||
;;
|
||||
* )
|
||||
{ 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,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py39_24.9.2-0-Linux-aarch64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.9.2-0-Linux-aarch64.sh#4607ec9145ad9c0413e6300dab3febe442e265efce486176ef1f8518ba8bfaeb" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py39_24.9.2-0-Linux-s390x.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.9.2-0-Linux-s390x.sh#5ccde79ed4c333f0e236f36338ed5db111a2fff50859235c4f8fffd2045a6655" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py39_24.9.2-0-Linux-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.9.2-0-Linux-x86_64.sh#4b540d78e5bdd770b39216c0563424ef6656504cbe24c67b2d0454c2eb7afe93" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py39_24.9.2-0-MacOSX-arm64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.9.2-0-MacOSX-arm64.sh#4d5abecbb3264def02ad95ed6c888016f95631649b848da552a1066c52bcd1da" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py39_24.9.2-0-MacOSX-x86_64.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py39_24.9.2-0-MacOSX-x86_64.sh#7535da558c8821d967e026288eaec75d9a159ec760d75c869fd10fa58d3986c3" "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
|
||||
25
plugins/python-build/share/python-build/miniforge3-24.9.2-0
Normal file
25
plugins/python-build/share/python-build/miniforge3-24.9.2-0
Normal file
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniforge3-24.9.2-0-Linux-aarch64.sh" "https://github.com/conda-forge/miniforge/releases/download/24.9.2-0/Miniforge3-24.9.2-0-Linux-aarch64.sh#f33ec46c6c9dbcdc9d1101b04dcddff17f4ca54524a9575992e743bbc051d61c" "miniconda" verify_py312
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniforge3-24.9.2-0-Linux-ppc64le.sh" "https://github.com/conda-forge/miniforge/releases/download/24.9.2-0/Miniforge3-24.9.2-0-Linux-ppc64le.sh#0b24b38611b486e3d1615aa778a6252430d54ae6e1210cd2874a3d8e8efd7abe" "miniconda" verify_py312
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniforge3-24.9.2-0-Linux-x86_64.sh" "https://github.com/conda-forge/miniforge/releases/download/24.9.2-0/Miniforge3-24.9.2-0-Linux-x86_64.sh#ca8c544254c40ae5192eb7db4e133ff4eb9f942a1fec737dba8205ac3f626322" "miniconda" verify_py312
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniforge3-24.9.2-0-MacOSX-arm64.sh" "https://github.com/conda-forge/miniforge/releases/download/24.9.2-0/Miniforge3-24.9.2-0-MacOSX-arm64.sh#b2ee4415bce51895b74b99de6e83ac0f737fd968052b5b49f79e05b292220084" "miniconda" verify_py312
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniforge3-24.9.2-0-MacOSX-x86_64.sh" "https://github.com/conda-forge/miniforge/releases/download/24.9.2-0/Miniforge3-24.9.2-0-MacOSX-x86_64.sh#22b9eab7508d464c7d270883e733496beef25520d96c8383b4683f0122ae0222" "miniconda" verify_py312
|
||||
;;
|
||||
* )
|
||||
{ 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
|
||||
@@ -182,7 +182,7 @@ OUT
|
||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
stub brew "--prefix libyaml : echo '$brew_libdir'"
|
||||
for i in {1..5}; do stub brew false; done
|
||||
for i in {1..6}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
install_fixture definitions/needs-yaml
|
||||
@@ -208,7 +208,7 @@ OUT
|
||||
mkdir -p "$readline_libdir"
|
||||
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
for i in {1..2}; do stub brew false; done
|
||||
for i in {1..3}; do stub brew false; done
|
||||
stub brew "--prefix readline : echo '$readline_libdir'"
|
||||
for i in {1..2}; do stub brew false; done
|
||||
stub_make_install
|
||||
@@ -238,7 +238,7 @@ OUT
|
||||
mkdir -p "$ncurses_libdir"
|
||||
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
for i in {1..3}; do stub brew false; done
|
||||
for i in {1..4}; do stub brew false; done
|
||||
stub brew "--prefix ncurses : echo '$ncurses_libdir'"
|
||||
stub brew false
|
||||
stub_make_install
|
||||
@@ -364,7 +364,7 @@ OUT
|
||||
|
||||
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
||||
stub brew "--prefix : echo '$BREW_PREFIX'"
|
||||
for i in {1..4}; do stub brew false; done
|
||||
for i in {1..5}; do stub brew false; done
|
||||
stub_make_install
|
||||
export PYTHON_BUILD_USE_HOMEBREW=1
|
||||
|
||||
@@ -394,7 +394,7 @@ OUT
|
||||
|
||||
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
||||
stub brew "--prefix : echo '$BREW_PREFIX'"
|
||||
for i in {1..4}; do stub brew false; done
|
||||
for i in {1..5}; do stub brew false; done
|
||||
stub_make_install
|
||||
export PYTHON_BUILD_USE_HOMEBREW=1
|
||||
|
||||
@@ -453,7 +453,7 @@ OUT
|
||||
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
|
||||
for i in {1..4}; do stub brew false; done
|
||||
for i in {1..5}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib"
|
||||
@@ -482,11 +482,11 @@ OUT
|
||||
mkdir -p "$tcl_tk_libdir/lib"
|
||||
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
|
||||
|
||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
|
||||
stub brew false
|
||||
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'"; done
|
||||
stub brew "--prefix tcl-tk@8 : echo '$tcl_tk_libdir'"
|
||||
for i in {1..3}; do stub brew false; done
|
||||
|
||||
stub_make_install
|
||||
@@ -516,10 +516,10 @@ OUT
|
||||
tcl_tk_version_long="8.6.10"
|
||||
tcl_tk_version="${tcl_tk_version_long%.*}"
|
||||
|
||||
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..8}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
|
||||
for i in {1..5}; do stub brew false; done
|
||||
for i in {1..4}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
export PYTHON_CONFIGURE_OPTS="--with-tcltk-libs='-L${TMP}/custom-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version'"
|
||||
@@ -544,14 +544,14 @@ OUT
|
||||
@test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..9}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
|
||||
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
||||
mkdir -p "$tcl_tk_libdir/lib"
|
||||
|
||||
stub brew false
|
||||
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '${tcl_tk_libdir}'"; done
|
||||
stub brew "--prefix tcl-tk@8 : echo '${tcl_tk_libdir}'"
|
||||
for i in {1..3}; do stub brew false; done
|
||||
|
||||
stub_make_install
|
||||
@@ -739,7 +739,7 @@ OUT
|
||||
|
||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
for i in {1..5}; do stub brew false; done
|
||||
for i in {1..6}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
run_inline_definition <<DEF
|
||||
|
||||
@@ -94,7 +94,7 @@ echo 3.10.6
|
||||
!
|
||||
}
|
||||
|
||||
@test "ignores rolling releases, branch tips, alternative srcs, prereleases and virtualenvs" {
|
||||
@test "ignores rolling releases, branch tips, alternative srcs, prereleases, virtualenvs; 't' versions if prefix without 't'" {
|
||||
create_executable pyenv-versions <<!
|
||||
#!$BASH
|
||||
echo 3.8.5-dev
|
||||
@@ -116,6 +116,21 @@ echo 3.8.1/envs/foo
|
||||
!
|
||||
}
|
||||
|
||||
@test "resolves to a 't' version if prefix has 't'" {
|
||||
create_executable pyenv-versions <<!
|
||||
#!$BASH
|
||||
echo 3.13.2t
|
||||
echo 3.13.5
|
||||
echo 3.13.5t
|
||||
echo 3.14.6
|
||||
!
|
||||
run pyenv-latest 3t
|
||||
assert_success
|
||||
assert_output <<!
|
||||
3.13.5t
|
||||
!
|
||||
}
|
||||
|
||||
@test "falls back to argument with -b" {
|
||||
create_executable pyenv-versions <<!
|
||||
#!$BASH
|
||||
|
||||
@@ -127,3 +127,10 @@ OUT
|
||||
assert_success
|
||||
assert_output "3.12.6"
|
||||
}
|
||||
|
||||
@test "pyenv version started by python-" {
|
||||
create_version "python-3.12.6"
|
||||
PYENV_VERSION="python-3.12.6" run pyenv-version-name
|
||||
assert_success
|
||||
assert_output "python-3.12.6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user