-
Notifications
You must be signed in to change notification settings - Fork 105
131 lines (111 loc) · 3.79 KB
/
wheel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: PyPi wheel and sdist
on:
push:
branches:
- master
pull_request:
jobs:
sdist:
runs-on: ubuntu-latest
name: Python 3.11
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: x64
- name: Install test dependencies
run: pip install wheel flake8 pytest
- name: Flake8
# stop the build if there are Python syntax errors or undefined names
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
run: |
flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Generate source distribution
run: python setup.py sdist
- name: Install python-snappy sdist
run: pip install dist/python-snappy*.tar.gz
- name: Pytest
run: pytest --verbose test_snappy.py
- name: Archive sdist
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/python-snappy*.tar.gz
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-12, windows-2019]
architecture: ['x64']
linux_archs: ["auto s390x"]
include:
- os: windows-2019
architecture: 'x86'
skip: "*2*win* *win_amd64"
environment_windows: INCLUDE="C:/Program Files (x86)/Snappy/include" LIB="C:/Program Files (x86)/Snappy/lib"
- os: windows-2019
architecture: 'x64'
skip: "*2*win* *win32"
environment_windows: INCLUDE="C:/Program Files/Snappy/include" LIB="C:/Program Files/Snappy/lib"
- os: ubuntu-20.04
architecture: 'x64'
linux_archs: aarch64 ppc64le
name: Python ${{ matrix.os }}
env:
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "python -m pytest --verbose {project}/test_snappy.py"
CIBW_BEFORE_ALL_LINUX: yum install -y snappy-devel
MACOSX_DEPLOYMENT_TARGET: "10.9"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
CIBW_BEFORE_ALL: "bash {project}/build_snappy.sh"
CIBW_SKIP: ${{ matrix.skip }}
CIBW_ENVIRONMENT_WINDOWS: ${{ matrix.environment_windows }}
CIBW_ARCHS_LINUX: ${{ matrix.linux_archs }}
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: ${{ matrix.architecture }}
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Add msbuild to PATH
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.0.2
- name: delvewheel install
if: runner.os == 'Windows'
run: |
python -m pip install delvewheel==0.0.9
- name: Build wheels
run: |
python -m pip wheel -w ./wheelhouse .
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
name: wheels
upload:
runs-on: ubuntu-latest
name: upload wheels
needs: ['sdist', 'build']
if: startsWith(github.ref, 'refs/tags/0.')
steps:
- name: Download test data
uses: actions/download-artifact@v4.1.7
with:
name: wheels
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*.whl