Compare commits

..

14 Commits

Author SHA1 Message Date
aparnajyothi-y
00ec8cc1f2 Update build-python-packages.yml 2024-06-20 13:07:34 +05:30
aparnajyothi-y
1f0d27f0b5 Update build-python-packages.yml 2024-06-20 12:32:21 +05:30
aparnajyothi-y
dd0cf131ab Update build-python-packages.yml 2024-06-20 12:27:29 +05:30
aparnajyothi-y
a77c9e10d6 Update build-python-packages.yml 2024-06-20 12:10:15 +05:30
aparnajyothi-y
fc1f552d8d Update build-python-packages.yml 2024-06-20 10:27:52 +05:30
aparnajyothi-y
cd751e6cc2 Update build-python-packages.yml 2024-06-19 18:55:04 +05:30
aparnajyothi-y
fd01c577f2 Update build-python-packages.yml 2024-06-19 18:45:19 +05:30
aparnajyothi-y
f54bc21e32 Update build-python-packages.yml 2024-06-19 18:28:53 +05:30
aparnajyothi-y
a81c68e746 Update build-python-packages.yml 2024-06-19 17:58:44 +05:30
aparnajyothi-y
c2a676ee84 Update build-python-packages.yml 2024-06-19 15:57:45 +05:30
aparnajyothi-y
0e0d4ed87f Update build-python-packages.yml 2024-06-19 15:54:00 +05:30
aparnajyothi-y
011826ebf7 Update build-python-packages.yml 2024-06-19 15:45:17 +05:30
aparnajyothi-y
d443e40f97 Update build-python-packages.yml 2024-06-17 16:23:44 +05:30
aparnajyothi-y
dd61f119eb Update win-python-builder.psm1 2024-06-17 16:16:18 +05:30
7 changed files with 436 additions and 2465 deletions

View File

@@ -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-13_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' default: 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11_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,33 +39,29 @@ 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-13,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim() [String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim()
$matrix = @() $matrix = @()
foreach ($configuration in $configurations) { foreach ($configuration in $configurations) {
$parts = $configuration.Split("_") $parts = $configuration.Split("_")
$os = $parts[0] $os = $parts[0]
$arch = if ($parts[1]) {$parts[1]} else {"x64"} $arch = if ($parts[1]) {$parts[1]} else {"x64"}
switch -wildcard ($os) { switch -wildcard ($os) {
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux")} "*ubuntu*" { $platform = $os.Replace("ubuntu","linux")}
"*macos*" { $platform = 'darwin' } "*macos*" { $platform = 'darwin' }
"*windows*" { $platform = 'win32' } "*windows*" { $platform = 'win32' }
} }
if ($configuration -eq "ubuntu-22.04_arm64") { if ($configuration -eq "windows-2019_arm64") {
$os = "setup-actions-ubuntu-arm64-2-core"
}
elseif ($configuration -eq "ubuntu-24.04_arm64") {
$os = "setup-actions-ubuntu24-arm64-2-core"
}
elseif ($configuration -eq "windows-2019_arm64") {
$os = "setup-actions-windows-arm64-4-core" $os = "setup-actions-windows-arm64-4-core"
} }
$matrix += @{ $matrix += @{
'platform' = $platform 'platform' = $platform
'os' = $os 'os' = $os
'arch' = $arch 'arch' = $arch
} }
} }
echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT
@@ -80,44 +76,39 @@ jobs:
env: env:
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }} ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
steps: steps:
- name: Setup Environment on Windows ARM64 Runner - name: Setup Environment on Windows ARM64 Runner
if: matrix.os == 'setup-actions-windows-arm64-4-core' if: matrix.os == 'setup-actions-windows-arm64-4-core'
shell: powershell shell: powershell
run: | run: |
# Install Chocolatey # Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install PowerShell # Install PowerShell
choco install powershell-core -y choco install powershell-core -y
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install Git # Install Git
choco install git -y choco install git -y
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install 7-Zip # Install 7-Zip
choco install 7zip -y choco install 7zip -y
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Adding Symlink
if: matrix.os == 'macos-13'
run: ln -sf /usr/local/opt/tcl-tk@8 /usr/local/opt/tcl-tk
- name: Build Python ${{ env.VERSION }} - name: Build Python ${{ env.VERSION }}
run: | run: |
./builders/build-python.ps1 -Version $env:VERSION ` ./builders/build-python.ps1 -Version $env:VERSION `
-Platform ${{ matrix.platform }} -Architecture ${{ matrix.arch }} -Platform ${{ matrix.platform }} -Architecture ${{ matrix.arch }}
- name: Publish artifact - name: Publish artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@@ -135,29 +126,30 @@ jobs:
env: env:
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }} ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
steps: steps:
- name: Setup Environment on Windows ARM64 Runner - name: Setup Environment on Windows ARM64 Runner
if: matrix.os == 'setup-actions-windows-arm64-4-core' if: matrix.os == 'setup-actions-windows-arm64-4-core'
shell: powershell shell: powershell
run: | run: |
# Install Chocolatey # Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install PowerShell # Install PowerShell
choco install powershell-core -y choco install powershell-core -y
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install Git # Install Git
choco install git -y choco install git -y
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install 7-Zip # Install 7-Zip
choco install 7zip -y choco install 7zip -y
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -177,6 +169,7 @@ jobs:
name: ${{ env.ARTIFACT_NAME }} name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }} path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Extract files - name: Extract files
run: | run: |
if ('${{ matrix.platform }}' -eq 'win32') { if ('${{ matrix.platform }}' -eq 'win32') {
@@ -215,7 +208,6 @@ jobs:
run: | run: |
$pythonLocation = which python $pythonLocation = which python
if ('${{ matrix.platform }}' -eq 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation } if ('${{ matrix.platform }}' -eq 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation }
- name: Run tests - name: Run tests
run: | run: |
Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
@@ -250,7 +242,6 @@ jobs:
release_name: ${{ env.VERSION }} release_name: ${{ env.VERSION }}
body: | body: |
Python ${{ env.VERSION }} Python ${{ env.VERSION }}
- name: Generate hash for packages - name: Generate hash for packages
run: | run: |
$childItems = Get-Childitem -Path '.' $childItems = Get-Childitem -Path '.'

View File

@@ -13,5 +13,4 @@ jobs:
name: CodeQL analysis name: CodeQL analysis
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
with: with:
languages: '["python"]' languages: "['python']"

View File

@@ -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, macos-13] os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
python: [3.9.13, 3.10.11, 3.11.8, 3.12.7, 3.13.0] python: [3.9.13, 3.10.11, 3.11.8]
steps: steps:
- name: setup-python ${{ matrix.python }} - name: setup-python ${{ matrix.python }}
uses: actions/setup-python@v5 uses: actions/setup-python@v5

View File

@@ -68,10 +68,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/usr/local/opt/openssl@3/lib -L/usr/local/opt/zlib/lib" $env:LDFLAGS = "-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/zlib/lib"
$env:CFLAGS = "-I/usr/local/opt/openssl@3/include -I/usr/local/opt/zlib/include" $env:CFLAGS = "-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/zlib/include"
} else { } else {
$configureString += " --with-openssl=/usr/local/opt/openssl@3" $configureString += " --with-openssl=/usr/local/opt/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 and 3.7.3 we need to provide PATH for zlib to pack it properly. Otherwise the build will fail
# with the error: zipimport.ZipImportError: can't decompress data; zlib not available # with the error: zipimport.ZipImportError: can't decompress data; zlib not available
@@ -80,9 +80,9 @@ class macOSPythonBuilder : NixPythonBuilder {
$env:CFLAGS = "-I/usr/local/opt/zlib/include" $env:CFLAGS = "-I/usr/local/opt/zlib/include"
} }
# if ($this.Version -gt "3.7.12") { if ($this.Version -gt "3.7.12") {
$configureString += " --with-tcltk-includes='-I /usr/local/opt/tcl-tk/include/tcl-tk' --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'"
# } }
if ($this.Version -eq "3.7.17") { if ($this.Version -eq "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"

View File

@@ -64,6 +64,7 @@ class WinPythonBuilder : PythonBuilder {
$ArchitectureExtension = "-arm64" $ArchitectureExtension = "-arm64"
} }
return $ArchitectureExtension return $ArchitectureExtension
} }

View File

@@ -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@3/lib' expected_ldflags = '-L/usr/local/opt/openssl@1.1/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@3/include' expected_openssl_includes = '-I/usr/local/opt/openssl@1.1/include'
expected_openssl_ldflags ='-L/usr/local/opt/openssl@3/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')

File diff suppressed because it is too large Load Diff