Skip to content

Commit

Permalink
Use Python 3.8 as base version
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Oct 23, 2024
1 parent 684d6f8 commit c7f7906
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 41 deletions.
26 changes: 1 addition & 25 deletions builders/macos-python-builder.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ class macOSPythonBuilder : NixPythonBuilder {
.SYNOPSIS
Prepare system environment by installing dependencies and required packages.
#>

if ($this.Version -eq "3.7.17") {
# We have preinstalled ncurses and readLine on the hoster runners. But we need to install bzip2 for
# setting up an environemnt
# If we get any issues realted to ncurses or readline we can try to run this command
# brew install ncurses readline
Execute-Command -Command "brew install bzip2"
}
}

[void] Configure() {
Expand Down Expand Up @@ -68,23 +60,7 @@ class macOSPythonBuilder : NixPythonBuilder {
### 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)
$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
# 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") {
$env:LDFLAGS = "-L/usr/local/opt/zlib/lib"
$env:CFLAGS = "-I/usr/local/opt/zlib/include"
}

if ($this.Version -gt "3.7.12") {
$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") {
$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"
}

$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 += " --enable-loadable-sqlite-extensions"
$env:LDFLAGS += " -L$(brew --prefix sqlite3)/lib"
$env:CFLAGS += " -I$(brew --prefix sqlite3)/include"
Expand Down
10 changes: 0 additions & 10 deletions tests/python-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,6 @@ Describe "Tests" {
}
}

# 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" -and $Version.Major -ne "2") {
It "Validate Pyinstaller" {
"pip install pyinstaller" | Should -ReturnZeroExitCode
"pyinstaller --onefile ./sources/simple-test.py" | Should -ReturnZeroExitCode
$distPath = [IO.Path]::Combine($pwd, "dist", "simple-test")
"$distPath" | Should -ReturnZeroExitCode
}
}

It "Check urlopen with HTTPS works" {
"python ./sources/python-urlopen-https.py" | Should -ReturnZeroExitCode
}
Expand Down
7 changes: 1 addition & 6 deletions tests/sources/python-modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import importlib
import sys

# The Python standard library as of Python 3.7
# The Python standard library as of Python 3.8
standard_library = [
'abc',
'aifc',
Expand Down Expand Up @@ -90,7 +90,6 @@
'locale',
'logging',
'lzma',
'macpath',
'mailbox',
'mailcap',
'mimetypes',
Expand Down Expand Up @@ -199,10 +198,6 @@

# Add new modules
# See https://docs.python.org/3/whatsnew/index.html
# 'macpath' module has been removed from Python 3.8
if sys.version_info > (3, 7):
standard_library.remove('macpath')

# 'dummy_threading' module has been removed from Python 3.9
if sys.version_info > (3, 8):
standard_library.remove('dummy_threading')
Expand Down

0 comments on commit c7f7906

Please sign in to comment.