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

Compare commits

...

28 Commits

Author SHA1 Message Date
Ivan Pozdeev
0c680e8ede 2.6.4 2025-07-08 21:12:30 +03:00
Edgar Ramírez Mondragón
20296fc53a Add CPython 3.14.0b4 (#3285)
* Bump CPython 3.14 OpenSSL to 3.4.2
2025-07-08 21:10:52 +03:00
native-api
7725fe2cf2 Install feature request templates
[no ci]
2025-07-06 23:46:48 +03:00
native-api
d8384fcc05 Install issue templates
It looks like Github have dropped support for https://github.com/pyenv/pyenv/edit/master/.github/ISSUE_TEMPLATE.md entirely.
2025-07-06 23:29:49 +03:00
John Sirois
e150257413 Add PyPy v7.3.20 (#3284)
The release blog entry is here:
  https://pypy.org/posts/2025/07/pypy-v7320-release.html
2025-07-06 09:22:51 +03:00
native-api
798d21e0ca (regression) Use Zlib from XCode SDK in MacOS without Homebrew or Macports (#3282) 2025-06-29 19:51:25 +03:00
native-api
9114929e4f Backport bpo_36106 to 3.5.10 and 3.6.15 (#3280)
Fixes "error: static declaration of ‘sinpi’ follows non-static declaration"
with newer libm
2025-06-22 14:22:17 +03:00
Ivan Pozdeev
f1c5371752 2.6.3 2025-06-18 22:05:08 +03:00
Ned Batchelder
907cd78f35 Add CPython 3.14.0b3 (#3278)
* remove the need for explicit versions in the python-build free-threading files
2025-06-18 22:02:01 +03:00
Danny Kim
e13b5848be Support linking to MacPorts ports installed from binary archives (#3272) 2025-06-14 09:38:35 +03:00
native-api
bf19366669 Re-promote "Python versions with extended support" to a section (#3276)
It's a valuable asset of Pyenv and https://github.com/pyenv/pyenv/issues/3275 showed it has stoppped being discoverable

[no ci]
2025-06-13 22:19:06 +03:00
Ivan Pozdeev
a71a378dac 2.6.2 2025-06-12 13:19:45 +03:00
Ned Batchelder
807a4e0cac Add CPython 3.13.5 (#3269) 2025-06-12 12:47:09 +03:00
Ivan Pozdeev
b9ede4ae0e 2.6.1 2025-06-04 20:22:49 +03:00
Ned Batchelder
0e05ee8694 Add CPython 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 (#3266) 2025-06-04 09:15:55 +03:00
Ivan Pozdeev
bfbe76e6a9 2.6.0 2025-05-26 22:59:51 +03:00
Ned Batchelder
d88de11543 Add CPython 3.14.0b2 (#3259) 2025-05-26 22:15:12 +03:00
Pedro Fonini
70b973fdd4 Fix python-build's has_broken_mac_readline when Readline is explicitly configured (#3254) 2025-05-22 07:58:25 +03:00
Alexander Studnitskiy
f24ff8d152 Add MacPorts support for python-build (#3186)
Did not implement customizable priority due to unclear use feedback and more compilation in the code, can decide and do that separately

Tcl/Tk from MacPorts support is omitted due to CPython's only being compatible with 
Tcl/Tk 9 since 3.12.5 and 3.13.0.

Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2025-05-18 18:24:38 +03:00
Ivan Pozdeev
5e82f5cf81 Merge branch 'master' of https://github.com/pyenv/pyenv 2025-05-18 12:27:06 +03:00
Ivan Pozdeev
6c86ae4175 README: fix erroneous extra indents in code blocks 2025-05-18 12:26:50 +03:00
Jordan Stewart
da3fcb7eb7 README: Add shell setup instructions for nushell (#2916) 2025-05-18 12:20:30 +03:00
Jesse Wattenbarger
018ca73444 Add --bare option to pyenv version (#2783) 2025-05-17 18:23:25 +03:00
Tom Godkin
90fa430eca README: make fish PATH add conditional on the directory existing (#2786) 2025-05-17 16:13:12 +03:00
native-api
2d8bd15ccd Add CODEOWNERS file (#3247)
to get notifications of pull requests ready for review

[no ci]
2025-05-17 15:38:33 +03:00
native-api
9656bcf0b9 python-build: Support patch paths with spaces/special characters (#3251)
This is now possible because all non-EOL MacOS versions now support
`find -print0`/`sort -z`/`xargs -0`
2025-05-17 08:58:06 +03:00
Ivan Pozdeev
f216b4bfb1 2.5.7 2025-05-09 00:52:54 +03:00
Edgar Ramírez Mondragón
54fd0106f8 Point 3.14-dev to 3.14 branch (#3246) 2025-05-09 00:51:24 +03:00
31 changed files with 1012 additions and 68 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @pyenv/pyenv-core-maintainers @pyenv/pyenv-core-committers

54
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,54 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
### Prerequisites
* [ ] Make sure your problem is not listed in [the common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
* [ ] Make sure no duplicated issue has already been reported in [the pyenv issues](https://github.com/pyenv/pyenv/issues?q=is%3Aissue). For build errors, a reported issue typically mentions a key error message. This key error message is often not in the 10 last build log lines reported to the console but is rather earlier in the build log -- typically, it's the first error message encountered in the log.
* [ ] Make sure you are reporting a problem in Pyenv and not seeking consultation with Pyenv usage.
* GitHub issues are intended mainly for Pyenv development purposes. If you are seeking help with Pyenv usage, check [Pyenv documentation](https://github.com/pyenv/pyenv?tab=readme-ov-file#simple-python-version-management-pyenv), go to a user community site like [Gitter](https://gitter.im/yyuu/pyenv), [StackOverflow](https://stackoverflow.com/questions/tagged/pyenv), etc, or to [Discussions](https://github.com/orgs/pyenv/discussions).
* [ ] Make sure your problem is not derived from packaging (e.g. [Homebrew](https://brew.sh)).
* Please refer to the package documentation for the installation issues, etc.
* [ ] Make sure your problem is not derived from plugins.
* This repository is maintaining `pyenv` and the default `python-build` plugin only. Please refrain from reporting issues of other plugins here.
### Describe the bug
A clear and concise description of what the bug is.
Do specify what the expected behaviour is if that's not obvious from the bug's nature.
#### Reproduction steps
Listing the commands to run in a new console session and their output is usually sufficient.
Please use a Markdown code block (three backticks on a line by themselves before and after the text) to denote a console output excerpt.
Usually not needed for build errors (since the arguments can already be seen in the debug trace) unless you are using an unusual invocation (e.g. setting environment variables that affect the build).
#### Diagnostic details
- [ ] Platform information (e.g. Ubuntu Linux 24.04):
- [ ] OS architecture (e.g. amd64):
- [ ] pyenv version:
- [ ] Python version:
- [ ] C Compiler information (e.g. gcc 7.3):
- [ ] Please attach the debug trace of the failing command as a [gist](https://gist.github.com/):
* 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`).
- [ ] If you have a problem with installing Python, please also attach `config.log` from the build directory
* The build directory is reported after the "BUILD FAILED" message and is usually under `/tmp`.
- [ ] If the build succeeds but the problem is still with the build process (e.g. the resulting Python is missing a feature), please attach
* the debug trace from reinstalling the faulty version with `env PYENV_DEBUG=1 pyenv install -f -k -v <version> 2>&1 | tee trace.log`
* `config.log` from the build directory. When using `pyenv install` with `-k` as per above, the build directory will be under `$PYENV_ROOT/sources`.
- [ ] If the problem happens in another Pyenv invocation, turn on debug logging by setting `PYENV_DEBUG=1`, e.g. `env PYENV_DEBUG=1 pyenv local 3.6.4`, and attach the resulting trace as a gist
- [ ] If the problem happens outside of a Pyenv invocation, get the debug trace like this:
```
export PYENV_DEBUG=1
# for Bash
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
# for Zsh
export PS4='+(%x:%I): %N(%i): '
set -x
<reproduce the problem>
set +x
```

View File

@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Describe the intended use case**
* What your general environment is if it's relevant to the feature request and is not a generic console with a typical Pyenv installation (CI, server with a custom setup, cloud environment, IDE)
* What you are trying to achieve
* What specifically you are doing for that regarding Pyenv
* Where you are stuck
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
[ ] In particular, did you consider [writing a plugin](https://github.com/pyenv/pyenv/blob/master/README.md#pyenv-plugins)? Note that if your plugin has general applicability, you can publish it in the 3rd-party plugin catalog on the Pyenv Wiki as per the link above.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,5 +1,35 @@
# Version History
## Release v2.6.4
* Backport bpo_36106 to 3.5.10 and 3.6.15 by @native-api in https://github.com/pyenv/pyenv/pull/3280
* (regression) Use Zlib from XCode SDK in MacOS without Homebrew or Macports by @native-api in https://github.com/pyenv/pyenv/pull/3282
* Add PyPy v7.3.20 by @jsirois in https://github.com/pyenv/pyenv/pull/3284
* Add CPython 3.14.0b4 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3285
## Release v2.6.3
* README: Re-promote "Python versions with extended support" to a section by @native-api in https://github.com/pyenv/pyenv/pull/3276
* Support linking to MacPorts ports installed from binary archives by @0916dhkim in https://github.com/pyenv/pyenv/pull/3272
* Add CPython 3.14.0b3 by @nedbat in https://github.com/pyenv/pyenv/pull/3278
## Release v2.6.2
* Add CPython 3.13.5 by @nedbat in https://github.com/pyenv/pyenv/pull/3269
## Release v2.6.1
* Add CPython 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4 by @nedbat in https://github.com/pyenv/pyenv/pull/3266
## Release v2.6.0
* python-build: Support patch paths with spaces/special characters by @native-api in https://github.com/pyenv/pyenv/pull/3251
* Add CODEOWNERS file by @native-api in https://github.com/pyenv/pyenv/pull/3247
* README: make fish PATH add conditional on the directory existing by @BooleanCat in https://github.com/pyenv/pyenv/pull/2786
* Add --bare option to `pyenv version` by @jjwatt in https://github.com/pyenv/pyenv/pull/2783
* README: Add shell setup instructions for nushell by @jordanst3wart in https://github.com/pyenv/pyenv/pull/2916
* Add MacPorts support for python-build by @studnitskiy in https://github.com/pyenv/pyenv/pull/3186
* python-build: fix `has_broken_mac_readline` when Readline is explicitly configured by @fofoni in https://github.com/pyenv/pyenv/pull/3254
* Add CPython 3.14.0b2 by @nedbat in https://github.com/pyenv/pyenv/pull/3259
## Release v2.5.7
* Point 3.14-dev to `3.14` branch by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3246
## Release v2.5.6
* Add GraalPy 24.2.1 by @msimacek in https://github.com/pyenv/pyenv/pull/3238
* Fix get-pip URLs for 3.7, 3.8 and Pyston by @dmrlawson in https://github.com/pyenv/pyenv/pull/3242

View File

@@ -272,8 +272,15 @@ version of Python, or install a package that provides binaries.
Displays the currently active Python version, along with information on
how it was set.
Usage: pyenv version [--bare]
--bare show just the version name. An alias to `pyenv version-name'
$ pyenv version
2.7.6 (set by /home/yyuu/.pyenv/version)
$ pyenv version --bare
2.7.6
## `pyenv versions`

View File

@@ -50,6 +50,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
* **[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)
* [Making multiple versions available](#making-multiple-versions-available)
* [Uninstall Python versions](#uninstall-python-versions)
@@ -83,7 +84,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
<details>
The Homebrew option from the [MacOS section below](#macos) would also work if you have Homebrew installed.
##### 1. Automatic installer (Recommended)
```bash
@@ -114,7 +115,7 @@ easy to fork and contribute any changes back upstream.
#### 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
@@ -222,36 +223,54 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
<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 - zsh)"' >> ~/.zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.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
~~~
```fish
set -Ux PYENV_ROOT $HOME/.pyenv
test -d $PYENV_ROOT/bin; and 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
~~~
```fish
set -Ux PYENV_ROOT $HOME/.pyenv
test -d $PYENV_ROOT/bin; and set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
```
3. Now, add this to `~/.config/fish/config.fish`:
~~~ fish
pyenv init - fish | source
~~~
```fish
pyenv init - fish | source
```
</details>
#### Nushell
<details>
Add the following lines to your `config.nu` to add Pyenv and its shims to your `PATH`.
Shell integration (completions and subcommands changing the shell's state)
isn't currently supported.
~~~ nu
$env.PYENV_ROOT = "~/.pyenv" | path expand
if (( $"($env.PYENV_ROOT)/bin" | path type ) == "dir") {
$env.PATH = $env.PATH | prepend $"($env.PYENV_ROOT)/bin" }
$env.PATH = $env.PATH | prepend $"(pyenv root)/shims"
~~~
</details>
### C. Restart your shell
----
@@ -349,8 +368,9 @@ You can run [`pyenv latest -k <prefix>`](COMMANDS.md#pyenv-latest) to see how `p
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details.
----
<details> <summary> Python versions with extended support </summary>
#### 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,

View File

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

View File

@@ -1,9 +1,8 @@
#!/usr/bin/env bash
# Summary: Show the current Python version(s) and its origin
# Usage: pyenv version [--bare]
#
# Shows the currently selected Python version(s) and how it was
# selected. To obtain only the version string, use `pyenv
# version-name'.
# --bare show just the version name. An alias to `pyenv version-name'
set -e
[ -n "$PYENV_DEBUG" ] && set -x
@@ -13,8 +12,25 @@ OLDIFS="$IFS"
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name)) || exitcode=$?
IFS="$OLDIFS"
unset bare
for arg; do
case "$arg" in
--complete )
echo --bare
exit ;;
--bare ) bare=1 ;;
* )
pyenv-help --usage version >&2
exit 1
;;
esac
done
for PYENV_VERSION_NAME in "${PYENV_VERSION_NAMES[@]}"; do
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
if [[ -n $bare ]]; then
echo "$PYENV_VERSION_NAME"
else
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
fi
done
exit $exitcode

View File

@@ -138,6 +138,17 @@ would break all Pyenv-managed installations that depend on it.
You can use a [community plugin `fix-version`](https://github.com/pyenv/pyenv/wiki/Plugins#community-plugins)
to fix installations in such a case.
##### MacPorts
MacPorts Homebrew is used to find dependency packages if `port` is found on `PATH` in MacOS.
Set `PYTHON_BUILD_USE_MACPORTS` or `PYTHON_BUILD_SKIP_MACPORTS` to override this default.
###### Interaction with Homebrew
If both Homebrew and MacPorts are installed and allowed to be used, Homebrew takes preference.
There first ecosystem where any of the required dependency packages is found is used.
##### Portage
In FreeBSD, if `pkg` is on PATH, Ports are searched for some dependencies that Configure is known to not search for via `pkg-config`.
@@ -164,6 +175,8 @@ You can set certain environment variables to control the build process.
* `PYTHON_BUILD_SKIP_HOMEBREW`, if set, will not search for libraries installed by Homebrew when it would normally will.
* `PYTHON_BUILD_USE_HOMEBREW`, if set, will search for libraries installed by Homebrew when it would normally not.
* `PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA`, override the Homebrew OpenSSL formula to use.
* `PYTHON_BUILD_SKIP_MACPORTS`, if set, will not search for libraries installed by MacPorts when it would normally will.
* `PYTHON_BUILD_USE_MACPORTS`, if set, will search for libraries installed by MacPorts when it would normally not.
* `PYTHON_BUILD_ROOT` overrides the default location from where build definitions
in `share/python-build/` are looked up.
* `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get

View File

@@ -27,7 +27,6 @@ shopt -s extglob
exec 3<&2 # preserve original stderr at fd 3
lib() {
parse_options() {
OPTIONS=()
@@ -81,7 +80,12 @@ abs_dirname() {
cd "$cd_path"
fi
name="${path##*/}"
path="$(resolve_link "$name" || true)"
if [[ $name == ".." ]]; then
cd ..
path="$PWD"
else
path="$(resolve_link "$name" || true)"
fi
done
echo "$PWD"
@@ -122,17 +126,56 @@ is_mac() {
}
can_use_homebrew() {
if locked_in; then
locked_in homebrew && rc=$? || rc=$?; return $rc
fi
[[ -n "$PYTHON_BUILD_USE_HOMEBREW" && -n "$PYTHON_BUILD_SKIP_HOMEBREW" ]] && {
echo "error: mutually exclusive environment variables PYTHON_BUILD_USE_HOMEBREW and PYTHON_BUILD_SKIP_HOMEBREW are set" >&3
exit 1
}
[[ -n "$PYTHON_BUILD_USE_HOMEBREW" ]] && return 0
[[ -n "$PYTHON_BUILD_SKIP_HOMEBREW" ]] && return 1
is_mac && return 0
is_mac && command -v brew &>/dev/null && return 0
# In Linux, if Pyenv itself is installed with Homebrew,
# we assume the user wants to take dependencies from there as well by default
command -v brew &>/dev/null && [[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "$(brew --prefix 2>/dev/null ||true)")"/* ]] && return 0
return 1
local brew_prefix
command -v brew &>/dev/null && \
# tests can have non-functional `brew' stub aliased to `false'
# in Bash 3.2, var="$(cmd)" errexits on failure even if part of a conditional chain
brew_prefix="$(brew --prefix || true)" && [[ -n "$brew_prefix" ]] && \
[[ $(abs_dirname "${BASH_SOURCE}") == "$(abs_dirname "${brew_prefix}")"/* ]] && \
{ lock_in homebrew; return 0; }
# do not check the same stuff multiple times
PYTHON_BUILD_SKIP_HOMEBREW=1; return 1
}
can_use_macports() {
if locked_in; then
locked_in macports && rc=$? || rc=$?; return $rc
fi
[[ -n "$PYTHON_BUILD_USE_MACPORTS" && -n "$PYTHON_BUILD_SKIP_MACPORTS" ]] && {
echo "error: mutually exclusive environment variables PYTHON_BUILD_USE_MACPORTS and PYTHON_BUILD_SKIP_MACPORTS are set" >&3
exit 1
}
[[ -n "$PYTHON_BUILD_USE_MACPORTS" ]] && return 0
[[ -n "$PYTHON_BUILD_SKIP_MACPORTS" ]] && return 1
is_mac && command -v port &>/dev/null && return 0
# do not check the same stuff multiple times
PYTHON_BUILD_SKIP_MACPORTS=1; return 1
}
locked_in() {
if [[ -z "$1" ]]; then
[[ -n $_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN ]]
else
[[ $_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN == "$1" ]]
fi
}
lock_in() {
_PYTHON_BUILD_ECOSYSTEM_LOCKED_IN=${1:?}
}
# 9.1 -> 901
@@ -815,15 +858,38 @@ build_package_standard_build() {
local PACKAGE_LDFLAGS="${package_var_name}_LDFLAGS"
if [ "$package_var_name" = "PYTHON" ]; then
use_homebrew || 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
use_xcode_sdk_zlib || use_homebrew_zlib || true
else
use_homebrew_zlib || true
if can_use_homebrew; then
use_custom_tcltk || use_homebrew_tcltk || true
use_homebrew_readline || true
use_homebrew_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_homebrew_zlib || true
else
use_homebrew_zlib || true
fi
fi
if can_use_macports; then
use_custom_tcltk || true
use_macports_readline || true
use_macports_ncurses || true
if is_mac -ge 1014; then
use_xcode_sdk_zlib || use_macports_zlib || true
else
use_macports_zlib || true
fi
fi
if can_use_homebrew; then
use_homebrew || true
fi
if can_use_macports; then
use_macports || true
fi
if is_mac -ge 1014 && ! can_use_homebrew && ! can_use_macports; then
use_xcode_sdk_zlib || true
fi
use_freebsd_pkg || true
use_dsymutil || true
use_free_threading || true
fi
@@ -1160,8 +1226,8 @@ setup_builtin_patches() {
cat >"${package_name}.patch"
HAS_PATCH=true
elif [[ -d "${package_patch_path}" ]]; then
{ find "${package_patch_path}" -maxdepth 1 -type f
} 2>/dev/null | sort | xargs cat 1>"${package_name}.patch"
{ find "${package_patch_path}" -maxdepth 1 -type f -print0
} 2>/dev/null | sort -z | xargs -0 cat 1>"${package_name}.patch"
HAS_PATCH=true
fi
}
@@ -1434,13 +1500,31 @@ use_homebrew() {
if [[ -n $brew_prefix && $brew_prefix != "/usr" && $brew_prefix != "/usr/local" ]]; then
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${brew_prefix}/include"
append_ldflags_libs "-L${brew_prefix}/lib -Wl,-rpath,${brew_prefix}/lib"
lock_in homebrew
fi
fi
}
use_macports() {
can_use_macports || return 1
local port_location="$(command -v port)"
if [ -n "$port_location" ]; then
local prefix="${port_location%/bin/port}"
export CPPFLAGS="-I${prefix}/include${CPPFLAGS:+ $CPPFLAGS}"
prepend_ldflags_libs "-L${prefix}/lib -Wl,-rpath,${prefix}/lib"
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
lock_in macports
fi
}
needs_yaml() {
! configured_with_package_dir "python" "yaml.h" &&
! use_homebrew_yaml
if ! configured_with_package_dir "python" "yaml.h"; then
if can_use_homebrew; then
use_homebrew_yaml && return 1
elif can_use_macports; then
use_macports_yaml && return 1
fi
fi
}
use_homebrew_yaml() {
@@ -1450,6 +1534,17 @@ use_homebrew_yaml() {
echo "python-build: use libyaml from homebrew"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ ${LDFLAGS% }}"
lock_in homebrew
else
return 1
fi
}
use_macports_yaml() {
can_use_macports || return 1
if [[ $(port -q installed libyaml | awk '{print $3}') == "(active)" ]]; then
echo "python-build: use libyaml from MacPorts"
lock_in macports
else
return 1
fi
@@ -1488,9 +1583,16 @@ use_freebsd_pkg() {
has_broken_mac_readline() {
# Mac OS X 10.4 has broken readline.
# https://github.com/pyenv/pyenv/issues/23
is_mac &&
! configured_with_package_dir "python" "readline/rlconf.h" &&
! use_homebrew_readline
if ! is_mac || configured_with_package_dir "python" "readline/rlconf.h"; then
# Not applicable.
return 1
fi
if can_use_homebrew; then
use_homebrew_readline && return 1
fi
if can_use_macports; then
use_macports_readline && return 1
fi
}
use_homebrew_readline() {
@@ -1501,6 +1603,19 @@ use_homebrew_readline() {
echo "python-build: use readline from homebrew"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
lock_in homebrew
else
return 1
fi
fi
}
use_macports_readline() {
can_use_macports || return 1
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
if [[ $(port -q installed readline | awk '{print $3}') == "(active)" ]]; then
echo "python-build: use readline from MacPorts"
lock_in macports
else
return 1
fi
@@ -1514,6 +1629,17 @@ use_homebrew_ncurses() {
echo "python-build: use ncurses from homebrew"
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
lock_in homebrew
else
return 1
fi
}
use_macports_ncurses() {
can_use_macports || return 1
if [[ $(port -q installed ncurses | awk '{print $3}') == "(active)" ]]; then
echo "python-build: use ncurses from MacPorts"
lock_in macports
else
return 1
fi
@@ -1548,8 +1674,14 @@ build_package_mac_readline() {
has_broken_mac_openssl() {
is_mac || return 1
local openssl_version="$(/usr/bin/openssl version 2>/dev/null || true)"
[[ $openssl_version = "OpenSSL 0.9.8"?* || $openssl_version = "LibreSSL"* ]] &&
! use_homebrew_openssl
if [[ $openssl_version = "OpenSSL 0.9.8"?* || $openssl_version = "LibreSSL"* ]]; then
if can_use_homebrew; then
use_homebrew_openssl && return 1
fi
if can_use_macports; then
use_macports_openssl && return 1
fi
fi
}
use_homebrew_openssl() {
@@ -1568,7 +1700,28 @@ use_homebrew_openssl() {
export LDFLAGS="-L$ssldir/lib${LDFLAGS:+ $LDFLAGS}"
fi
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
return
lock_in homebrew
return 0
fi
done
return 1
}
use_macports_openssl() {
can_use_macports || return 1
command -v port >/dev/null || return 1
local port_location="$(command -v port)"
local prefix="${port_location%/bin/port}"
for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do
if [[ $(port -q installed ${openssl} | awk '{print $3}') == "(active)" ]]; then
echo "python-build: use ${openssl} from MacPorts"
if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
# configure script of newer CPython versions support `--with-openssl`
# https://bugs.python.org/issue21541
package_option python configure --with-openssl="${prefix}"
fi
lock_in macports
return 0
fi
done
return 1
@@ -1668,6 +1821,7 @@ use_homebrew_zlib() {
if [ -d "$brew_zlib" ]; then
echo "python-build: use zlib from homebrew"
export CFLAGS="-I${brew_zlib} ${CFLAGS}"
lock_in homebrew
fi
}
@@ -1687,6 +1841,16 @@ use_xcode_sdk_zlib() {
fi
}
use_macports_zlib() {
can_use_macports || return 1
if [[ $(port -q installed zlib | awk '{print $3}') == "(active)" ]]; then
echo "python-build: use zlib from MacPorts"
lock_in macports
else
return 1
fi
}
use_homebrew_tcltk() {
can_use_homebrew || return 1
# Since https://github.com/Homebrew/homebrew-core/commit/f10e88617b41555193c22fdcba6109fe82155ee2 (10.11.2024),
@@ -1711,6 +1875,7 @@ use_homebrew_tcltk() {
fi
fi
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
lock_in homebrew
return 0
fi
done

View File

@@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.2.4" "https://github.com/openssl/openssl/releases/download/openssl-3.2.4/openssl-3.2.4.tar.gz#b23ad7fd9f73e43ad1767e636040e88ba7c9e5775bfa5618436a0dd2c17c3716" 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.18" "https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tar.xz#ae665bc678abd9ab6a6e1573d2481625a53719bc517e9a634ed2b9fefae3817f" standard verify_py310 copy_python_gdb ensurepip
else
install_package "Python-3.10.18" "https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tgz#1b19ab802518eb36a851f5ddef571862c7a31ece533109a99df6d5af0a1ceb99" standard verify_py310 copy_python_gdb ensurepip
fi

View 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.4" "https://github.com/openssl/openssl/releases/download/openssl-3.2.4/openssl-3.2.4.tar.gz#b23ad7fd9f73e43ad1767e636040e88ba7c9e5775bfa5618436a0dd2c17c3716" 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.13" "https://www.python.org/ftp/python/3.11.13/Python-3.11.13.tar.xz#8fb5f9fbc7609fa822cb31549884575db7fd9657cbffb89510b5d7975963a83a" standard verify_py311 copy_python_gdb ensurepip
else
install_package "Python-3.11.13" "https://www.python.org/ftp/python/3.11.13/Python-3.11.13.tgz#0f1a22f4dfd34595a29cf69ee7ea73b9eff8b1cc89d7ab29b3ab0ec04179dad8" standard verify_py311 copy_python_gdb ensurepip
fi

View File

@@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.3.3" "https://github.com/openssl/openssl/releases/download/openssl-3.3.3/openssl-3.3.3.tar.gz#712590fd20aaa60ec75d778fe5b810d6b829ca7fb1e530577917a131f9105539" 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.11" "https://www.python.org/ftp/python/3.12.11/Python-3.12.11.tar.xz#c30bb24b7f1e9a19b11b55a546434f74e739bb4c271a3e3a80ff4380d49f7adb" standard verify_py312 copy_python_gdb ensurepip
else
install_package "Python-3.12.11" "https://www.python.org/ftp/python/3.12.11/Python-3.12.11.tgz#7b8d59af8216044d2313de8120bfc2cc00a9bd2e542f15795e1d616c51faf3d6" standard verify_py312 copy_python_gdb ensurepip
fi

View File

@@ -3,7 +3,7 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" 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.0b1" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b1.tar.xz#2ddd30a77c9f62e065ce648664a254b9b0c011bcdaa8c1c2787087e644cbeb39" standard verify_py314 copy_python_gdb ensurepip
install_package "Python-3.13.4" "https://www.python.org/ftp/python/3.13.4/Python-3.13.4.tar.xz#27b15a797562a2971dce3ffe31bb216042ce0b995b39d768cf15f784cc757365" standard verify_py313 copy_python_gdb ensurepip
else
install_package "Python-3.14.0b1" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b1.tgz#d6c4473fce72fb6b881c1f50fbfcf157be2caa56102f01bd9dda8a459b880a37" standard verify_py314 copy_python_gdb ensurepip
install_package "Python-3.13.4" "https://www.python.org/ftp/python/3.13.4/Python-3.13.4.tgz#2666038f1521b7a8ec34bf2997b363778118d6f3979282c93723e872bcd464e0" standard verify_py313 copy_python_gdb ensurepip
fi

View File

@@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.4

View File

@@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" 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.5" "https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tar.xz#93e583f243454e6e9e4588ca2c2662206ad961659863277afcdb96801647d640" standard verify_py313 copy_python_gdb ensurepip
else
install_package "Python-3.13.5" "https://www.python.org/ftp/python/3.13.5/Python-3.13.5.tgz#e6190f52699b534ee203d9f417bdbca05a92f23e35c19c691a50ed2942835385" standard verify_py313 copy_python_gdb ensurepip
fi

View File

@@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.13.5

View File

@@ -4,4 +4,4 @@ export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
install_package "openssl-3.3.0" "https://www.openssl.org/source/openssl-3.3.0.tar.gz#53e66b043322a606abf0087e7699a0e033a37fa13feb9742df35c3a33b18fb02" 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_git "Python-3.14-dev" "https://github.com/python/cpython" main standard verify_py314 copy_python_gdb ensurepip
install_git "Python-3.14-dev" "https://github.com/python/cpython" 3.14 standard verify_py314 copy_python_gdb ensurepip

View File

@@ -1,2 +0,0 @@
export PYTHON_BUILD_FREE_THREADING=1
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0b1

View File

@@ -0,0 +1,9 @@
prefer_openssl3
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
install_package "openssl-3.4.2" "https://github.com/openssl/openssl/releases/download/openssl-3.4.2/openssl-3.4.2.tar.gz#17b02459fc28be415470cccaae7434f3496cac1306b86b52c83886580e82834c" 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.0b4" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b4.tar.xz#15e123e056abebba6de5e73cfa304459a8c82cafa85d4fc7fc6de80e6a3e1b39" standard verify_py314 copy_python_gdb ensurepip
else
install_package "Python-3.14.0b4" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b4.tgz#bd46b9bf6c1552542e8d36afc7661a3101ded03665228cf3f78c929737bb8ddb" standard verify_py314 copy_python_gdb ensurepip
fi

View File

@@ -0,0 +1,2 @@
export PYTHON_BUILD_FREE_THREADING=1
source "${BASH_SOURCE[0]%t}"

View File

@@ -0,0 +1,12 @@
prefer_openssl3
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-3.0.16" "https://github.com/openssl/openssl/releases/download/openssl-3.0.16/openssl-3.0.16.tar.gz#57e03c50feab5d31b152af2b764f10379aecd8ee92f16c985983ce4a99f7ef86" 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.23" "https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tar.xz#61a42919e13d539f7673cf11d1c404380e28e540510860b9d242196e165709c9" standard verify_py39 copy_python_gdb ensurepip
else
install_package "Python-3.9.23" "https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tgz#9a69aad184dc1d06f6819930741da3a328d34875a41f8ba33875774dbfc51b51" standard verify_py39 copy_python_gdb ensurepip
fi

View File

@@ -0,0 +1,68 @@
From f57cd8288dbe6aba99c057f37ad6d58f8db75350 Mon Sep 17 00:00:00 2001
From: Dima Pasechnik <dimpase@gmail.com>
Date: Tue, 26 Feb 2019 06:36:11 +0000
Subject: [PATCH] bpo-36106: Resolve sinpi name clash with libm (IEEE-754
violation). (GH-12027)
The standard math library (libm) may follow IEEE-754 recommendation to
include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x).
And this triggers a name clash, found by FreeBSD developer
Steve Kargl, who worken on putting sinpi into libm used on FreeBSD
(it has to be named "sinpi", not "sinPi", cf. e.g.
https://en.cppreference.com/w/c/experimental/fpext4).
---
.../next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst | 1 +
Modules/mathmodule.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
create mode 100644 Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
diff --git a/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
new file mode 100644
index 00000000000..36e17508cd4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
@@ -0,0 +1 @@
+Resolve potential name clash with libm's sinpi(). Patch by Dmitrii Pasechnik.
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 2272f622f0b..fd0eb327c74 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -100,7 +100,7 @@ static const double sqrtpi = 1.772453850905516027298167483341145182798;
}
static double
-sinpi(double x)
+m_sinpi(double x)
{
double y, r;
int n;
@@ -328,7 +328,7 @@ m_tgamma(double x)
integer. */
if (absx > 200.0) {
if (x < 0.0) {
- return 0.0/sinpi(x);
+ return 0.0/m_sinpi(x);
}
else {
errno = ERANGE;
@@ -352,7 +352,7 @@ m_tgamma(double x)
}
z = z * lanczos_g / y;
if (x < 0.0) {
- r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
+ r = -pi / m_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
r -= z * r;
if (absx < 140.0) {
r /= pow(y, absx - 0.5);
@@ -423,7 +423,7 @@ m_lgamma(double x)
r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
if (x < 0.0)
/* Use reflection formula to get value for negative x. */
- r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
+ r = logpi - log(fabs(m_sinpi(absx))) - log(absx) - r;
if (Py_IS_INFINITY(r))
errno = ERANGE;
return r;
--
2.36.1.windows.1

View File

@@ -0,0 +1,68 @@
From f57cd8288dbe6aba99c057f37ad6d58f8db75350 Mon Sep 17 00:00:00 2001
From: Dima Pasechnik <dimpase@gmail.com>
Date: Tue, 26 Feb 2019 06:36:11 +0000
Subject: [PATCH] bpo-36106: Resolve sinpi name clash with libm (IEEE-754
violation). (GH-12027)
The standard math library (libm) may follow IEEE-754 recommendation to
include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x).
And this triggers a name clash, found by FreeBSD developer
Steve Kargl, who worken on putting sinpi into libm used on FreeBSD
(it has to be named "sinpi", not "sinPi", cf. e.g.
https://en.cppreference.com/w/c/experimental/fpext4).
---
.../next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst | 1 +
Modules/mathmodule.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
create mode 100644 Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
diff --git a/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
new file mode 100644
index 00000000000..36e17508cd4
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
@@ -0,0 +1 @@
+Resolve potential name clash with libm's sinpi(). Patch by Dmitrii Pasechnik.
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 2272f622f0b..fd0eb327c74 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -100,7 +100,7 @@ static const double sqrtpi = 1.772453850905516027298167483341145182798;
}
static double
-sinpi(double x)
+m_sinpi(double x)
{
double y, r;
int n;
@@ -328,7 +328,7 @@ m_tgamma(double x)
integer. */
if (absx > 200.0) {
if (x < 0.0) {
- return 0.0/sinpi(x);
+ return 0.0/m_sinpi(x);
}
else {
errno = ERANGE;
@@ -352,7 +352,7 @@ m_tgamma(double x)
}
z = z * lanczos_g / y;
if (x < 0.0) {
- r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
+ r = -pi / m_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
r -= z * r;
if (absx < 140.0) {
r /= pow(y, absx - 0.5);
@@ -423,7 +423,7 @@ m_lgamma(double x)
r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
if (x < 0.0)
/* Use reflection formula to get value for negative x. */
- r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
+ r = logpi - log(fabs(m_sinpi(absx))) - log(absx) - r;
if (Py_IS_INFINITY(r))
errno = ERANGE;
return r;
--
2.36.1.windows.1

View File

@@ -0,0 +1,77 @@
VERSION='7.3.20'
PYVER='2.7'
# https://www.pypy.org/checksums.html
aarch64_hash=f22a1be607deeaa4f9be6bc63aae09fe4fb5b990d6a23aa4e7c5960dc5d93c96
linux32_hash=9d554c5efcb6ef80146bb82965f5d8404d6848e6f04b25c378852a095768a69c
linux64_hash=aa3bb92dbb529fa2d4920895b16d67a810b0c709207857d56cfe4a6e3b41e02a
osarm64_hash=be3ffbb243316b1ffbf63ac60d72e099d5b64702e4429eeeb18a0608fb3b8dcc
osx64_hash=9e7cf34e9d4c8d890439fcd10b09a2c0825d8709c63dd4cbf85645711bfb15b7
### end of manual settings - following lines same for every download
function err_no_binary {
local archmsg="${1}"
local ver="pypy${PYVER}-v${VERSION}-src"
local url="https://downloads.python.org/pypy/${ver}.tar.bz2"
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for ${archmsg}."
echo "try '${url}' to build from source."
echo
} >&2
exit 1
}
function pypy_pkg_data {
# pypy architecture tag
local ARCH="${1}"
# defaults
local cmd='install_package' # use bz2
local pkg="${ARCH}" # assume matches
local ext='tar.bz2'
local hash='' # undefined
# select the hash, fix pkg if not match ARCH
case "${ARCH}" in
'linux-aarch64' )
hash="${aarch64_hash}"
pkg='aarch64'
;;
'linux' )
hash="${linux32_hash}"
pkg='linux32'
;;
'linux64' )
hash="${linux64_hash}"
;;
'osarm64' )
hash="${osarm64_hash}"
pkg='macos_arm64'
;;
'osx64' )
if require_osx_version "10.13"; then
hash="${osx64_hash}"
pkg='macos_x86_64'
else
err_no_binary "${ARCH}, OS X < 10.13"
fi
;;
* )
err_no_binary "${ARCH}"
;;
esac
local basever="pypy${PYVER}-v${VERSION}"
local baseurl="https://downloads.python.org/pypy/${basever}"
# result - command, package dir, url+hash
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
}
# determine command, package directory, url+hash
declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")"
# install
${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip_lt21'

View File

@@ -0,0 +1,14 @@
VERSION='7.3.20'
PYVER='2.7'
# https://www.pypy.org/checksums.html
hash=bf958498445f7bf78338723c8d86bd6711e8792461725d2481df77a9566a3e62
### end of manual settings - following lines same for every download
ver="pypy${PYVER}-v${VERSION}-src"
url="https://downloads.python.org/pypy/${ver}.tar.bz2"
prefer_openssl11
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
install_package "${ver}" "${url}#${hash}" 'pypy_builder' "verify_py${PYVER//./}" 'ensurepip_lt21'

View File

@@ -0,0 +1,77 @@
VERSION='7.3.20'
PYVER='3.11'
# https://www.pypy.org/checksums.html
aarch64_hash=9347fe691a07fd9df17a1b186554fb9d9e6210178ffef19520a579ce1f9eb741
linux32_hash=d08ce15dd61e9ace5e010b047104f0137110a258184e448ea8239472f10cf99b
linux64_hash=1410db3a7ae47603e2b7cbfd7ff6390b891b2e041c9eb4f1599f333677bccb3e
osarm64_hash=84a48e09c97f57df62cc9f01b7a6d8c3e306b6270671d871aa8ab8c06945940d
osx64_hash=bb3ae80cf5fca5044af2e42933e7692c7c5e76a828ce0eb6404a5d5da83b313c
### end of manual settings - following lines same for every download
function err_no_binary {
local archmsg="${1}"
local ver="pypy${PYVER}-v${VERSION}-src"
local url="https://downloads.python.org/pypy/${ver}.tar.bz2"
{ echo
colorize 1 "ERROR"
echo ": The binary distribution of PyPy is not available for ${archmsg}."
echo "try '${url}' to build from source."
echo
} >&2
exit 1
}
function pypy_pkg_data {
# pypy architecture tag
local ARCH="${1}"
# defaults
local cmd='install_package' # use bz2
local pkg="${ARCH}" # assume matches
local ext='tar.bz2'
local hash='' # undefined
# select the hash, fix pkg if not match ARCH
case "${ARCH}" in
'linux-aarch64' )
hash="${aarch64_hash}"
pkg='aarch64'
;;
'linux' )
hash="${linux32_hash}"
pkg='linux32'
;;
'linux64' )
hash="${linux64_hash}"
;;
'osarm64' )
hash="${osarm64_hash}"
pkg='macos_arm64'
;;
'osx64' )
if require_osx_version "10.13"; then
hash="${osx64_hash}"
pkg='macos_x86_64'
else
err_no_binary "${ARCH}, OS X < 10.13"
fi
;;
* )
err_no_binary "${ARCH}"
;;
esac
local basever="pypy${PYVER}-v${VERSION}"
local baseurl="https://downloads.python.org/pypy/${basever}"
# result - command, package dir, url+hash
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
}
# determine command, package directory, url+hash
declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")"
# install
${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip'

View File

@@ -0,0 +1,14 @@
VERSION='7.3.20'
PYVER='3.11'
# https://www.pypy.org/checksums.html
hash=7786dda760003e2ea7409c1037e50200c578ec427ce0245ac4cd758710b206fb
### end of manual settings - following lines same for every download
ver="pypy${PYVER}-v${VERSION}-src"
url="https://downloads.python.org/pypy/${ver}.tar.bz2"
prefer_openssl11
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
install_package "${ver}" "${url}#${hash}" 'pypy_builder' "verify_py${PYVER//./}" 'ensurepip'

View File

@@ -188,15 +188,49 @@ make install
OUT
}
@test "Homebrew and port are tried if both are present in PATH in MacOS" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
for i in {1..3}; do stub port false; done
stub_make_install
export PYENV_DEBUG=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub brew
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "homebrew with uncommon prefix is added to search path" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
mkdir -p "$BREW_PREFIX"
export PYTHON_BUILD_SKIP_MACPORTS=1
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew "--prefix : echo '$BREW_PREFIX'" false
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
run_inline_definition <<DEF
@@ -204,12 +238,44 @@ install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.
DEF
assert_success
unstub brew
unstub uname
unstub sw_vers
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "Macports are used in MacOS if Homebrew was not picked" {
cached_tarball "Python-3.6.2"
BREW_PREFIX="$TMP/homebrew-prefix"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..3}; do stub port false; done
stub_make_install
export PYTHON_BUILD_SKIP_HOMEBREW=1
PORT_PREFIX="$(which port)"
PORT_PREFIX="${PORT_PREFIX%/bin/port}"
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$PORT_PREFIX/include -I${TMP}/install/include" LDFLAGS="-L$PORT_PREFIX/lib -Wl,-rpath,$PORT_PREFIX/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
@@ -251,9 +317,9 @@ OUT
mkdir -p "$readline_libdir"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
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 brew "--prefix readline : echo '$readline_libdir'"
for i in {1..3}; do stub brew false; done
stub_make_install
run_inline_definition <<DEF
@@ -281,9 +347,9 @@ OUT
mkdir -p "$ncurses_libdir"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
for i in {1..4}; do stub brew false; done
for i in {1..3}; do stub brew false; done
stub brew "--prefix ncurses : echo '$ncurses_libdir'"
stub brew false
for i in {1..2}; do stub brew false; done
stub_make_install
run_inline_definition <<DEF
@@ -304,6 +370,86 @@ make install
OUT
}
@test "yaml is linked from MacPorts" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub port "-q installed libyaml : echo ' libyaml @0.2.5_0 (active)'"
for i in {1..3}; do stub port false; done
stub_make_install
install_fixture definitions/needs-yaml
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "readline is linked from MacPorts" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub port "-q installed readline : echo ' readline @8.2.013_0 (active)'"
for i in {1..2}; do stub port false; done
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "ncurses is linked from MacPorts" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub port false
stub port "-q installed ncurses : echo '$ncurses_libdir'"
stub port false
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub sw_vers
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "openssl is linked from Ports in FreeBSD if present" {
cached_tarball "Python-3.6.2"
@@ -377,8 +523,10 @@ OUT
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew true; brew
stub port false
stub_make_install
export PYTHON_BUILD_SKIP_HOMEBREW=1
export PYTHON_BUILD_SKIP_MACPORTS=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
@@ -397,6 +545,85 @@ make install
OUT
}
@test "MacPorts is not touched if PYTHON_BUILD_SKIP_MACPORTS is set" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew false
stub port true; port
stub_make_install
export PYTHON_BUILD_SKIP_MACPORTS=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "MacPorts is not touched in Linux" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Linux'
stub port true; port
stub_make_install
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH=""
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "MacPorts is used in Linux if PYTHON_BUILD_USE_MACPORTS is set" {
cached_tarball "Python-3.6.2"
stub uname '-s : echo Linux'
stub brew false
for i in {1..3}; do stub port false; done
PORT_PREFIX="$(which port)"
PORT_PREFIX="${PORT_PREFIX%/bin/port}"
stub_make_install
export PYTHON_BUILD_USE_MACPORTS=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
DEF
assert_success
unstub uname
unstub port
unstub make
assert_build_log <<OUT
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
make -j 2
make install
OUT
}
@test "homebrew is used in Linux if PYTHON_BUILD_USE_HOMEBREW is set" {
cached_tarball "Python-3.6.2"
@@ -404,8 +631,8 @@ OUT
mkdir -p "$BREW_PREFIX"
stub uname '-s : echo Linux'
stub brew "--prefix : echo '$BREW_PREFIX'"
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
export PYTHON_BUILD_USE_HOMEBREW=1
@@ -436,8 +663,8 @@ OUT
stub uname '-s : echo Linux'
stub brew "--prefix : echo '$BREW_PREFIX'"
for i in {1..5}; do stub brew false; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
export PYTHON_BUILD_USE_HOMEBREW=1
run_inline_definition <<DEF
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
@@ -463,7 +690,7 @@ OUT
mkdir -p "$BREW_PREFIX"
stub uname '-s : echo Linux'
for i in {1..5}; do stub brew "--prefix : echo '$BREW_PREFIX'"; done
stub brew "--prefix : echo '$BREW_PREFIX'"
stub_make_install
run_inline_definition <<DEF
@@ -486,7 +713,6 @@ OUT
@test "readline is not linked from Homebrew when explicitly defined" {
cached_tarball "Python-3.6.2"
# python-build
readline_libdir="$TMP/custom"
mkdir -p "$readline_libdir/include/readline"
touch "$readline_libdir/include/readline/rlconf.h"
@@ -526,9 +752,8 @@ OUT
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 1010'
stub brew false
stub brew "--prefix tcl-tk@8 : echo '$tcl_tk_libdir'"
for i in {1..3}; do stub brew false; done
for i in {1..4}; do stub brew false; done
stub_make_install
@@ -591,9 +816,8 @@ OUT
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
mkdir -p "$tcl_tk_libdir/lib"
stub brew false
stub brew "--prefix tcl-tk@8 : echo '${tcl_tk_libdir}'"
for i in {1..3}; do stub brew false; done
for i in {1..4}; do stub brew false; done
stub_make_install
@@ -615,6 +839,7 @@ make -j 2
make install
OUT
}
@test "number of CPU cores defaults to 2" {
cached_tarball "Python-3.6.2"

View File

@@ -55,7 +55,7 @@ NUM_DEFINITIONS="$(find "$BATS_TEST_DIRNAME"/../share/python-build -maxdepth 1 -
echo true > "${TMP}/definitions/2.7.8-test"
mkdir -p "${TMP}/other"
echo false > "${TMP}/other/2.7.8-test"
run bin/python-build "2.7.8-test" "${TMP}/install"
run python-build "2.7.8-test" "${TMP}/install"
assert_success ""
}

View File

@@ -70,3 +70,12 @@ pyenv-version-without-stderr() {
3.3.3 (set by PYENV_VERSION environment variable)
OUT
}
@test "--bare prints just the name" {
create_version "3.3.3"
PYENV_VERSION=3.3.3 run pyenv-version --bare
assert_success
assert_output <<OUT
3.3.3
OUT
}