From 7c641b0f83cd5416d8cf1cb717309373810b67e0 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Thu, 16 May 2024 22:25:48 -0700 Subject: [PATCH] avoid cibw shlex mess on Linux config_settings --- .github/workflows/ci.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e62bc675..a51e3f5b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -200,8 +200,6 @@ jobs: matrix: ${{ fromJSON(needs.make_linux_pyyaml_matrix.outputs.matrix_json) }} steps: -# - name: Checkout PyYAML -# uses: actions/checkout@v4 - name: fetch sdist artifact id: fetch_sdist uses: actions/download-artifact@v4 @@ -231,8 +229,6 @@ jobs: LD_LIBRARY_PATH=libyaml/src/.libs PYYAML_FORCE_CYTHON=1 PYYAML_FORCE_LIBYAML=1 - CIBW_CONFIG_SETTINGS: | - pyyaml_build_config={"force":1, "library_dirs": ["libyaml/src/.libs"], "include_dirs": ["libyaml/include"]} CIBW_TEST_COMMAND: cd {project}; pytest CIBW_TEST_REQUIRES: pytest run: | @@ -240,7 +236,17 @@ jobs: python3 -V python3 -m pip install -U --user ${{ matrix.cibw_version || 'cibuildwheel' }} - CIBW_BEFORE_BUILD="cp -r /host$(pwd)/libyaml {project} && ls -l {project}" python3 -m cibuildwheel --platform auto --output-dir ./dist ${{ steps.fetch_sdist.outputs.download-path }}/pyyaml*.tar.gz/pyyaml*.tar.gz + + mkdir pyyaml + + tar zxvf ${{ steps.fetch_sdist.outputs.download-path }}/pyyaml*.tar.gz/pyyaml*.tar.gz --strip-components=1 -C pyyaml + + cat << 'EOF' > build_config.toml + [tool.cibuildwheel.config-settings] + pyyaml_build_config='{"force":1, "library_dirs": ["libyaml/src/.libs"], "include_dirs": ["libyaml/include"]}' + EOF + + CIBW_BEFORE_BUILD="ls -l {project}" python3 -m cibuildwheel --config-file $(pwd)/build_config.toml --platform auto --output-dir ./dist ./pyyaml echo "artifact_name=$(ls ./dist/)" >> "$GITHUB_OUTPUT" # FIXME: ensure exactly one artifact