diff --git a/.github/actions/dynamatrix/action.yml b/.github/actions/dynamatrix/action.yml new file mode 100644 index 00000000..11eef3bb --- /dev/null +++ b/.github/actions/dynamatrix/action.yml @@ -0,0 +1,22 @@ +name: Create matrix +description: Create matrix +inputs: + matrix_yaml: + description: input yaml matrix as multiline string; any entry with a bool true `omit` key will be filtered from the output matrix + required: true +outputs: + matrix_json: + description: filtered matrix as JSON + value: ${{ steps.matrix_gen.outputs.matrix_json }} + +runs: + using: "composite" + + steps: + - id: matrix_gen + run: | + # FIXME: input sanity check to prevent shell injection + python3 $GITHUB_ACTION_PATH/matrix_yaml_to_json.py --from-stdin << EOF + ${{ inputs.matrix_yaml }} + EOF + shell: bash diff --git a/.github/actions/dynamatrix/matrix_yaml_to_json.py b/.github/actions/dynamatrix/matrix_yaml_to_json.py new file mode 100644 index 00000000..f6f7e776 --- /dev/null +++ b/.github/actions/dynamatrix/matrix_yaml_to_json.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +import argparse +import json +import os +import pathlib +import sys +import typing as t +import yaml + +from collections.abc import MutableMapping, Sequence + +skipped_entries = [] + +def _filter_omit_entries(value): + if isinstance(value, MutableMapping): + if (omit_value := value.pop('omit', ...)) is not ...: + if omit_value is True: + print(f'omitting {value} from matrix') + skipped_entries.append(value) + return ... + + return {k: v for k, v in ((k, _filter_omit_entries(v)) for k, v in value.items()) if v is not ...} + + if isinstance(value, str): + return value + + if isinstance(value, Sequence): + return [v for v in (_filter_omit_entries(v) for v in value) if v is not ...] + + return value + +def main(): + p = argparse.ArgumentParser(description='GHA YAML matrix filter') + required_grp = p.add_mutually_exclusive_group(required=True) + required_grp.add_argument('--from-stdin', action='store_true', help='read input YAML from stdin') + required_grp.add_argument('--from-file', type=pathlib.Path, help='read input YAML from file path') + + args = p.parse_args() + + path: pathlib.Path | None + + matrix_yaml: str + + if path := args.from_file: + matrix_yaml = path.read_text() + elif args.from_stdin: + matrix_yaml = sys.stdin.read() + else: + raise Exception('no source provided for matrix yaml') + + raw_matrix = yaml.safe_load(matrix_yaml) + filtered_matrix = _filter_omit_entries(raw_matrix) + + output_matrix_json = json.dumps(filtered_matrix) + output_skipped_matrix_json = json.dumps(skipped_entries) + + print(f'filtered matrix: {output_matrix_json}') + print(f'skipped entries: {output_skipped_matrix_json}') + + if (gh_output := os.environ.get('GITHUB_OUTPUT')): + print('setting step output var matrix_json; skipped_matrix_json...') + with pathlib.Path(gh_output).open('a') as env_fd: + env_fd.write(f'matrix_json<<__MATRIX_EOF\n{output_matrix_json}\n__MATRIX_EOF\n') + env_fd.write(f'skipped_matrix_json<<__MATRIX_EOF\n{output_skipped_matrix_json}\n__MATRIX_EOF\n') + else: + print("GITHUB_OUTPUT not set; skipping variable output") + + +if __name__ == '__main__': + main() diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 783f0800..027a355a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,57 +10,60 @@ on: env: LIBYAML_REPO: https://github.com/yaml/libyaml LIBYAML_REF: 0.2.5 + skip_ci_redundant_jobs: ${{ github.event_name == 'pull_request' }} + skip_slow_jobs: ${{ github.event_name == 'pull_request' }} + skip_artifact_upload: ${{ github.event_name == 'pull_request' }} jobs: - python_sdist: - name: pyyaml sdist - runs-on: ubuntu-22.04 - steps: - - name: Checkout PyYAML - uses: actions/checkout@v3 - - - name: Install a python - uses: actions/setup-python@v4 - with: - python-version: 3.x - - - name: Build sdist - env: - PYYAML_FORCE_CYTHON: 1 - PYYAML_FORCE_LIBYAML: 0 - run: | - python -V - python -m pip install build - - python -m build . - - # Ensure exactly one artifact was produced. - [[ $(shopt -s nullglob; ls dist/*.tar.gz | wc -w) == 1 ]] || { - echo "Unexpected content in dist dir: '$(ls dist/*.tar.gz)'." - exit 1 - } - - - name: Test sdist - run: | - # Install some libyaml headers. - # TODO Should we smoke test the sdist against the libyaml we built? - sudo apt update - sudo apt install libyaml-dev -y - - # Ensure Cython is not present so we use only what's in the sdist. - python -m pip uninstall Cython -y || true - - # Pass no extra args. - # We should auto-install with libyaml since it's present. - python -m pip install dist/*.tar.gz -v - - python packaging/build/smoketest.py - - - name: Upload sdist artifact - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/*.tar.gz +# python_sdist: +# name: pyyaml sdist +# runs-on: ubuntu-22.04 +# steps: +# - name: Checkout PyYAML +# uses: actions/checkout@v3 +# +# - name: Install a python +# uses: actions/setup-python@v4 +# with: +# python-version: 3.x +# +# - name: Build sdist +# env: +# PYYAML_FORCE_CYTHON: 1 +# PYYAML_FORCE_LIBYAML: 0 +# run: | +# python -V +# python -m pip install build +# +# python -m build . +# +# # Ensure exactly one artifact was produced. +# [[ $(shopt -s nullglob; ls dist/*.tar.gz | wc -w) == 1 ]] || { +# echo "Unexpected content in dist dir: '$(ls dist/*.tar.gz)'." +# exit 1 +# } +# +# - name: Test sdist +# run: | +# # Install some libyaml headers. +# # TODO Should we smoke test the sdist against the libyaml we built? +# sudo apt update +# sudo apt install libyaml-dev -y +# +# # Ensure Cython is not present so we use only what's in the sdist. +# python -m pip uninstall Cython -y || true +# +# # Pass no extra args. +# # We should auto-install with libyaml since it's present. +# python -m pip install dist/*.tar.gz -v +# +# python packaging/build/smoketest.py +# +# - name: Upload sdist artifact +# uses: actions/upload-artifact@v3 +# with: +# name: dist +# path: dist/*.tar.gz linux_libyaml: @@ -69,12 +72,10 @@ jobs: strategy: matrix: cfg: -# - { platform: manylinux1, arch: x86_64 } + - { platform: manylinux1, arch: x86_64 } - { platform: manylinux2014, arch: x86_64 } - { platform: manylinux2014, arch: aarch64 } - { platform: manylinux2014, arch: s390x } -# - { platform: manylinux2_28, arch: x86_64 } -# - { platform: manylinux2_28, arch: aarch64 } - { platform: musllinux_1_1, arch: x86_64 } env: DOCKER_IMAGE: quay.io/pypa/${{matrix.cfg.platform}}_${{matrix.cfg.arch}} @@ -110,38 +111,51 @@ jobs: sudo chmod -R a+r ./libyaml/ if: steps.cached_libyaml.outputs.cache-hit != 'true' + make_linux_pyyaml_matrix: + runs-on: ubuntu-22.04 + outputs: + matrix_json: ${{ steps.make_matrix.outputs.matrix_json }} + steps: + - uses: actions/checkout@v4 + - name: make a matrix + id: make_matrix + uses: ./.github/actions/dynamatrix + with: + matrix_yaml: | + include: + - { platform: manylinux1, arch: x86_64, spec: cp38, omit: ${{ env.skip_ci_redundant_jobs }} } + - { platform: manylinux1, arch: x86_64, spec: cp39, omit: ${{ env.skip_ci_redundant_jobs }} } + - { platform: manylinux2014, arch: x86_64, spec: cp310, omit: ${{ env.skip_ci_redundant_jobs }} } + - { platform: manylinux2014, arch: x86_64, spec: cp311, omit: ${{ env.skip_ci_redundant_jobs }} } + - { platform: manylinux2014, arch: x86_64, spec: cp312, omit: ${{ env.skip_ci_redundant_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip", omit: ${{ env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp38, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp39, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp310, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp311, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp312, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: aarch64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip", omit: ${{ env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: s390x, spec: cp38, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: s390x, spec: cp39, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: s390x, spec: cp310, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: s390x, spec: cp311, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: s390x, spec: cp312, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: manylinux2014, arch: s390x, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip", omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: musllinux_1_1, arch: x86_64, spec: cp38, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: musllinux_1_1, arch: x86_64, spec: cp39, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: musllinux_1_1, arch: x86_64, spec: cp310, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: musllinux_1_1, arch: x86_64, spec: cp311, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: musllinux_1_1, arch: x86_64, spec: cp312, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + - { platform: musllinux_1_1, arch: x86_64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip", omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} } + linux_pyyaml: - needs: linux_libyaml + needs: [linux_libyaml, make_linux_pyyaml_matrix] name: pyyaml ${{matrix.arch}} ${{matrix.platform}} ${{matrix.spec}} runs-on: ubuntu-22.04 strategy: - matrix: - include: -# - { platform: manylinux1, arch: x86_64, spec: cp38 } -# - { platform: manylinux1, arch: x86_64, spec: cp39 } -# - { platform: manylinux2014, arch: x86_64, spec: cp310 } -# - { platform: manylinux2014, arch: x86_64, spec: cp311 } -# - { platform: manylinux2014, arch: x86_64, spec: cp312 } - - { platform: manylinux2014, arch: aarch64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip" } -# - { platform: manylinux2014, arch: aarch64, spec: cp38 } -# - { platform: manylinux2014, arch: aarch64, spec: cp39 } -# - { platform: manylinux2014, arch: aarch64, spec: cp310 } -# - { platform: manylinux2014, arch: aarch64, spec: cp311 } -# - { platform: manylinux2014, arch: aarch64, spec: cp312 } - - { platform: manylinux2014, arch: aarch64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip" } -# - { platform: manylinux2014, arch: s390x, spec: cp38 } -# - { platform: manylinux2014, arch: s390x, spec: cp39 } -# - { platform: manylinux2014, arch: s390x, spec: cp310 } -# - { platform: manylinux2014, arch: s390x, spec: cp311 } -# - { platform: manylinux2014, arch: s390x, spec: cp312 } - - { platform: manylinux2014, arch: s390x, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip" } -# - { platform: musllinux_1_1, arch: x86_64, spec: cp38 } -# - { platform: musllinux_1_1, arch: x86_64, spec: cp39 } -# - { platform: musllinux_1_1, arch: x86_64, spec: cp310 } -# - { platform: musllinux_1_1, arch: x86_64, spec: cp311 } -# - { platform: musllinux_1_1, arch: x86_64, spec: cp312 } - - { platform: musllinux_1_1, arch: x86_64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip" } + fail-fast: false + matrix: ${{ fromJSON(needs.make_linux_matrix.outputs.matrix_json) }} steps: - name: Checkout PyYAML @@ -186,278 +200,291 @@ jobs: name: dist path: dist/*.whl if-no-files-found: error - - macos_libyaml: - name: libyaml macos ${{matrix.arch}} - strategy: - matrix: - include: - - arch: x86_64 - runs-on: macos-13 - - arch: arm64 - deployment_target: '11.0' - run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} - defaults: - run: - shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} - runs-on: ${{ matrix.runs_on || 'macos-14' }} - steps: - - name: Check cached libyaml state - id: cached_libyaml - uses: actions/cache@v3 - with: - path: libyaml - key: libyaml_macos_${{matrix.arch}}_${{env.LIBYAML_REF}} - - - name: Checkout PyYAML - uses: actions/checkout@v3 - if: steps.cached_libyaml.outputs.cache-hit != 'true' - - - name: Build libyaml - env: - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target || '10.9' }} - SDKROOT: ${{ matrix.sdkroot || 'macosx' }} - run: | - set -eux - brew install automake coreutils m4 - bash ./packaging/build/libyaml.sh - echo "finished artifact arch is $(lipo -archs libyaml/src/.libs/libyaml.a)" - if: steps.cached_libyaml.outputs.cache-hit != 'true' - - - macos_pyyaml: - needs: macos_libyaml - name: pyyaml ${{ matrix.spec }} - runs-on: ${{ matrix.runs_on || 'macos-14' }} - defaults: - run: - shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} - strategy: - matrix: - include: - - spec: cp38-macosx_x86_64 - cibw_version: cibuildwheel==2.11.1 - runs_on: [macos-13] - - spec: cp39-macosx_x86_64 - runs_on: [macos-13] -# - spec: cp310-macosx_x86_64 +# +# macos_libyaml: +# name: libyaml macos ${{matrix.arch}} +# strategy: +# matrix: +# include: +# - arch: x86_64 +# runs-on: macos-13 +# - arch: arm64 +# deployment_target: '11.0' +# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} +# defaults: +# run: +# shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} +# runs-on: ${{ matrix.runs_on || 'macos-14' }} +# steps: +# - name: Check cached libyaml state +# id: cached_libyaml +# uses: actions/cache@v3 +# with: +# path: libyaml +# key: libyaml_macos_${{matrix.arch}}_${{env.LIBYAML_REF}} +# +# - name: Checkout PyYAML +# uses: actions/checkout@v3 +# if: steps.cached_libyaml.outputs.cache-hit != 'true' +# +# - name: Build libyaml +# env: +# MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target || '10.9' }} +# SDKROOT: ${{ matrix.sdkroot || 'macosx' }} +# run: | +# set -eux +# brew install automake coreutils m4 +# bash ./packaging/build/libyaml.sh +# echo "finished artifact arch is $(lipo -archs libyaml/src/.libs/libyaml.a)" +# if: steps.cached_libyaml.outputs.cache-hit != 'true' +# +# +# macos_pyyaml: +# needs: macos_libyaml +# name: pyyaml ${{ matrix.spec }} +# runs-on: ${{ matrix.runs_on || 'macos-14' }} +# defaults: +# run: +# shell: ${{ matrix.run_wrapper || 'bash --noprofile --norc -eo pipefail {0}' }} +# strategy: +# matrix: +# include: +# - spec: cp38-macosx_x86_64 +# cibw_version: cibuildwheel==2.11.1 # runs_on: [macos-13] -# - spec: cp311-macosx_x86_64 +# - spec: cp39-macosx_x86_64 # runs_on: [macos-13] -# - spec: cp312-macosx_x86_64 +## - spec: cp310-macosx_x86_64 +## runs_on: [macos-13] +## - spec: cp311-macosx_x86_64 +## runs_on: [macos-13] +## - spec: cp312-macosx_x86_64 +## runs_on: [macos-13] +# - spec: cp313-macosx_x86_64 +# cibw_version: https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip # runs_on: [macos-13] - - spec: cp313-macosx_x86_64 - cibw_version: https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip - runs_on: [macos-13] - - # build for arm64 under a hacked macOS 12 self-hosted x86_64-on-arm64 runner until arm64 is fully supported - - spec: cp39-macosx_arm64 - deployment_target: '11.0' - arch: arm64 - run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} - - - spec: cp310-macosx_arm64 - deployment_target: '11.0' - arch: arm64 - run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} - - - spec: cp311-macosx_arm64 - deployment_target: '11.0' - arch: arm64 - run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} - - - spec: cp312-macosx_arm64 - deployment_target: '11.0' - arch: arm64 - run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} - - - spec: cp313-macosx_arm64 - deployment_target: '11.0' - arch: arm64 - run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} - cibw_version: https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip - - steps: - - name: Checkout PyYAML - uses: actions/checkout@v3 - - - name: Get cached libyaml state - id: cached_libyaml - uses: actions/cache/restore@v3 - with: - path: libyaml - key: libyaml_macos_${{ matrix.arch || 'x86_64' }}_${{env.LIBYAML_REF}} - fail-on-cache-miss: true - - - name: Build/Test/Package - env: - C_INCLUDE_PATH: libyaml/include - CIBW_BUILD: ${{matrix.spec}} - CIBW_BUILD_VERBOSITY: 1 - CIBW_TEST_COMMAND: cd {project}; pytest - CIBW_TEST_REQUIRES: pytest - LIBRARY_PATH: libyaml/src/.libs - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target || '10.9' }} - PYYAML_FORCE_CYTHON: 1 - PYYAML_FORCE_LIBYAML: 1 - SDKROOT: ${{ matrix.sdkroot || 'macosx' }} - run: | - python3 -V - python3 -m pip install -U --user ${{ matrix.cibw_version || 'cibuildwheel' }} - python3 -m cibuildwheel --platform auto --output-dir dist . - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/*.whl - if-no-files-found: error - - windows_libyaml: - name: libyaml ${{matrix.platform}} ${{matrix.arch}} - runs-on: ${{matrix.platform}} - strategy: - matrix: - include: - - platform: windows-2022 - arch: x64 - - platform: windows-2022 - arch: win32 - steps: - - name: Get cached libyaml state - id: cached_libyaml - uses: actions/cache@v3 - with: - path: libyaml - key: libyaml_${{matrix.platform}}_${{matrix.arch}}_${{env.LIBYAML_REF}} - - - name: Build libyaml - shell: bash - if: steps.cached_libyaml.outputs.cache-hit != 'true' - run: | - # git spews all over stderr unless we tell it not to - export GIT_REDIRECT_STDERR="2>&1" - - if [[ ! -d ./libyaml ]]; then - git clone -b ${{ env.LIBYAML_REF }} ${{ env.LIBYAML_REPO }} 2>&1 - fi - - pushd libyaml - git clean -fdx - popd - - mkdir libyaml/build - - pushd libyaml/build - cmake.exe -G "Visual Studio 16 2019" -A ${{ matrix.arch }} -DYAML_STATIC_LIB_NAME=yaml .. - cmake.exe --build . --config Release - popd - - - windows_pyyaml: - needs: windows_libyaml - name: pyyaml ${{ matrix.platform }} ${{matrix.python_arch}} ${{matrix.spec}} - runs-on: ${{matrix.platform}} - strategy: - matrix: - include: - - platform: windows-2022 - build_arch: x64 - python_arch: x64 - spec: 3.8 +# +# # build for arm64 under a hacked macOS 12 self-hosted x86_64-on-arm64 runner until arm64 is fully supported +# - spec: cp39-macosx_arm64 +# deployment_target: '11.0' +# arch: arm64 +# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} +# +# - spec: cp310-macosx_arm64 +# deployment_target: '11.0' +# arch: arm64 +# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} +# +# - spec: cp311-macosx_arm64 +# deployment_target: '11.0' +# arch: arm64 +# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} +# +# - spec: cp312-macosx_arm64 +# deployment_target: '11.0' +# arch: arm64 +# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} +# +# - spec: cp313-macosx_arm64 +# deployment_target: '11.0' +# arch: arm64 +# run_wrapper: arch -arm64 bash --noprofile --norc -eo pipefail {0} +# cibw_version: https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip +# +# steps: +# - name: Checkout PyYAML +# uses: actions/checkout@v3 +# +# - name: Get cached libyaml state +# id: cached_libyaml +# uses: actions/cache/restore@v3 +# with: +# path: libyaml +# key: libyaml_macos_${{ matrix.arch || 'x86_64' }}_${{env.LIBYAML_REF}} +# fail-on-cache-miss: true +# +# - name: Build/Test/Package +# env: +# C_INCLUDE_PATH: libyaml/include +# CIBW_BUILD: ${{matrix.spec}} +# CIBW_BUILD_VERBOSITY: 1 +# CIBW_TEST_COMMAND: cd {project}; pytest +# CIBW_TEST_REQUIRES: pytest +# LIBRARY_PATH: libyaml/src/.libs +# MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target || '10.9' }} +# PYYAML_FORCE_CYTHON: 1 +# PYYAML_FORCE_LIBYAML: 1 +# SDKROOT: ${{ matrix.sdkroot || 'macosx' }} +# run: | +# python3 -V +# python3 -m pip install -U --user ${{ matrix.cibw_version || 'cibuildwheel' }} +# python3 -m cibuildwheel --platform auto --output-dir dist . +# +# - name: Upload artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: dist +# path: dist/*.whl +# if-no-files-found: error +# +# windows_libyaml: +# name: libyaml ${{matrix.platform}} ${{matrix.arch}} +# runs-on: ${{matrix.platform}} +# strategy: +# matrix: +# include: # - platform: windows-2022 -# build_arch: x64 -# python_arch: x64 -# spec: 3.9 +# arch: x64 # - platform: windows-2022 -# build_arch: x64 -# python_arch: x64 -# spec: '3.10' +# arch: win32 +# steps: +# - name: Get cached libyaml state +# id: cached_libyaml +# uses: actions/cache@v3 +# with: +# path: libyaml +# key: libyaml_${{matrix.platform}}_${{matrix.arch}}_${{env.LIBYAML_REF}} +# +# - name: Build libyaml +# shell: bash +# if: steps.cached_libyaml.outputs.cache-hit != 'true' +# run: | +# # git spews all over stderr unless we tell it not to +# export GIT_REDIRECT_STDERR="2>&1" +# +# if [[ ! -d ./libyaml ]]; then +# git clone -b ${{ env.LIBYAML_REF }} ${{ env.LIBYAML_REPO }} 2>&1 +# fi +# +# pushd libyaml +# git clean -fdx +# popd +# +# mkdir libyaml/build +# +# pushd libyaml/build +# cmake.exe -G "Visual Studio 16 2019" -A ${{ matrix.arch }} -DYAML_STATIC_LIB_NAME=yaml .. +# cmake.exe --build . --config Release +# popd +# +# +# windows_pyyaml: +# needs: windows_libyaml +# name: pyyaml ${{ matrix.platform }} ${{matrix.python_arch}} ${{matrix.spec}} +# runs-on: ${{matrix.platform}} +# strategy: +# matrix: +# include: # - platform: windows-2022 # build_arch: x64 # python_arch: x64 -# spec: '3.11' +# spec: 3.8 +## - platform: windows-2022 +## build_arch: x64 +## python_arch: x64 +## spec: 3.9 +## - platform: windows-2022 +## build_arch: x64 +## python_arch: x64 +## spec: '3.10' +## - platform: windows-2022 +## build_arch: x64 +## python_arch: x64 +## spec: '3.11' +## - platform: windows-2022 +## build_arch: x64 +## python_arch: x64 +## spec: '3.12' # - platform: windows-2022 # build_arch: x64 # python_arch: x64 -# spec: '3.12' - - platform: windows-2022 - build_arch: x64 - python_arch: x64 - spec: '3.13' - - platform: windows-2022 - build_arch: win32 - python_arch: x86 - spec: 3.8 +# spec: '3.13' # - platform: windows-2022 # build_arch: win32 # python_arch: x86 -# spec: 3.9 +# spec: 3.8 +## - platform: windows-2022 +## build_arch: win32 +## python_arch: x86 +## spec: 3.9 +## - platform: windows-2022 +## build_arch: win32 +## python_arch: x86 +## spec: '3.10' +## - platform: windows-2022 +## build_arch: win32 +## python_arch: x86 +## spec: '3.11' +## - platform: windows-2022 +## build_arch: win32 +## python_arch: x86 +## spec: '3.12' # - platform: windows-2022 # build_arch: win32 # python_arch: x86 -# spec: '3.10' -# - platform: windows-2022 -# build_arch: win32 -# python_arch: x86 -# spec: '3.11' -# - platform: windows-2022 -# build_arch: win32 -# python_arch: x86 -# spec: '3.12' - - platform: windows-2022 - build_arch: win32 - python_arch: x86 - spec: '3.13' - steps: - # autocrlf screws up tests under Windows - - name: Set git to use LF - run: | - git config --global core.autocrlf false - git config --global core.eol lf - - - name: Checkout pyyaml - uses: actions/checkout@v3 - - - name: Get cached libyaml state - id: cached_libyaml - uses: actions/cache/restore@v3 - with: - path: libyaml - key: libyaml_${{matrix.platform}}_${{matrix.build_arch}}_${{env.LIBYAML_REF}} - fail-on-cache-miss: true - - - name: Install python ${{ matrix.spec }} - uses: actions/setup-python@v4 - with: - architecture: ${{ matrix.python_arch }} - python-version: ${{ matrix.spec }} - - - name: Build/Test/Package - env: - PYYAML_FORCE_CYTHON: 1 - PYYAML_FORCE_LIBYAML: 1 - shell: bash - run: | - set -eux - python -V - python -m pip install "Cython<3.0" setuptools wheel - - python setup.py \ - --with-libyaml build_ext \ - -I libyaml/include \ - -L libyaml/build/Release \ - -D YAML_DECLARE_STATIC \ - build bdist_wheel - - # run tests on built wheel - python -m pip install dist/*.whl pytest - python -I -m pytest - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/*.whl - if-no-files-found: error +# spec: '3.13' +# steps: +# # autocrlf screws up tests under Windows +# - name: Set git to use LF +# run: | +# git config --global core.autocrlf false +# git config --global core.eol lf +# +# - name: Checkout pyyaml +# uses: actions/checkout@v3 +# +# - name: Get cached libyaml state +# id: cached_libyaml +# uses: actions/cache/restore@v3 +# with: +# path: libyaml +# key: libyaml_${{matrix.platform}}_${{matrix.build_arch}}_${{env.LIBYAML_REF}} +# fail-on-cache-miss: true +# +# - name: Install python ${{ matrix.spec }} +# uses: actions/setup-python@v4 +# with: +# architecture: ${{ matrix.python_arch }} +# python-version: ${{ matrix.spec }} +# +# - name: Build/Test/Package +# env: +# PYYAML_FORCE_CYTHON: 1 +# PYYAML_FORCE_LIBYAML: 1 +# shell: bash +# run: | +# set -eux +# python -V +# python -m pip install "Cython<3.0" setuptools wheel +# +# python setup.py \ +# --with-libyaml build_ext \ +# -I libyaml/include \ +# -L libyaml/build/Release \ +# -D YAML_DECLARE_STATIC \ +# build bdist_wheel +# +# # run tests on built wheel +# python -m pip install dist/*.whl pytest +# python -I -m pytest +# +# - name: Upload artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: dist +# path: dist/*.whl +# if-no-files-found: error +# check: +# if: always() +# needs: +# - sdist +# - linux +# - macos +# - windows +# runs-on: ubuntu-latest +# steps: +# - name: Verify all previous jobs succeeded (provides a single check to sample for gating purposes) +# uses: re-actors/alls-green@release/v1 +# with: +# jobs: ${{ toJSON(needs) }} ...