Skip to content

Commit 73379f9

Browse files
Merge pull request actions#171 from akv-platform/v-sdolin/issue-402
Explicitly link brew tcl/tk
2 parents 8a2b258 + edcd32d commit 73379f9

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

builders/macos-python-builder.psm1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class macOSPythonBuilder : NixPythonBuilder {
5959
$env:CFLAGS = "-I/usr/local/opt/[email protected]/include -I/usr/local/opt/zlib/include"
6060
} else {
6161
$configureString += " --with-openssl=/usr/local/opt/[email protected]"
62+
if ($this.Version -gt "3.7.12") {
63+
$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'"
64+
}
6265
}
6366

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

tests/python-tests.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ Describe "Tests" {
4949
"python ./sources/simple-test.py" | Should -ReturnZeroExitCode
5050
}
5151

52+
# linux has no display name and no $DISPLAY environment variable - skip tk test
53+
if (-not (($Platform -match "ubuntu") -or ($Platform -match "linux"))) {
54+
It "Check if tcl/tk has the same headed and library versions" {
55+
"python ./sources/tcltk.py" | Should -ReturnZeroExitCode
56+
}
57+
}
58+
5259
if (($Version -ge "3.2.0") -and -not ([semver]"$($Version.Major).$($Version.Minor)" -eq [semver]"3.11" -and $Version.PreReleaseLabel)) {
5360
It "Check if sqlite3 module is installed" {
5461
"python ./sources/python-sqlite3.py" | Should -ReturnZeroExitCode

tests/sources/tcltk.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import tkinter
2+
import _tkinter
3+
4+
header = _tkinter.TK_VERSION
5+
lib = tkinter.Tk().getvar('tk_version')
6+
7+
if lib != header:
8+
print('header version=' + header)
9+
print('lib version=' + lib)
10+
exit(1)

0 commit comments

Comments
 (0)