-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release announcement: https://www.python.org/downloads/release/python-3100/ https://blog.python.org/2021/10/python-3100-is-available.html More detailsed "What's new": https://docs.python.org/3.10/whatsnew/3.10.html For this release, a new version of the buildpack's Python build script has been added, which includes some long-overdue improvements: - enables PGO (`--enable-optimizations`) - enables loadable SQLite extensions (`--enable-loadable-sqlite-extensions`) - enables strict configure option checking (`--enable-option-checking=fatal`) - the make invocation now uses concurrency (!!) - the test module cleanup step now also removes the `idle_test` directory These bring our Python builds closer in-line with those used elsewhere, for example: https://github.com/docker-library/python/blob/d65295b73bc2c711de96caeba17501d1a81b6a5c/3.9/buster/Dockerfile#L43-L45 For docs on the configure options, see: https://docs.python.org/3.10/using/configure.html Fixes #488. GUS-W-8060029. GUS-W-9093281.
- Loading branch information
Showing
18 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
# Build Path: /app/.heroku/python/ | ||
|
||
source $(dirname $0)/python3-new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This file will eventually be merged into the main `python3` build script, | ||
# however for Python 3.10 we are using some new configure options that we wish | ||
# to trial only in the Python 3.10 builds first. | ||
|
||
set -euo pipefail | ||
|
||
OUT_PREFIX=$1 | ||
BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" | ||
export BIN_DIR | ||
|
||
# Orient ourselves and build download link | ||
dep_formula=${0#$WORKSPACE_DIR/} # the path to the original script (e.g. "builds/runtimes/python-3.10.0") | ||
BASE=${dep_formula##*/} # just the filename (e.g. "python-3.10.0") | ||
python_version=${BASE^} # the filename with the first character uppercased (e.g. "Python-3.10.0") | ||
version_number=$(echo "$python_version" | cut -d- -f2) # this version component (e.g. "3.10.0") | ||
dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz | ||
|
||
echo "Building Python ${version_number}..." | ||
echo "Pulling from source: ${dep_url}" | ||
|
||
mkdir src | ||
curl -fL "${dep_url}" | tar -xz --strip-components=1 -C src/ | ||
cd src | ||
|
||
./configure \ | ||
--enable-loadable-sqlite-extensions \ | ||
--enable-optimizations \ | ||
--enable-option-checking=fatal \ | ||
--prefix=$OUT_PREFIX \ | ||
--with-ensurepip=no | ||
|
||
make -j "$(nproc)" | ||
make install | ||
|
||
# Remove unneeded test directories, similar to the official Docker Python images: | ||
# https://github.com/docker-library/python | ||
# Not using the new --disable-test-modules since it breaks PGO which runs the Python test suite. | ||
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) -exec rm -rf '{}' + | ||
|
||
# Remove spare / | ||
LOCATION=${OUT_PREFIX%?} | ||
|
||
ln $LOCATION/bin/python3 $LOCATION/bin/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
urllib3 = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.10" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
urllib3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-3.10.0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-3.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters