🔧 fix CI.yml sdist error #146
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is autogenerated by maturin v1.2.3 | |
# To update, run | |
# | |
# maturin generate-ci github | |
# | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
workflow_dispatch: | |
pull_request: | |
permissions: | |
contents: read | |
concurrency: | |
group: ci-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: pip install pre-commit | |
name: Install pre-commit | |
- run: pre-commit run --all | |
name: Run pre-commit checks | |
test: | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, macos-13, windows-latest] | |
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10'] | |
exclude: | |
# circumvent wierd issue with qh3.asyncio+windows+proactor loop... | |
- python_version: pypy-3.9 | |
os: windows-latest | |
- python_version: pypy-3.10 | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
allow-prereleases: true | |
- name: Setup dependencies | |
run: pip install --upgrade pip pytest | |
- name: Set up Clang (Linux) | |
if: matrix.os == 'ubuntu-22.04' | |
run: sudo apt-get install clang | |
- name: Set up Clang (Cygwin) | |
if: matrix.os == 'windows-latest' | |
run: choco install llvm -y | |
- uses: ilammy/setup-nasm@v1 | |
if: matrix.os == 'windows-latest' | |
- name: Build wheels (Unix, Linux) | |
if: matrix.os != 'windows-latest' | |
uses: PyO3/maturin-action@v1 | |
with: | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: auto | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get upgrade -y || echo "no apt support" | |
sudo apt-get install -y libclang libclang-dev || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
yum install -y llvm-toolset-7-clang || echo "not yum based" | |
source /opt/rh/llvm-toolset-7/enable || echo "not yum based" | |
- name: Build wheels (NT) | |
if: matrix.os == 'windows-latest' | |
uses: PyO3/maturin-action@v1.42.1 | |
with: | |
args: --release --out dist | |
sccache: 'true' | |
target: x64 | |
- run: pip install --find-links=./dist qh3 | |
name: Install built package | |
- name: Disable firewall and configure compiler | |
if: matrix.os == 'macos-latest' | |
run: | | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off | |
echo "AIOQUIC_SKIP_TESTS=chacha20" >> $GITHUB_ENV | |
- name: Ensure test target (NT) | |
if: matrix.os == 'windows-latest' | |
run: Remove-Item -Path qh3 -Force -Recurse | |
- name: Ensure test target (Linux, Unix) | |
if: matrix.os != 'windows-latest' | |
run: rm -fR qh3 | |
- run: python -m pip install -r dev-requirements.txt | |
name: Install dev requirements | |
- run: python -m unittest discover -v | |
name: Run tests | |
linux: | |
runs-on: ubuntu-22.04 | |
needs: | |
- test | |
- lint | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ x86_64, s390x, aarch64, armv7l, ppc64le, ppc64 ] | |
python_version: [ '3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ] | |
manylinux: [ 'manylinux2014', 'musllinux_1_1' ] | |
exclude: | |
- manylinux: musllinux_1_1 | |
target: s390x | |
- manylinux: musllinux_1_1 | |
target: ppc64 | |
- manylinux: musllinux_1_1 | |
target: ppc64le | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Build wheels (no workarounds) | |
if: matrix.target == 'x86_64' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib wget || echo "no apt support" | |
sudo wget https://git.alpinelinux.org/aports/plain/main/bsd-compat-headers/queue.h -O /usr/local/musl/bin/../x86_64-unknown-linux-musl/include/sys/queue.h || echo "compat fail" | |
yum install -y llvm-toolset-7-clang || echo "not yum based" | |
source /opt/rh/llvm-toolset-7/enable || echo "not yum based" | |
- name: Build wheels (aarch64+musl workaround) | |
if: matrix.target == 'aarch64' && matrix.manylinux == 'musllinux_1_1' | |
uses: PyO3/maturin-action@v1 | |
env: | |
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8" | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib wget || echo "no apt support" | |
sudo wget https://git.alpinelinux.org/aports/plain/main/bsd-compat-headers/queue.h -O /usr/local/musl/bin/../aarch64-unknown-linux-musl/include/sys/queue.h || echo "compat fail" | |
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/local/musl/bin/../aarch64-unknown-linux-musl/" | |
- name: Build wheels (aarch64+manylinux2014 workaround) | |
if: matrix.target == 'aarch64' && matrix.manylinux == 'manylinux2014' | |
uses: PyO3/maturin-action@v1 | |
env: | |
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8" | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib || echo "no apt support" | |
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot" | |
- name: Build wheels (s390x+manylinux2014 workaround) | |
if: matrix.target == 's390x' && matrix.manylinux == 'manylinux2014' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib || echo "no apt support" | |
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/s390x-ibm-linux-gnu/s390x-ibm-linux-gnu/sysroot" | |
- name: Build wheels (ppc64le+manylinux2014 workaround) | |
if: matrix.target == 'ppc64le' && matrix.manylinux == 'manylinux2014' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib || echo "no apt support" | |
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot" | |
wget https://gist.githubusercontent.com/Ousret/2e7a58fc2baf773f6e38e78963e8985f/raw/05a99d92817473ae5cf8360b8df3f85f47d0a12a/elf.h -O /usr/powerpc64le-unknown-linux-gnu/powerpc64le-unknown-linux-gnu/sysroot/usr/include/elf.h | |
- name: Build wheels (ppc64+manylinux2014 workaround) | |
if: matrix.target == 'ppc64' && matrix.manylinux == 'manylinux2014' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib || echo "no apt support" | |
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/powerpc64-unknown-linux-gnu/powerpc64-unknown-linux-gnu/sysroot" | |
- name: Build wheels (armv7l+manylinux workaround) | |
if: matrix.target == 'armv7l' && matrix.manylinux == 'manylinux2014' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib wget || echo "no apt support" | |
wget https://gist.githubusercontent.com/Ousret/2e7a58fc2baf773f6e38e78963e8985f/raw/05a99d92817473ae5cf8360b8df3f85f47d0a12a/elf.h -O /usr/armv7-unknown-linux-gnueabihf/armv7-unknown-linux-gnueabihf/sysroot/usr/include/elf.h | |
- name: Build wheels (armv7l+musl workaround) | |
if: matrix.target == 'armv7l' && matrix.manylinux == 'musllinux_1_1' | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
manylinux: ${{ matrix.manylinux }} | |
before-script-linux: | | |
sudo apt-get update || echo "no apt support" | |
sudo apt-get install -y libclang || echo "no apt support" | |
sudo apt-get install -y libc6 || echo "no apt support" | |
sudo apt-get install -y libc6-dev || echo "no apt support" | |
sudo apt-get install -y libclang-dev || echo "no apt support" | |
sudo apt-get install -y clang || echo "no apt support" | |
sudo apt-get install -y linux-headers-generic || echo "no apt support" | |
sudo apt-get install -y gcc-multilib wget || echo "no apt support" | |
sudo wget https://git.alpinelinux.org/aports/plain/main/bsd-compat-headers/queue.h -O /usr/local/musl/armv7-unknown-linux-musleabihf/include/sys/queue.h || echo "compat fail" | |
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/local/musl/armv7-unknown-linux-musleabihf" | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
windows: | |
needs: | |
- test | |
- lint | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ x64, aarch64 ] | |
python_version: [ '3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ] | |
exclude: | |
- target: aarch64 | |
python_version: pypy-3.7 | |
- target: aarch64 | |
python_version: pypy-3.8 | |
- target: aarch64 | |
python_version: pypy-3.9 | |
- target: aarch64 | |
python_version: pypy-3.10 | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
architecture: x64 | |
- uses: ilammy/setup-nasm@v1 | |
- name: Set up Clang (Cygwin) | |
run: choco install llvm -y | |
- name: Add Ninja (aarch64 build requirement) | |
if: matrix.target == 'aarch64' | |
run: choco install ninja -y | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
env: | |
XWIN_VERSION: 16 # fix for "no cab file specified by MSI" ...? | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
needs: | |
- test | |
- lint | |
runs-on: macos-13 | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ x86_64, aarch64, universal2 ] | |
python_version: [ '3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ] | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --interpreter ${{ matrix.python_version }} | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
sdist: | |
needs: | |
- test | |
- lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
checksum: | |
name: compute hashes | |
runs-on: ubuntu-22.04 | |
needs: [windows, macos, linux, sdist] | |
if: "startsWith(github.ref, 'refs/tags/')" | |
outputs: | |
hashes: ${{ steps.compute.outputs.hashes }} | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: Download distributions | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: wheels | |
path: dist | |
- name: Collected dists | |
run: | | |
tree dist | |
- name: Generate hashes | |
id: compute # needs.checksum.outputs.hashes | |
working-directory: ./dist | |
run: echo "hashes=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT | |
provenance: | |
needs: checksum | |
if: "startsWith(github.ref, 'refs/tags/')" | |
uses: "slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0" | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
with: | |
base64-subjects: ${{ needs.checksum.outputs.hashes }} | |
upload-assets: true | |
compile-generator: true | |
release: | |
name: release | |
runs-on: ubuntu-22.04 | |
if: "startsWith(github.ref, 'refs/tags/')" | |
needs: provenance | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1.42.1 | |
with: | |
command: upload | |
args: --non-interactive --skip-existing * |