openzim / python-libzim

Libzim binding for Python: read/write ZIM files in Python
https://pypi.org/project/libzim/
GNU General Public License v3.0
60 stars 19 forks source link

Better build system #165

Closed rgaudin closed 1 year ago

rgaudin commented 1 year ago

This introduce two changes:

The first one is independent but would require rewriting the tests and release workflows so given the second one is dependent on the first one, I bundled them in this PR.

Better builds

The build process is now completely integrated. No more separate downloading of libzim or tweaking of any kind.

python3 -m build

The main changes here are:

Using cibuildwheel

cibuildwheel is a pypa project that simplifies the creation of many per-platform wheels ; targeting common CI envs.

With a config file (inside out project.toml) we can specify all our targets and it will create all the wheels in a wheelhouse/ folder in a single command

Change of workflows

Test workflow

Rewritten to accommodate the build simplicity but is still running tests individually on various python versions on macos and linux.

Although it's tested in cibuildwheel, those tests are cheap and more verbose so it's more valuable.

Release workflow

Replaced with a wheels one that calls cibuildwheel. It creates all the wheels and stores them as artifact on Github. It also creates the sdist of course.

When run on a release, it uploads them all to PyPi.

Note that this awaits the aarch64-bionic and x86_64-bionic in nightlies to be merged

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (cd8766f) 93.12% compared to head (4054038) 93.12%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #165 +/- ## ======================================= Coverage 93.12% 93.12% ======================================= Files 1 1 Lines 480 480 ======================================= Hits 447 447 Misses 33 33 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.