Skip to content

Commit

Permalink
Rework CI/CD (#11)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wbarnha authored Dec 19, 2022
1 parent a622250 commit a8c5431
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 351 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/build-and-upload-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: Build and upload to PyPI
name: Build and test wheels

on:
release:
types:
- published
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
release:
types: [created]
branches:
- 'master'

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -28,22 +35,19 @@ jobs:
with:
platforms: all

- name: Build wheels
- name: Build and test wheels
uses: pypa/[email protected]
env:
CIBW_MANYLINUX_X86_64_IMAGE: 'manylinux2014'
CIBW_ARCHS: auto64
CIBW_ARCHS_LINUX: auto64 aarch64
CIBW_BUILD: 'cp3*'
CIBW_SKIP: '*-musllinux_*'
CIBW_BEFORE_BUILD_WINDOWS: make pip

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

build_sdist:
name: Build source distribution
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/test-darwin.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/test-linux.yml

This file was deleted.

101 changes: 0 additions & 101 deletions .github/workflows/test-windows.yml

This file was deleted.

28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[build-system]
requires = ["setuptools", "wheel", "cython", "pkgconfig"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
build-frontend = "build"
build = "cp3*"
skip = ["*-win32", "*-manylinux_i686", "*-musllinux_*"]
archs = ["auto64"]
test-requires = ['pytest']
test-command = [
'cd {project}',
'python -m pytest {project}'
]

before-build = [
"git submodule sync --recursive",
"git submodule update --init --force --recursive --depth=1",
"test -d {project}/src/ext/uchardet/build || (cd {project}/src/ext/uchardet/ && mkdir build && cd build && cmake .. && make && make install)",
]
environment = {INCLUDE_PATH="/usr/local/include/uchardet", LIBRARY_PATH="/usr/local/lib64/"}

[tool.cibuildwheel.windows]
before-build = [
"git submodule sync --recursive",
"git submodule update --init --force --recursive --depth=1",
"make pip"
]
Loading

0 comments on commit a8c5431

Please sign in to comment.