mirror of
https://github.com/actions/python-versions.git
synced 2025-12-15 15:32:11 +00:00
Compare commits
55 Commits
3.9.0-rc.2
...
3.10.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c5eb53471 | ||
|
|
4a64b9faa7 | ||
|
|
f122228a65 | ||
|
|
de3f713ccc | ||
|
|
918fe6dc0f | ||
|
|
21af7aa4a5 | ||
|
|
39774a2eb7 | ||
|
|
5c48eb00d0 | ||
|
|
f102cb2a16 | ||
|
|
dc6698e2f1 | ||
|
|
50aa2873fc | ||
|
|
cf414aaddb | ||
|
|
139e1b9608 | ||
|
|
f4137da2f9 | ||
|
|
456c8c380c | ||
|
|
30a06d5828 | ||
|
|
d3614793c0 | ||
|
|
fab0879a3d | ||
|
|
105a61d2c8 | ||
|
|
9515b3b32a | ||
|
|
597694ec77 | ||
|
|
a6b76b25b6 | ||
|
|
3a4a0fd269 | ||
|
|
c4836579b7 | ||
|
|
ed01c1359f | ||
|
|
650a155a9a | ||
|
|
28d23216d1 | ||
|
|
6468490367 | ||
|
|
4be9a4cca1 | ||
|
|
89a619f4b9 | ||
|
|
ac42875cb8 | ||
|
|
280f63ac35 | ||
|
|
f85839ce0d | ||
|
|
594273ac16 | ||
|
|
bc57fd3c5f | ||
|
|
a887886318 | ||
|
|
ff4ca0b2e5 | ||
|
|
0b6a06284d | ||
|
|
50e47adc8b | ||
|
|
99a84463ad | ||
|
|
a7aea91c95 | ||
|
|
cdd1351989 | ||
|
|
2aa5c75cf9 | ||
|
|
13b26039fa | ||
|
|
aa8915507a | ||
|
|
57bf4da3a5 | ||
|
|
085cf7607e | ||
|
|
ae06e9c90f | ||
|
|
c4030498aa | ||
|
|
6701f7c8b0 | ||
|
|
1430296346 | ||
|
|
abc7af4881 | ||
|
|
c2464b5d82 | ||
|
|
ff07bfffbb | ||
|
|
46856eea96 |
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* @actions/virtual-environments-owners
|
||||||
34
.github/workflows/test-python-version.yml
vendored
Normal file
34
.github/workflows/test-python-version.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Test Python version
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Python version to build'
|
||||||
|
required: true
|
||||||
|
architecture:
|
||||||
|
description: 'The target architecture (x86, x64) of the Python'
|
||||||
|
required: false
|
||||||
|
default: 'x64'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-python:
|
||||||
|
name: Test Python ${{ github.event.inputs.version }} ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
||||||
|
steps:
|
||||||
|
- name: Setup Python ${{ github.event.inputs.version }}
|
||||||
|
uses: actions/setup-python@main
|
||||||
|
with:
|
||||||
|
python-version: ${{ github.event.inputs.version }}
|
||||||
|
architecture: ${{ github.event.inputs.architecture }}
|
||||||
|
|
||||||
|
- name: Validate version
|
||||||
|
run: |
|
||||||
|
python --version
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Run simple code
|
||||||
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
@@ -27,6 +27,7 @@ jobs:
|
|||||||
archiveFilePatterns: '$(Build.BinariesDirectory)/python-$(VERSION)-$(Platform)-$(Architecture).*'
|
archiveFilePatterns: '$(Build.BinariesDirectory)/python-$(VERSION)-$(Platform)-$(Architecture).*'
|
||||||
destinationFolder: $(Build.BinariesDirectory)
|
destinationFolder: $(Build.BinariesDirectory)
|
||||||
cleanDestinationFolder: false
|
cleanDestinationFolder: false
|
||||||
|
overwriteExistingFiles: true
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Apply build artifact to the local machines'
|
displayName: 'Apply build artifact to the local machines'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using module "./builders/win-python-builder.psm1"
|
using module "./win-python-builder.psm1"
|
||||||
using module "./builders/ubuntu-python-builder.psm1"
|
using module "./ubuntu-python-builder.psm1"
|
||||||
using module "./builders/macos-python-builder.psm1"
|
using module "./macos-python-builder.psm1"
|
||||||
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using module "./builders/nix-python-builder.psm1"
|
using module "./nix-python-builder.psm1"
|
||||||
|
|
||||||
class macOSPythonBuilder : NixPythonBuilder {
|
class macOSPythonBuilder : NixPythonBuilder {
|
||||||
<#
|
<#
|
||||||
@@ -40,10 +40,10 @@ 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$(brew --prefix openssl)/lib"
|
$env:LDFLAGS = "-L/usr/local/opt/openssl@1.1/lib"
|
||||||
$env:CFLAGS = "-I$(brew --prefix openssl)/include"
|
$env:CFLAGS = "-I/usr/local/opt/openssl@1.1/include"
|
||||||
} else {
|
} else {
|
||||||
$configureString += " --with-openssl=/usr/local/opt/openssl"
|
$configureString += " --with-openssl=/usr/local/opt/openssl@1.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
### Compile with support of loadable sqlite extensions. Unavailable for Python 2.*
|
### Compile with support of loadable sqlite extensions. Unavailable for Python 2.*
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using module "./builders/python-builder.psm1"
|
using module "./python-builder.psm1"
|
||||||
|
|
||||||
class NixPythonBuilder : PythonBuilder {
|
class NixPythonBuilder : PythonBuilder {
|
||||||
<#
|
<#
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using module "./builders/nix-python-builder.psm1"
|
using module "./nix-python-builder.psm1"
|
||||||
|
|
||||||
class UbuntuPythonBuilder : NixPythonBuilder {
|
class UbuntuPythonBuilder : NixPythonBuilder {
|
||||||
<#
|
<#
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using module "./builders/python-builder.psm1"
|
using module "./python-builder.psm1"
|
||||||
|
|
||||||
class WinPythonBuilder : PythonBuilder {
|
class WinPythonBuilder : PythonBuilder {
|
||||||
<#
|
<#
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth
|
|||||||
|
|
||||||
echo "Upgrading PIP..."
|
echo "Upgrading PIP..."
|
||||||
./python -m ensurepip
|
./python -m ensurepip
|
||||||
./python -m pip install --ignore-installed pip
|
./python -m pip install --ignore-installed pip --no-warn-script-location
|
||||||
|
|
||||||
echo "Create complete file"
|
echo "Create complete file"
|
||||||
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete
|
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete
|
||||||
|
|||||||
@@ -121,9 +121,14 @@ if ($LASTEXITCODE -ne 0) {
|
|||||||
Throw "Error happened during Python installation"
|
Throw "Error happened during Python installation"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "Create `python3` symlink"
|
||||||
|
if ($MajorVersion -ne "2") {
|
||||||
|
New-Item -Path "$PythonArchPath\python3.exe" -ItemType SymbolicLink -Value "$PythonArchPath\python.exe"
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "Install and upgrade Pip"
|
Write-Host "Install and upgrade Pip"
|
||||||
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
|
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
|
||||||
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip"
|
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location"
|
||||||
|
|
||||||
Write-Host "Create complete file"
|
Write-Host "Create complete file"
|
||||||
New-Item -ItemType File -Path $PythonVersionPath -Name "$Architecture.complete" | Out-Null
|
New-Item -ItemType File -Path $PythonVersionPath -Name "$Architecture.complete" | Out-Null
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ param (
|
|||||||
|
|
||||||
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
|
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
|
||||||
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
|
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
|
||||||
|
Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
|
||||||
|
|
||||||
function Analyze-MissingModules([string] $buildOutputLocation) {
|
function Analyze-MissingModules([string] $buildOutputLocation) {
|
||||||
$searchStringStart = "Failed to build these modules:"
|
$searchStringStart = "Failed to build these modules:"
|
||||||
@@ -47,6 +48,11 @@ Describe "Tests" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "Run pip" {
|
||||||
|
"pip install requests" | Should -ReturnZeroExitCode
|
||||||
|
"pip uninstall requests -y" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
if (IsNixPlatform $Platform) {
|
if (IsNixPlatform $Platform) {
|
||||||
|
|
||||||
It "Check for failed modules in build_output" {
|
It "Check for failed modules in build_output" {
|
||||||
@@ -59,7 +65,8 @@ Describe "Tests" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
It "Check if python configuration is correct" {
|
It "Check if python configuration is correct" {
|
||||||
"python ./sources/python-config-test.py $Version" | Should -ReturnZeroExitCode
|
$nativeVersion = Convert-Version -version $Version
|
||||||
|
"python ./sources/python-config-test.py $Version $nativeVersion" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Check if shared libraries are linked correctly" {
|
It "Check if shared libraries are linked correctly" {
|
||||||
@@ -68,7 +75,7 @@ Describe "Tests" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Pyinstaller 3.5 does not support Python 3.8.0. Check issue https://github.com/pyinstaller/pyinstaller/issues/4311
|
# Pyinstaller 3.5 does not support Python 3.8.0. Check issue https://github.com/pyinstaller/pyinstaller/issues/4311
|
||||||
if ($Version -lt "3.8.0") {
|
if ($Version -lt "3.8.0" -and $Version.Major -ne "2") {
|
||||||
It "Validate Pyinstaller" {
|
It "Validate Pyinstaller" {
|
||||||
"pip install pyinstaller" | Should -ReturnZeroExitCode
|
"pip install pyinstaller" | Should -ReturnZeroExitCode
|
||||||
"pyinstaller --onefile ./sources/simple-test.py" | Should -ReturnZeroExitCode
|
"pyinstaller --onefile ./sources/simple-test.py" | Should -ReturnZeroExitCode
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import distutils.sysconfig
|
import distutils.sysconfig
|
||||||
|
from distutils.version import LooseVersion
|
||||||
import sysconfig
|
import sysconfig
|
||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
@@ -7,6 +8,7 @@ import os
|
|||||||
# Define variables
|
# Define variables
|
||||||
os_type = platform.system()
|
os_type = platform.system()
|
||||||
version = sys.argv[1]
|
version = sys.argv[1]
|
||||||
|
nativeVersion = sys.argv[2]
|
||||||
|
|
||||||
lib_dir_path = sysconfig.get_config_var('LIBDIR')
|
lib_dir_path = sysconfig.get_config_var('LIBDIR')
|
||||||
ld_library_name = sysconfig.get_config_var('LDLIBRARY')
|
ld_library_name = sysconfig.get_config_var('LDLIBRARY')
|
||||||
@@ -41,7 +43,7 @@ else:
|
|||||||
### Validate macOS
|
### Validate macOS
|
||||||
if os_type == 'Darwin':
|
if os_type == 'Darwin':
|
||||||
### Validate openssl links
|
### Validate openssl links
|
||||||
if version < "3.7.0":
|
if LooseVersion(nativeVersion) < LooseVersion("3.7.0"):
|
||||||
expected_ldflags = '-L/usr/local/opt/openssl@1.1/lib'
|
expected_ldflags = '-L/usr/local/opt/openssl@1.1/lib'
|
||||||
ldflags = sysconfig.get_config_var('LDFLAGS')
|
ldflags = sysconfig.get_config_var('LDFLAGS')
|
||||||
|
|
||||||
@@ -49,8 +51,8 @@ if os_type == 'Darwin':
|
|||||||
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/include'
|
expected_openssl_includes = '-I/usr/local/opt/openssl@1.1/include'
|
||||||
expected_openssl_ldflags ='-L/usr/local/opt/openssl/lib'
|
expected_openssl_ldflags ='-L/usr/local/opt/openssl@1.1/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')
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ standard_library = [
|
|||||||
'sre_constants',
|
'sre_constants',
|
||||||
'sre_parse',
|
'sre_parse',
|
||||||
'ssl',
|
'ssl',
|
||||||
|
'_ssl',
|
||||||
'stat',
|
'stat',
|
||||||
'string',
|
'string',
|
||||||
'stringprep',
|
'stringprep',
|
||||||
@@ -255,6 +256,11 @@ if sys.version_info > (3, 7):
|
|||||||
if sys.version_info > (3, 8):
|
if sys.version_info > (3, 8):
|
||||||
standard_library.remove('dummy_threading')
|
standard_library.remove('dummy_threading')
|
||||||
|
|
||||||
|
# 'symbol' and 'formatter' modules have been removed from Python 3.10
|
||||||
|
if sys.version_info >= (3, 10):
|
||||||
|
standard_library.remove('symbol')
|
||||||
|
standard_library.remove('formatter')
|
||||||
|
|
||||||
# Remove tkinter and Easter eggs
|
# Remove tkinter and Easter eggs
|
||||||
excluded_modules = [
|
excluded_modules = [
|
||||||
'antigravity',
|
'antigravity',
|
||||||
@@ -265,7 +271,6 @@ excluded_modules = [
|
|||||||
def check_missing_modules(expected_modules):
|
def check_missing_modules(expected_modules):
|
||||||
missing = []
|
missing = []
|
||||||
for module in expected_modules:
|
for module in expected_modules:
|
||||||
print('Try to import module ', module)
|
|
||||||
try:
|
try:
|
||||||
importlib.import_module(module)
|
importlib.import_module(module)
|
||||||
except:
|
except:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user