Commit 8605156c authored by Rob Buckley's avatar Rob Buckley
Browse files

add test of installed cpython distutils tag

parent 077c066f
...@@ -22,8 +22,10 @@ then ...@@ -22,8 +22,10 @@ then
fi fi
python_mm="${cpython_version:0:1}.${cpython_version:2:1}" python_mm="${cpython_version:0:1}.${cpython_version:2:1}"
# Remove implementation prefix # extract implementation prefix and version
if [[ "$PYTHON_VERSION" =~ (pypy-)?([0-9\.]+) ]]; then if [[ "$PYTHON_VERSION" =~ (pypy-)?([0-9\.]+) ]]; then
_impl=${BASH_REMATCH[1]:-"cp"}
requested_impl=${_impl:0:2}
requested_version=${BASH_REMATCH[2]} requested_version=${BASH_REMATCH[2]}
else else
ingest "Error parsing PYTHON_VERSION=$PYTHON_VERSION" ingest "Error parsing PYTHON_VERSION=$PYTHON_VERSION"
...@@ -58,3 +60,18 @@ else # not virtualenv ...@@ -58,3 +60,18 @@ else # not virtualenv
ingest "Wrong macpython pip '$PIP_CMD'" ingest "Wrong macpython pip '$PIP_CMD'"
fi fi
fi fi
# for cpython, check macos version and arch are as expected
distutils_plat=$($PYTHON_EXE -c "import distutils.util; print(distutils.util.get_platform())")
echo "Python cmd archs: $(lipo -info $(which $PYTHON_EXE))"
if [[ $requested_impl = 'cp' ]]; then
echo "Cpython, checking platform..."
expected_tag="macosx-${MB_PYTHON_OSX_VER}-$(mac_cpython_arch_for_osx_ver)"
if ! [[ $distutils_plat == $expected_tag ]]; then
ingest "Wrong Python platform tag: ${distutils_plat}!=${expected_tag}"
fi
elif [[ $requested_impl = 'py' ]]; then
echo "Pypy, skipping platform check..."
else
ingest "Invalid impl: '${requested_impl}', expecting 'cp' or 'py'"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment