Skip to content

Commit da5596f

Browse files
committed
use sysconfig to determine the macos platform tag
1 parent b223a12 commit da5596f

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

e2e/common.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ source .tox/e2e/bin/activate
2929
# Set a variable to constrain packages used in the tests
3030
export FROMAGER_CONSTRAINTS_FILE="${SCRIPTDIR}/constraints.txt"
3131

32+
OS=$(uname)
33+
if [ "$OS" = "Darwin" ]; then
34+
NETWORK_ISOLATION=""
35+
# The tag comes back as something like "macosx-10.9-universal2" but the
36+
# filename contains "macosx_10_9_universal2".
37+
WHEEL_PLATFORM_TAG=$(python3 -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_"))')
38+
HAS_ELFDEP="0"
39+
else
40+
NETWORK_ISOLATION="--network-isolation"
41+
WHEEL_PLATFORM_TAG="linux_x86_64"
42+
HAS_ELFDEP="1"
43+
fi
44+
export NETWORK_ISOLATION
45+
export WHEEL_PLATFORM_TAG
46+
export HAS_ELFDEP
47+
3248
# Local web server management
3349
HTTP_SERVER_PID=""
3450
on_exit() {

e2e/test_elfdeps.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ source "$SCRIPTDIR/common.sh"
1111
DIST="MarkupSafe"
1212
VERSION="2.1.5"
1313

14-
OS=$(uname)
15-
if [ "$OS" = "Darwin" ]; then
16-
NETWORK_ISOLATION=""
17-
WHEEL_PLATFORM_TAG="macosx_10_9_universal2"
18-
HAS_ELFDEP="0"
19-
else
20-
NETWORK_ISOLATION="--network-isolation"
21-
WHEEL_PLATFORM_TAG="linux_x86_64"
22-
HAS_ELFDEP="1"
23-
fi
24-
2514
# Bootstrap the test project
2615
fromager \
2716
$NETWORK_ISOLATION \

e2e/test_rust_vendor.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ source "$SCRIPTDIR/common.sh"
1212
DIST="maturin"
1313
VERSION="1.6.0"
1414

15-
OS=$(uname)
16-
if [ "$OS" = "Darwin" ]; then
17-
NETWORK_ISOLATION=""
18-
WHEEL_PLATFORM_TAG="macosx_10_9_universal2"
19-
else
20-
NETWORK_ISOLATION="--network-isolation"
21-
WHEEL_PLATFORM_TAG="linux_x86_64"
22-
fi
23-
2415
# Bootstrap the test project
2516
fromager \
2617
$NETWORK_ISOLATION \

0 commit comments

Comments
 (0)