mirror of
https://github.com/actions/python-versions.git
synced 2025-12-15 15:32:11 +00:00
Compare commits
17 Commits
3.12.2-110
...
test-3.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbc60cfaec | ||
|
|
c84ab0e4bd | ||
|
|
4117c4fe82 | ||
|
|
3d18e531c2 | ||
|
|
c47a267fd1 | ||
|
|
d43da0ca8a | ||
|
|
c0cdd7380e | ||
|
|
dbeaa2df93 | ||
|
|
771cbab387 | ||
|
|
7069021fff | ||
|
|
d8ae6ee095 | ||
|
|
dd24c2e5e7 | ||
|
|
48bcef9764 | ||
|
|
5d096de548 | ||
|
|
b0ba1dbe1e | ||
|
|
8eb4ff3a92 | ||
|
|
98e79473eb |
4
.github/workflows/build-python-packages.yml
vendored
4
.github/workflows/build-python-packages.yml
vendored
@@ -15,7 +15,7 @@ on:
|
|||||||
PLATFORMS:
|
PLATFORMS:
|
||||||
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
|
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
|
||||||
required: true
|
required: true
|
||||||
default: 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-12_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64'
|
default: 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-13_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'versions-manifest.json'
|
- 'versions-manifest.json'
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Generate execution matrix
|
- name: Generate execution matrix
|
||||||
id: generate-matrix
|
id: generate-matrix
|
||||||
run: |
|
run: |
|
||||||
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-12,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim()
|
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-13,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim()
|
||||||
$matrix = @()
|
$matrix = @()
|
||||||
|
|
||||||
foreach ($configuration in $configurations) {
|
foreach ($configuration in $configurations) {
|
||||||
|
|||||||
4
.github/workflows/releases-validation.yml
vendored
4
.github/workflows/releases-validation.yml
vendored
@@ -14,8 +14,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04, macos-13]
|
||||||
python: [3.9.13, 3.10.11, 3.11.8]
|
python: [3.9.13, 3.10.11, 3.11.8, 3.12.7, 3.13.0]
|
||||||
steps:
|
steps:
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
|||||||
@@ -6,18 +6,17 @@ class macOSPythonBuilder : NixPythonBuilder {
|
|||||||
MacOS Python builder class.
|
MacOS Python builder class.
|
||||||
|
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Contains methods that required to build macOS Python artifact from sources. Inherited from base NixPythonBuilder.
|
Contains methods required to build macOS Python artifacts from sources. Inherited from base NixPythonBuilder.
|
||||||
|
|
||||||
While python.org provides precompiled binaries for macOS, switching to them risks breaking existing customers.
|
While python.org provides precompiled binaries for macOS, switching to them risks breaking existing customers.
|
||||||
If we wanted to start using the official binaries instead of building from source, we should avoid changing previous versions
|
If we wanted to start using the official binaries instead of building from source, we should avoid changing previous versions
|
||||||
so we remain backwards compatible.
|
so we remain backwards compatible.
|
||||||
|
|
||||||
.PARAMETER platform
|
.PARAMETER platform
|
||||||
The full name of platform for which Python should be built.
|
The full name of the platform for which Python should be built.
|
||||||
|
|
||||||
.PARAMETER version
|
.PARAMETER version
|
||||||
The version of Python that should be built.
|
The version of Python that should be built.
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
macOSPythonBuilder(
|
macOSPythonBuilder(
|
||||||
@@ -32,12 +31,16 @@ class macOSPythonBuilder : NixPythonBuilder {
|
|||||||
Prepare system environment by installing dependencies and required packages.
|
Prepare system environment by installing dependencies and required packages.
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
# Only for Python 3.7.17, install additional dependencies
|
||||||
if ($this.Version -eq "3.7.17") {
|
if ($this.Version -eq "3.7.17") {
|
||||||
# We have preinstalled ncurses and readLine on the hoster runners. But we need to install bzip2 for
|
Write-Host "Installing additional dependencies for Python 3.7.17..."
|
||||||
# setting up an environemnt
|
# Install necessary dependencies for Python 3.7.17
|
||||||
# If we get any issues realted to ncurses or readline we can try to run this command
|
Execute-Command -Command "brew install bzip2 zlib readline ncurses sqlite3 openssl@3"
|
||||||
# brew install ncurses readline
|
|
||||||
Execute-Command -Command "brew install bzip2"
|
# Ensure the environment variables for zlib are set correctly
|
||||||
|
$zlibPrefix = (brew --prefix zlib)
|
||||||
|
$env:LDFLAGS += " -L$($zlibPrefix)/lib"
|
||||||
|
$env:CFLAGS += " -I$($zlibPrefix)/include"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,13 +71,13 @@ class macOSPythonBuilder : NixPythonBuilder {
|
|||||||
### and then add the appropriate paths for the header and library files to configure command.
|
### and then add the appropriate paths for the header and library files to configure command.
|
||||||
### Link to documentation (https://cpython-devguide.readthedocs.io/setup/#build-dependencies)
|
### Link to documentation (https://cpython-devguide.readthedocs.io/setup/#build-dependencies)
|
||||||
if ($this.Version -lt "3.7.0") {
|
if ($this.Version -lt "3.7.0") {
|
||||||
$env:LDFLAGS = "-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/zlib/lib"
|
$env:LDFLAGS = "-L/usr/local/opt/openssl@3/lib -L/usr/local/opt/zlib/lib"
|
||||||
$env:CFLAGS = "-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/zlib/include"
|
$env:CFLAGS = "-I/usr/local/opt/openssl@3/include -I/usr/local/opt/zlib/include"
|
||||||
} else {
|
} else {
|
||||||
$configureString += " --with-openssl=/usr/local/opt/openssl@1.1"
|
$configureString += " --with-openssl=/usr/local/opt/openssl@1.1" # For Python 3.7.x, use OpenSSL 1.1
|
||||||
|
|
||||||
# For Python 3.7.2 and 3.7.3 we need to provide PATH for zlib to pack it properly. Otherwise the build will fail
|
# For Python 3.7.2, 3.7.3, and 3.7.17 we need to provide PATH for zlib to pack it properly.
|
||||||
# with the error: zipimport.ZipImportError: can't decompress data; zlib not available
|
# Otherwise, the build will fail with the error: zipimport.ZipImportError: can't decompress data; zlib not available
|
||||||
if ($this.Version -eq "3.7.2" -or $this.Version -eq "3.7.3" -or $this.Version -eq "3.7.17") {
|
if ($this.Version -eq "3.7.2" -or $this.Version -eq "3.7.3" -or $this.Version -eq "3.7.17") {
|
||||||
$env:LDFLAGS = "-L/usr/local/opt/zlib/lib"
|
$env:LDFLAGS = "-L/usr/local/opt/zlib/lib"
|
||||||
$env:CFLAGS = "-I/usr/local/opt/zlib/include"
|
$env:CFLAGS = "-I/usr/local/opt/zlib/include"
|
||||||
@@ -84,7 +87,9 @@ class macOSPythonBuilder : NixPythonBuilder {
|
|||||||
$configureString += " --with-tcltk-includes='-I /usr/local/opt/tcl-tk/include' --with-tcltk-libs='-L/usr/local/opt/tcl-tk/lib -ltcl8.6 -ltk8.6'"
|
$configureString += " --with-tcltk-includes='-I /usr/local/opt/tcl-tk/include' --with-tcltk-libs='-L/usr/local/opt/tcl-tk/lib -ltcl8.6 -ltk8.6'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Specific for Python 3.7.17
|
||||||
if ($this.Version -eq "3.7.17") {
|
if ($this.Version -eq "3.7.17") {
|
||||||
|
Write-Host "Setting environment for Python 3.7.17..."
|
||||||
$env:LDFLAGS += " -L$(brew --prefix bzip2)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix ncurses)/lib"
|
$env:LDFLAGS += " -L$(brew --prefix bzip2)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix ncurses)/lib"
|
||||||
$env:CFLAGS += " -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(brew --prefix ncurses)/include"
|
$env:CFLAGS += " -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(brew --prefix ncurses)/include"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,12 +23,34 @@ PYTHON_TOOLCACHE_VERSION_ARCH_PATH=$PYTHON_TOOLCACHE_VERSION_PATH/$ARCH
|
|||||||
PYTHON_FRAMEWORK_PATH="/Library/Frameworks/Python.framework/Versions/${MAJOR_VERSION}.${MINOR_VERSION}"
|
PYTHON_FRAMEWORK_PATH="/Library/Frameworks/Python.framework/Versions/${MAJOR_VERSION}.${MINOR_VERSION}"
|
||||||
PYTHON_APPLICATION_PATH="/Applications/Python ${MAJOR_VERSION}.${MINOR_VERSION}"
|
PYTHON_APPLICATION_PATH="/Applications/Python ${MAJOR_VERSION}.${MINOR_VERSION}"
|
||||||
|
|
||||||
echo "Check if Python hostedtoolcache folder exist..."
|
# Check if zlib is installed
|
||||||
|
echo "Checking if zlib is installed..."
|
||||||
|
if ! brew list zlib &>/dev/null; then
|
||||||
|
echo "Installing zlib via brew..."
|
||||||
|
brew install zlib
|
||||||
|
else
|
||||||
|
echo "zlib already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only for Python 3.7.17, install additional dependencies like zlib and others
|
||||||
|
if [ "$MAJOR_VERSION" -eq 3 ] && [ "$MINOR_VERSION" -eq 7 ] && [ "$PYTHON_FULL_VERSION" == "3.7.17" ]; then
|
||||||
|
echo "Installing additional dependencies for Python 3.7.17..."
|
||||||
|
brew install bzip2 readline ncurses sqlite3 openssl@3
|
||||||
|
# Ensure the environment variables for zlib are set correctly
|
||||||
|
ZLIB_PREFIX=$(brew --prefix zlib)
|
||||||
|
export LDFLAGS="-L${ZLIB_PREFIX}/lib"
|
||||||
|
export CFLAGS="-I${ZLIB_PREFIX}/include"
|
||||||
|
export CPPFLAGS="-I${ZLIB_PREFIX}/include"
|
||||||
|
echo "zlib linked at ${ZLIB_PREFIX}/lib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if Python hostedtoolcache folder exists...
|
||||||
|
echo "Check if Python hostedtoolcache folder exists..."
|
||||||
if [ ! -d $PYTHON_TOOLCACHE_PATH ]; then
|
if [ ! -d $PYTHON_TOOLCACHE_PATH ]; then
|
||||||
echo "Creating Python hostedtoolcache folder..."
|
echo "Creating Python hostedtoolcache folder..."
|
||||||
mkdir -p $PYTHON_TOOLCACHE_PATH
|
mkdir -p $PYTHON_TOOLCACHE_PATH
|
||||||
else
|
else
|
||||||
# remove ALL other directories for same major.minor python versions
|
# Remove ALL other directories for same major.minor python versions
|
||||||
find $PYTHON_TOOLCACHE_PATH -name "${MAJOR_VERSION}.${MINOR_VERSION}.*" | while read python_version; do
|
find $PYTHON_TOOLCACHE_PATH -name "${MAJOR_VERSION}.${MINOR_VERSION}.*" | while read python_version; do
|
||||||
python_version_arch="$python_version/$ARCH"
|
python_version_arch="$python_version/$ARCH"
|
||||||
if [ -e "$python_version_arch" ]; then
|
if [ -e "$python_version_arch" ]; then
|
||||||
@@ -38,10 +60,10 @@ else
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Install Python binaries from prebuilt package"
|
echo "Installing Python binaries from prebuilt package"
|
||||||
sudo installer -pkg $PYTHON_PKG_NAME -target /
|
sudo installer -pkg $PYTHON_PKG_NAME -target /
|
||||||
|
|
||||||
echo "Create hostedtoolcach symlinks (Required for the backward compatibility)"
|
echo "Creating hostedtoolcache symlinks (Required for the backward compatibility)"
|
||||||
echo "Create Python $PYTHON_FULL_VERSION folder"
|
echo "Create Python $PYTHON_FULL_VERSION folder"
|
||||||
mkdir -p $PYTHON_TOOLCACHE_VERSION_ARCH_PATH
|
mkdir -p $PYTHON_TOOLCACHE_VERSION_ARCH_PATH
|
||||||
cd $PYTHON_TOOLCACHE_VERSION_ARCH_PATH
|
cd $PYTHON_TOOLCACHE_VERSION_ARCH_PATH
|
||||||
@@ -51,7 +73,7 @@ ln -s "${PYTHON_FRAMEWORK_PATH}/include" include
|
|||||||
ln -s "${PYTHON_FRAMEWORK_PATH}/share" share
|
ln -s "${PYTHON_FRAMEWORK_PATH}/share" share
|
||||||
ln -s "${PYTHON_FRAMEWORK_PATH}/lib" lib
|
ln -s "${PYTHON_FRAMEWORK_PATH}/lib" lib
|
||||||
|
|
||||||
echo "Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)"
|
echo "Creating additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)"
|
||||||
ln -s ./bin/$PYTHON_MAJOR_DOT_MINOR python
|
ln -s ./bin/$PYTHON_MAJOR_DOT_MINOR python
|
||||||
|
|
||||||
cd bin/
|
cd bin/
|
||||||
@@ -73,8 +95,8 @@ export PIP_ROOT_USER_ACTION=ignore
|
|||||||
./python -m ensurepip
|
./python -m ensurepip
|
||||||
./python -m pip install --upgrade --force-reinstall pip --disable-pip-version-check --no-warn-script-location
|
./python -m pip install --upgrade --force-reinstall pip --disable-pip-version-check --no-warn-script-location
|
||||||
|
|
||||||
echo "Install OpenSSL certificates"
|
echo "Installing OpenSSL certificates"
|
||||||
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"
|
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"
|
||||||
|
|
||||||
echo "Create complete file"
|
echo "Creating complete file"
|
||||||
touch $PYTHON_TOOLCACHE_VERSION_PATH/${ARCH}.complete
|
touch $PYTHON_TOOLCACHE_VERSION_PATH/${ARCH}.complete
|
||||||
|
|||||||
@@ -54,15 +54,15 @@ else:
|
|||||||
if os_type == 'Darwin':
|
if os_type == 'Darwin':
|
||||||
### Validate openssl links
|
### Validate openssl links
|
||||||
if version_major == 3 and version_minor < 7:
|
if version_major == 3 and version_minor < 7:
|
||||||
expected_ldflags = '-L/usr/local/opt/openssl@1.1/lib'
|
expected_ldflags = '-L/usr/local/opt/openssl@3/lib'
|
||||||
ldflags = sysconfig.get_config_var('LDFLAGS')
|
ldflags = sysconfig.get_config_var('LDFLAGS')
|
||||||
|
|
||||||
if not expected_ldflags in ldflags:
|
if not expected_ldflags in ldflags:
|
||||||
print('Invalid ldflags: %s; Expected: %s' % (ldflags, expected_ldflags))
|
print('Invalid ldflags: %s; Expected: %s' % (ldflags, expected_ldflags))
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else:
|
||||||
expected_openssl_includes = '-I/usr/local/opt/openssl@1.1/include'
|
expected_openssl_includes = '-I/usr/local/opt/openssl@3/include'
|
||||||
expected_openssl_ldflags ='-L/usr/local/opt/openssl@1.1/lib'
|
expected_openssl_ldflags ='-L/usr/local/opt/openssl@3/lib'
|
||||||
|
|
||||||
openssl_includes = sysconfig.get_config_var('OPENSSL_INCLUDES')
|
openssl_includes = sysconfig.get_config_var('OPENSSL_INCLUDES')
|
||||||
openssl_ldflags = sysconfig.get_config_var('OPENSSL_LDFLAGS')
|
openssl_ldflags = sysconfig.get_config_var('OPENSSL_LDFLAGS')
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user