the-virtual-brain / tvb-gdist

Geodesic Library (adaptation by TVB Team)
Other
48 stars 30 forks source link

add wheels building actions #75

Closed maedoc closed 1 year ago

maedoc commented 1 year ago

This tries to resolve some installation woes by prebuilding wheels for all platforms using https://github.com/pypa/cibuildwheel

codecov[bot] commented 1 year ago

Codecov Report

Merging #75 (1961676) into trunk (f52307a) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 1961676 differs from pull request most recent head e0d7b60. Consider uploading reports for the commit e0d7b60 to get more accurate results

@@           Coverage Diff           @@
##            trunk      #75   +/-   ##
=======================================
  Coverage   75.31%   75.31%           
=======================================
  Files           9        9           
  Lines        1203     1203           
=======================================
  Hits          906      906           
  Misses        297      297           
Flag Coverage Δ
cpp 73.74% <ø> (ø)
python 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

maedoc commented 1 year ago

The resulting artifact was a zip file with these wheels inside

% ls -lh
total 52680
-rw-rw-r--@ 1 duke  staff    92K Dec  7 14:46 tvb_gdist-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff   708K Dec  7 16:23 tvb_gdist-2.1.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff   722K Dec  7 16:23 tvb_gdist-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp310-cp310-musllinux_1_1_i686.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
-rw-rw-r--@ 1 duke  staff    74K Dec  7 14:46 tvb_gdist-2.1.0-cp310-cp310-win32.whl
-rw-rw-r--@ 1 duke  staff    83K Dec  7 14:46 tvb_gdist-2.1.0-cp310-cp310-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    93K Dec  7 14:46 tvb_gdist-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff   717K Dec  7 16:23 tvb_gdist-2.1.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff   735K Dec  7 16:23 tvb_gdist-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff   1.3M Dec  7 16:23 tvb_gdist-2.1.0-cp311-cp311-musllinux_1_1_i686.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
-rw-rw-r--@ 1 duke  staff    74K Dec  7 14:46 tvb_gdist-2.1.0-cp311-cp311-win32.whl
-rw-rw-r--@ 1 duke  staff    83K Dec  7 14:46 tvb_gdist-2.1.0-cp311-cp311-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    93K Dec  7 14:46 tvb_gdist-2.1.0-cp36-cp36m-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff   694K Dec  7 16:23 tvb_gdist-2.1.0-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff   710K Dec  7 16:23 tvb_gdist-2.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp36-cp36m-musllinux_1_1_i686.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl
-rw-rw-r--@ 1 duke  staff    77K Dec  7 14:46 tvb_gdist-2.1.0-cp36-cp36m-win32.whl
-rw-rw-r--@ 1 duke  staff    87K Dec  7 14:46 tvb_gdist-2.1.0-cp36-cp36m-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    94K Dec  7 14:46 tvb_gdist-2.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff   695K Dec  7 16:23 tvb_gdist-2.1.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff   711K Dec  7 16:23 tvb_gdist-2.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp37-cp37m-musllinux_1_1_i686.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl
-rw-rw-r--@ 1 duke  staff    74K Dec  7 14:46 tvb_gdist-2.1.0-cp37-cp37m-win32.whl
-rw-rw-r--@ 1 duke  staff    83K Dec  7 14:46 tvb_gdist-2.1.0-cp37-cp37m-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    93K Dec  7 14:46 tvb_gdist-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff   713K Dec  7 16:23 tvb_gdist-2.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff   726K Dec  7 16:23 tvb_gdist-2.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff   1.3M Dec  7 16:23 tvb_gdist-2.1.0-cp38-cp38-musllinux_1_1_i686.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
-rw-rw-r--@ 1 duke  staff    75K Dec  7 14:46 tvb_gdist-2.1.0-cp38-cp38-win32.whl
-rw-rw-r--@ 1 duke  staff    84K Dec  7 14:46 tvb_gdist-2.1.0-cp38-cp38-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    94K Dec  7 14:46 tvb_gdist-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff   715K Dec  7 16:23 tvb_gdist-2.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff   727K Dec  7 16:23 tvb_gdist-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp39-cp39-musllinux_1_1_i686.whl
-rw-rw-r--@ 1 duke  staff   1.2M Dec  7 16:23 tvb_gdist-2.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
-rw-rw-r--@ 1 duke  staff    75K Dec  7 14:46 tvb_gdist-2.1.0-cp39-cp39-win32.whl
-rw-rw-r--@ 1 duke  staff    84K Dec  7 14:46 tvb_gdist-2.1.0-cp39-cp39-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    81K Dec  7 14:46 tvb_gdist-2.1.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff    96K Dec  7 16:23 tvb_gdist-2.1.0-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff    89K Dec  7 16:23 tvb_gdist-2.1.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff    79K Dec  7 14:46 tvb_gdist-2.1.0-pp37-pypy37_pp73-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    81K Dec  7 14:46 tvb_gdist-2.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff    95K Dec  7 16:23 tvb_gdist-2.1.0-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff    88K Dec  7 16:23 tvb_gdist-2.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff    79K Dec  7 14:46 tvb_gdist-2.1.0-pp38-pypy38_pp73-win_amd64.whl
-rw-rw-r--@ 1 duke  staff    80K Dec  7 14:46 tvb_gdist-2.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
-rw-rw-r--@ 1 duke  staff    95K Dec  7 16:23 tvb_gdist-2.1.0-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
-rw-rw-r--@ 1 duke  staff    89K Dec  7 16:23 tvb_gdist-2.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
-rw-rw-r--@ 1 duke  staff    79K Dec  7 14:46 tvb_gdist-2.1.0-pp39-pypy39_pp73-win_amd64.whl

No arm64 for macOS unfortunately, even though the action readme says it's supported.

maedoc commented 1 year ago

after build reduction we have just these wheels

% for os in linux macos win; do echo ${os}; for v in 36 37 38 39 310 311; do echo CPython v${v};  ls tvb_gdist*${v}*${os}*.whl; done; done
linux
CPython v36
tvb_gdist-2.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
CPython v37
tvb_gdist-2.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
CPython v38
tvb_gdist-2.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
CPython v39
tvb_gdist-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
CPython v310
tvb_gdist-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
CPython v311
tvb_gdist-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
macos
CPython v36
tvb_gdist-2.1.0-cp36-cp36m-macosx_10_9_x86_64.whl
CPython v37
tvb_gdist-2.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
CPython v38
tvb_gdist-2.1.0-cp38-cp38-macosx_10_9_x86_64.whl    tvb_gdist-2.1.0-cp38-cp38-macosx_11_0_arm64.whl
CPython v39
tvb_gdist-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl    tvb_gdist-2.1.0-cp39-cp39-macosx_11_0_arm64.whl
CPython v310
tvb_gdist-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl  tvb_gdist-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
CPython v311
tvb_gdist-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl  tvb_gdist-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
win
CPython v36
tvb_gdist-2.1.0-cp36-cp36m-win_amd64.whl
CPython v37
tvb_gdist-2.1.0-cp37-cp37m-win_amd64.whl
CPython v38
tvb_gdist-2.1.0-cp38-cp38-win_amd64.whl
CPython v39
tvb_gdist-2.1.0-cp39-cp39-win_amd64.whl
CPython v310
tvb_gdist-2.1.0-cp310-cp310-win_amd64.whl
CPython v311
tvb_gdist-2.1.0-cp311-cp311-win_amd64.whl

which covers everything we support I think, and I'm able to use the macos arm64 locally.

@liadomide wdyt about pushing these wheels to PyPI?

maedoc commented 1 year ago

Just as PoC I switched the package name (just in this branch) to gdist which is a package on my PyPI account, pushed a tag and all the wheels show up on PyPI:

https://pypi.org/project/gdist/2.1.0/#files

In my opinion this is the easiest way to ensure no one has to build gdist ever again :D

liadomide commented 1 year ago

The result looks very good!! Should we revert the temporary change regarding the package name and merge ? We need to put tvb user's token in the settings of this repo, right ?

maedoc commented 1 year ago

That was an idea but before doing so I wanted to make sure an external user can’t inadvertently push code via PR which would end up in an official pypi tvb-gdist package. With the gdist name it is low risk to test.

maedoc commented 1 year ago

Alternatively we keep the cibuildwheel and push by hand to pypi.

liadomide commented 1 year ago

@maedoc Would it be ok if we take over to test, document and finalise this?

maedoc commented 1 year ago

yes of course, I didn't have time to finish. thanks!