Skip to content

Commit c403049

Browse files
author
Dmitry Shibanov
committed
add version compare
1 parent 6701f7c commit c403049

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/python-tests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ param (
77

88
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
99
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
10+
Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
1011

1112
function Analyze-MissingModules([string] $buildOutputLocation) {
1213
$searchStringStart = "Failed to build these modules:"
@@ -59,7 +60,8 @@ Describe "Tests" {
5960
}
6061

6162
It "Check if python configuration is correct" {
62-
"python ./sources/python-config-test.py $Version" | Should -ReturnZeroExitCode
63+
$nativeVersion = Convert-Version -version $Version
64+
"python ./sources/python-config-test.py $Version $nativeVersion" | Should -ReturnZeroExitCode
6365
}
6466

6567
It "Check if shared libraries are linked correctly" {

tests/sources/python-config-test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import distutils.sysconfig
2+
from distutils.version import StrictVersion
23
import sysconfig
34
import sys
45
import platform
@@ -7,6 +8,7 @@
78
# Define variables
89
os_type = platform.system()
910
version = sys.argv[1]
11+
nativeVersion = sys.argv[2]
1012

1113
lib_dir_path = sysconfig.get_config_var('LIBDIR')
1214
ld_library_name = sysconfig.get_config_var('LDLIBRARY')
@@ -41,7 +43,7 @@
4143
### Validate macOS
4244
if os_type == 'Darwin':
4345
### Validate openssl links
44-
if version < "3.7.0":
46+
if StrictVersion(nativeVersion) < StrictVersion("3.7.0"):
4547
expected_ldflags = '-L/usr/local/opt/[email protected]/lib'
4648
ldflags = sysconfig.get_config_var('LDFLAGS')
4749

0 commit comments

Comments
 (0)