diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index 13063f3..6bf7ec8 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -11,6 +11,8 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then else export MACOSX_DEPLOYMENT_TARGET="10.10" fi + # Mac Pythons do not have toml parser by default. + python3 install tomli fi if [[ "$MB_PYTHON_VERSION" == pypy3* ]]; then @@ -20,14 +22,13 @@ fi echo "::group::Install a virtualenv" source multibuild/common_utils.sh source multibuild/travis_steps.sh - $PYTHON_EXE -m pip install virtualenv + python3 -m pip install virtualenv before_install echo "::endgroup::" echo "::group::Build wheel" export WHEEL_SDIR=wheelhouse - $PIP_CMD install tomlkit - export BUILD_DEPENDS=$($PYTHON_EXE ./print_deps.py ${MB_PYTHON_VERSION} ${REPO_DIR}) + export BUILD_DEPENDS=$(python3 ./print_deps.py ${MB_PYTHON_VERSION} ${REPO_DIR}) clean_code build_wheel ls -l "${GITHUB_WORKSPACE}/${WHEEL_SDIR}/" diff --git a/config.sh b/config.sh index 6e66d7d..c151663 100644 --- a/config.sh +++ b/config.sh @@ -1,11 +1,6 @@ # Define custom utilities # Test for OSX with [ -n "$IS_MACOS" ] -function pip_wheel_cmd { - local abs_wheelhouse=$1 - pip wheel $(pip_opts) -w $abs_wheelhouse --no-build-isolation --no-deps . -} - function run_tests { # Runs tests on installed distribution from an empty directory python --version diff --git a/print_deps.py b/print_deps.py index cd6b17b..51d7211 100755 --- a/print_deps.py +++ b/print_deps.py @@ -6,12 +6,15 @@ from pathlib import Path from argparse import ArgumentParser, RawDescriptionHelpFormatter -import tomlkit +try: + import tomllib as tlib +except ImportError: + import tomli as tlib def get_phase_requirements(repo_path, phase='build'): toml = (Path(repo_path) / 'pyproject.toml').read_text() - config = tomlkit.loads(toml) + config = tlib.loads(toml) if phase == 'build': requires = config.get('build-system', {}).get('requires', []) else: