Skip to content

Commit c1cf5de

Browse files
Fix for python 3.7.17 macOS (actions#236)
1 parent 5a451d6 commit c1cf5de

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

builders/macos-python-builder.psm1

+14-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ class macOSPythonBuilder : NixPythonBuilder {
3131
.SYNOPSIS
3232
Prepare system environment by installing dependencies and required packages.
3333
#>
34+
35+
if ($this.Version -eq "3.7.17") {
36+
# We have preinstalled ncurses and readLine on the hoster runners. But we need to install bzip2 for
37+
# setting up an environemnt
38+
# If we get any issues realted to ncurses or readline we can try to run this command
39+
# brew install ncurses readline
40+
Execute-Command -Command "brew install bzip2"
41+
}
3442
}
3543

3644
[void] Configure() {
@@ -74,7 +82,12 @@ class macOSPythonBuilder : NixPythonBuilder {
7482

7583
if ($this.Version -gt "3.7.12") {
7684
$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'"
77-
}
85+
}
86+
87+
if ($this.Version -eq "3.7.17") {
88+
$env:LDFLAGS += " -L$(brew --prefix bzip2)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix ncurses)/lib"
89+
$env:CFLAGS += " -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(brew --prefix ncurses)/include"
90+
}
7891
}
7992

8093
### Compile with support of loadable sqlite extensions. Unavailable for Python 2.*

tests/sources/python-modules.py

-5
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,6 @@ def replace(lst, old, new):
248248
'dataclasses',
249249
])
250250

251-
if (sys.version_info.major, sys.version_info.minor, sys.version_info.micro) == (3, 7, 17):
252-
standard_library.remove('bz2')
253-
standard_library.remove('curses')
254-
standard_library.remove('readline')
255-
256251
# 'macpath' module has been removed from Python 3.8
257252
if sys.version_info > (3, 7):
258253
standard_library.remove('macpath')

0 commit comments

Comments
 (0)