forked from intake/python-snappy
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (106 loc) · 3.6 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
name: PyPi wheel and sdist
on:
workflow_dispatch: {}
push:
branches:
- master
pull_request:
jobs:
sdist:
runs-on: ubuntu-latest
name: Python 3.11
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
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: Install libsnappy-dev
run: sudo apt-get install libsnappy-dev
- 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-11]
architecture: ['x64']
linux_archs: ["auto"]
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@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: ${{ matrix.architecture }}
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Build wheels
uses: joerick/cibuildwheel@v2.1.3
- 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@v1
with:
name: wheels
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*.whl