Skip to content

Commit

Permalink
feat: add ubuntu-24.04 (#269)
Browse files Browse the repository at this point in the history
* feat: add ubuntu-24.04

* chore: drop support for Python 2.x builds
  • Loading branch information
mayeut committed May 8, 2024
1 parent 7c3d29f commit eb9433f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-python-packages.yml
Expand Up @@ -15,7 +15,7 @@ on:
PLATFORMS:
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
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:
paths-ignore:
- 'versions-manifest.json'
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Generate execution matrix
id: generate-matrix
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 = @()
foreach ($configuration in $configurations) {
Expand Down
24 changes: 7 additions & 17 deletions builders/ubuntu-python-builder.psm1
Expand Up @@ -37,16 +37,9 @@ class UbuntuPythonBuilder : NixPythonBuilder {
$configureString += " --enable-shared"
$configureString += " --enable-optimizations"

### Compile with ucs4 for Python 2.x. On 3.x, ucs4 is enabled by default
if ($this.Version -lt "3.0.0") {
$configureString += " --enable-unicode=ucs4"
}

### Compile with support of loadable sqlite extensions. Unavailable for Python 2.*
### Compile with support of loadable sqlite extensions.
### 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 $configureString
Expand All @@ -60,17 +53,13 @@ class UbuntuPythonBuilder : NixPythonBuilder {
Prepare system environment by installing dependencies and required packages.
#>

if (($this.Version -gt "3.0.0") -and ($this.Version -lt "3.5.3")) {
Write-Host "Python3 versions lower than 3.5.3 are not supported"
if ($this.Version -lt "3.5.3") {
Write-Host "Python versions lower than 3.5.3 are not supported"
exit 1
}

### Compile with tkinter support
if ($this.Version -gt "3.0.0") {
$tkinterInstallString = "sudo apt-get install -y --allow-downgrades python3-tk tk-dev"
} else {
$tkinterInstallString = "sudo apt install -y python-tk tk-dev"
}
$tkinterInstallString = "sudo apt-get install -y --allow-downgrades python3-tk tk-dev"

Execute-Command -Command "sudo apt-get update"
Execute-Command -Command $tkinterInstallString
Expand All @@ -85,7 +74,8 @@ class UbuntuPythonBuilder : NixPythonBuilder {
"libsqlite3-dev",
"libncursesw5-dev",
"libreadline-dev",
"libgdbm-dev"
"libgdbm-dev",
"liblzma-dev"
) | ForEach-Object {
Execute-Command -Command "sudo apt install -y $_"
}
Expand Down

0 comments on commit eb9433f

Please sign in to comment.