Compare commits

...

3 Commits

Author SHA1 Message Date
Matthieu Darbois
eb9433f569 feat: add ubuntu-24.04 (#269)
* feat: add ubuntu-24.04

* chore: drop support for Python 2.x builds
2024-05-08 08:33:12 -05:00
Matthieu Darbois
7c3d29faf2 fix: use --upgrade rather than --ignore-installed to upgrade pip (#268)
* fix: use `--upgrade` rather than `--ignore-installed` to upgrade pip

This removes left over files when upgrading pip.

* remove all installed python on macOS
2024-05-08 08:32:38 -05:00
github-actions[bot]
c03f98f186 Update versions-manifest (#266)
Co-authored-by: Service account <no-reply@microsoft.com>
2024-04-29 09:49:41 -05:00
7 changed files with 57 additions and 34 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,macos-11_x64,macos-11_arm64,windows-2019_x64,windows-2019_x86' default: 'ubuntu-20.04,ubuntu-22.04,ubuntu-24.04,macos-11_x64,macos-11_arm64,windows-2019_x64,windows-2019_x86'
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,macos-11,macos-11_arm64,windows-2019_x64,windows-2019_x86' }}".Split(",").Trim() [String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-24.04,macos-11,macos-11_arm64,windows-2019_x64,windows-2019_x86' }}".Split(",").Trim()
$matrix = @() $matrix = @()
foreach ($configuration in $configurations) { foreach ($configuration in $configurations) {
@@ -105,6 +105,11 @@ jobs:
- name: Fully cleanup the toolcache directory before testing - name: Fully cleanup the toolcache directory before testing
run: ./helpers/clean-toolcache.ps1 -ToolName "Python" run: ./helpers/clean-toolcache.ps1 -ToolName "Python"
- name: Delete macOS /Library/Frameworks/Python.framework
if: matrix.platform == 'darwin'
shell: bash
run: if [ -d /Library/Frameworks/Python.framework ]; then sudo rm -rf /Library/Frameworks/Python.framework; fi
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:

View File

@@ -37,16 +37,9 @@ class UbuntuPythonBuilder : NixPythonBuilder {
$configureString += " --enable-shared" $configureString += " --enable-shared"
$configureString += " --enable-optimizations" $configureString += " --enable-optimizations"
### Compile with ucs4 for Python 2.x. On 3.x, ucs4 is enabled by default ### Compile with support of loadable sqlite extensions.
if ($this.Version -lt "3.0.0") {
$configureString += " --enable-unicode=ucs4"
}
### Compile with support of loadable sqlite extensions. Unavailable for Python 2.*
### Link to documentation (https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.enable_load_extension) ### Link to documentation (https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.enable_load_extension)
if ($this.Version -ge "3.2.0") { $configureString += " --enable-loadable-sqlite-extensions"
$configureString += " --enable-loadable-sqlite-extensions"
}
Write-Host "The passed configure options are: " Write-Host "The passed configure options are: "
Write-Host $configureString Write-Host $configureString
@@ -60,17 +53,13 @@ class UbuntuPythonBuilder : NixPythonBuilder {
Prepare system environment by installing dependencies and required packages. Prepare system environment by installing dependencies and required packages.
#> #>
if (($this.Version -gt "3.0.0") -and ($this.Version -lt "3.5.3")) { if ($this.Version -lt "3.5.3") {
Write-Host "Python3 versions lower than 3.5.3 are not supported" Write-Host "Python versions lower than 3.5.3 are not supported"
exit 1 exit 1
} }
### Compile with tkinter support ### Compile with tkinter support
if ($this.Version -gt "3.0.0") { $tkinterInstallString = "sudo apt-get install -y --allow-downgrades python3-tk tk-dev"
$tkinterInstallString = "sudo apt-get install -y --allow-downgrades python3-tk tk-dev"
} else {
$tkinterInstallString = "sudo apt install -y python-tk tk-dev"
}
Execute-Command -Command "sudo apt-get update" Execute-Command -Command "sudo apt-get update"
Execute-Command -Command $tkinterInstallString Execute-Command -Command $tkinterInstallString
@@ -85,7 +74,8 @@ class UbuntuPythonBuilder : NixPythonBuilder {
"libsqlite3-dev", "libsqlite3-dev",
"libncursesw5-dev", "libncursesw5-dev",
"libreadline-dev", "libreadline-dev",
"libgdbm-dev" "libgdbm-dev",
"liblzma-dev"
) | ForEach-Object { ) | ForEach-Object {
Execute-Command -Command "sudo apt install -y $_" Execute-Command -Command "sudo apt install -y $_"
} }

View File

@@ -71,7 +71,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJOR_MINOR pyt
echo "Upgrading pip..." echo "Upgrading pip..."
export PIP_ROOT_USER_ACTION=ignore export PIP_ROOT_USER_ACTION=ignore
./python -m ensurepip ./python -m ensurepip
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location ./python -m pip install --upgrade pip --disable-pip-version-check --no-warn-script-location
echo "Install OpenSSL certificates" echo "Install OpenSSL certificates"
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command" sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"

View File

@@ -51,7 +51,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth
echo "Upgrading pip..." echo "Upgrading pip..."
export PIP_ROOT_USER_ACTION=ignore export PIP_ROOT_USER_ACTION=ignore
./python -m ensurepip ./python -m ensurepip
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location ./python -m pip install --upgrade pip --disable-pip-version-check --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

View File

@@ -103,4 +103,8 @@ Describe "Tests" {
It "Check urlopen with HTTPS works" { It "Check urlopen with HTTPS works" {
"python ./sources/python-urlopen-https.py" | Should -ReturnZeroExitCode "python ./sources/python-urlopen-https.py" | Should -ReturnZeroExitCode
} }
It "Check a single dist-info per distribution is present" {
"python ./sources/dist-info.py" | Should -ReturnZeroExitCode
}
} }

View File

@@ -0,0 +1,24 @@
import glob
import os.path
import sysconfig
from collections import defaultdict
def check_dist_info():
paths = set([sysconfig.get_path("purelib"), sysconfig.get_path("platlib")])
versions = defaultdict(list)
for path in paths:
pattern = os.path.join(path, "*.dist-info")
for dist_info in glob.glob(pattern):
name = os.path.basename(dist_info).split("-", maxsplit=1)[0]
versions[name].append(dist_info)
exit_code = 0
for name in versions:
if len(versions[name]) > 1:
print("multiple dist-info found for {}: {}".format(name, versions[name]))
exit_code = 1
exit(exit_code)
if __name__ == "__main__":
check_dist_info()

View File

@@ -3500,45 +3500,45 @@
{ {
"version": "3.9.13", "version": "3.9.13",
"stable": true, "stable": true,
"release_url": "https://github.com/actions/python-versions/releases/tag/3.9.13-8833805153", "release_url": "https://github.com/actions/python-versions/releases/tag/3.9.13-8879985561",
"files": [ "files": [
{ {
"filename": "python-3.9.13-darwin-arm64.tar.gz", "filename": "python-3.9.13-darwin-arm64.tar.gz",
"arch": "arm64", "arch": "arm64",
"platform": "darwin", "platform": "darwin",
"download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8833805153/python-3.9.13-darwin-arm64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8879985561/python-3.9.13-darwin-arm64.tar.gz"
}, },
{ {
"filename": "python-3.9.13-darwin-x64.tar.gz", "filename": "python-3.9.13-darwin-x64.tar.gz",
"arch": "x64", "arch": "x64",
"platform": "darwin", "platform": "darwin",
"download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8833805153/python-3.9.13-darwin-x64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8879985561/python-3.9.13-darwin-x64.tar.gz"
}, },
{ {
"filename": "python-3.9.13-linux-20.04-x64.tar.gz", "filename": "python-3.9.13-linux-20.04-x64.tar.gz",
"arch": "x64", "arch": "x64",
"platform": "linux", "platform": "linux",
"platform_version": "20.04", "platform_version": "20.04",
"download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8833805153/python-3.9.13-linux-20.04-x64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8879985561/python-3.9.13-linux-20.04-x64.tar.gz"
}, },
{ {
"filename": "python-3.9.13-linux-22.04-x64.tar.gz", "filename": "python-3.9.13-linux-22.04-x64.tar.gz",
"arch": "x64", "arch": "x64",
"platform": "linux", "platform": "linux",
"platform_version": "22.04", "platform_version": "22.04",
"download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8833805153/python-3.9.13-linux-22.04-x64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8879985561/python-3.9.13-linux-22.04-x64.tar.gz"
}, },
{ {
"filename": "python-3.9.13-win32-x64.zip", "filename": "python-3.9.13-win32-x64.zip",
"arch": "x64", "arch": "x64",
"platform": "win32", "platform": "win32",
"download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8833805153/python-3.9.13-win32-x64.zip" "download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8879985561/python-3.9.13-win32-x64.zip"
}, },
{ {
"filename": "python-3.9.13-win32-x86.zip", "filename": "python-3.9.13-win32-x86.zip",
"arch": "x86", "arch": "x86",
"platform": "win32", "platform": "win32",
"download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8833805153/python-3.9.13-win32-x86.zip" "download_url": "https://github.com/actions/python-versions/releases/download/3.9.13-8879985561/python-3.9.13-win32-x86.zip"
} }
] ]
}, },
@@ -4628,38 +4628,38 @@
{ {
"version": "3.8.10", "version": "3.8.10",
"stable": true, "stable": true,
"release_url": "https://github.com/actions/python-versions/releases/tag/3.8.10-8833490298", "release_url": "https://github.com/actions/python-versions/releases/tag/3.8.10-8879978422",
"files": [ "files": [
{ {
"filename": "python-3.8.10-darwin-arm64.tar.gz", "filename": "python-3.8.10-darwin-arm64.tar.gz",
"arch": "arm64", "arch": "arm64",
"platform": "darwin", "platform": "darwin",
"download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8833490298/python-3.8.10-darwin-arm64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8879978422/python-3.8.10-darwin-arm64.tar.gz"
}, },
{ {
"filename": "python-3.8.10-darwin-x64.tar.gz", "filename": "python-3.8.10-darwin-x64.tar.gz",
"arch": "x64", "arch": "x64",
"platform": "darwin", "platform": "darwin",
"download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8833490298/python-3.8.10-darwin-x64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8879978422/python-3.8.10-darwin-x64.tar.gz"
}, },
{ {
"filename": "python-3.8.10-linux-20.04-x64.tar.gz", "filename": "python-3.8.10-linux-20.04-x64.tar.gz",
"arch": "x64", "arch": "x64",
"platform": "linux", "platform": "linux",
"platform_version": "20.04", "platform_version": "20.04",
"download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8833490298/python-3.8.10-linux-20.04-x64.tar.gz" "download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8879978422/python-3.8.10-linux-20.04-x64.tar.gz"
}, },
{ {
"filename": "python-3.8.10-win32-x64.zip", "filename": "python-3.8.10-win32-x64.zip",
"arch": "x64", "arch": "x64",
"platform": "win32", "platform": "win32",
"download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8833490298/python-3.8.10-win32-x64.zip" "download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8879978422/python-3.8.10-win32-x64.zip"
}, },
{ {
"filename": "python-3.8.10-win32-x86.zip", "filename": "python-3.8.10-win32-x86.zip",
"arch": "x86", "arch": "x86",
"platform": "win32", "platform": "win32",
"download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8833490298/python-3.8.10-win32-x86.zip" "download_url": "https://github.com/actions/python-versions/releases/download/3.8.10-8879978422/python-3.8.10-win32-x86.zip"
} }
] ]
}, },