Skip to content

Commit a8c5431

Browse files
authored
Rework CI/CD (#11)
* Stop using manylinux2014 image in cibuildwheel * add pyproject.toml * update version to 2.1.13 * add cythonize call to setup.py * fix cibuildwheel test command * streamline build and testing with less nonsense * rename workflow name * specify path to tests * fix paths for pytesting * disable Windows builds temporarily * replace test withs os.path.join to be OS agnostic and reenable Windows * fix typo * fix ANOTHER typo * fix ANOTHER typo * just skip the thing on windows and move on with life... * undo changes to cythonize * build uchardet so it's actually bundled with the linux build * run linux builds only for now * enable macos builds * remove ldconfig command * disable macos builds for now i guess
1 parent a622250 commit a8c5431

File tree

9 files changed

+79
-351
lines changed

9 files changed

+79
-351
lines changed

.github/workflows/build-and-upload-to-pypi.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
name: Build and upload to PyPI
1+
name: Build and test wheels
22

33
on:
4-
release:
5-
types:
6-
- published
4+
pull_request:
5+
branches:
6+
- 'master'
7+
push:
8+
branches:
9+
- 'master'
10+
release:
11+
types: [created]
12+
branches:
13+
- 'master'
714

815
jobs:
916
build_wheels:
1017
name: Build wheels on ${{ matrix.os }}
1118
runs-on: ${{ matrix.os }}
1219
strategy:
1320
matrix:
14-
os: [ubuntu-20.04, windows-2019, macos-11]
21+
os: [ubuntu-latest]
1522

1623
steps:
1724
- uses: actions/checkout@v3
@@ -28,22 +35,19 @@ jobs:
2835
with:
2936
platforms: all
3037

31-
- name: Build wheels
38+
- name: Build and test wheels
3239
uses: pypa/[email protected]
3340
env:
34-
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
35-
CIBW_ARCHS: auto64
3641
CIBW_ARCHS_LINUX: auto64 aarch64
37-
CIBW_BUILD: 'cp3*'
38-
CIBW_SKIP: '*-musllinux_*'
39-
CIBW_BEFORE_BUILD_WINDOWS: make pip
4042

4143
- uses: actions/upload-artifact@v3
44+
if: github.event_name == 'release' && github.event.action == 'created'
4245
with:
4346
path: ./wheelhouse/*.whl
4447

4548
build_sdist:
4649
name: Build source distribution
50+
if: github.event_name == 'release' && github.event.action == 'created'
4751
runs-on: ubuntu-latest
4852
steps:
4953
- uses: actions/checkout@v3

.github/workflows/test-darwin.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/workflows/test-linux.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/workflows/test-windows.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel", "cython", "pkgconfig"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.cibuildwheel]
6+
build-frontend = "build"
7+
build = "cp3*"
8+
skip = ["*-win32", "*-manylinux_i686", "*-musllinux_*"]
9+
archs = ["auto64"]
10+
test-requires = ['pytest']
11+
test-command = [
12+
'cd {project}',
13+
'python -m pytest {project}'
14+
]
15+
16+
before-build = [
17+
"git submodule sync --recursive",
18+
"git submodule update --init --force --recursive --depth=1",
19+
"test -d {project}/src/ext/uchardet/build || (cd {project}/src/ext/uchardet/ && mkdir build && cd build && cmake .. && make && make install)",
20+
]
21+
environment = {INCLUDE_PATH="/usr/local/include/uchardet", LIBRARY_PATH="/usr/local/lib64/"}
22+
23+
[tool.cibuildwheel.windows]
24+
before-build = [
25+
"git submodule sync --recursive",
26+
"git submodule update --init --force --recursive --depth=1",
27+
"make pip"
28+
]

0 commit comments

Comments
 (0)