lark-parser / lark_cython

Cython plugin for Lark, reimplementing the LALR parser & lexer for better performance
MIT License
45 stars 5 forks source link

Add support for building wheels on CI #3

Closed Erotemic closed 2 years ago

Erotemic commented 2 years ago

I found out that only the source is published to pypi and not the wheels. It shouldn't be too difficult to get cibuildwheel working on this repo and then publishing those to pypi. It will also close #2

Erotemic commented 2 years ago

This works on my machine. I can also add some code to help with automated deployment to pypi, but I'll need you to setup the appropriate secrets (namely a pypi token) in the project secrets for this repo.

erezsh commented 2 years ago

Nice!

I hope we can merge it soon.

Automated deployment sounds nice too! You can open a new PR for it.

erezsh commented 2 years ago

P.S. maybe the 3.10 needs to be quoted?

Erotemic commented 2 years ago

Latest push passes on my account's CI: https://github.com/Erotemic/lark_cython/actions/runs/2720236779

It builds the following wheels for CPython and PyPy on Windows (32 and 64), Manylinux (32 and 64), MuslLinux (32 and 64), and OSX. No ARM unfortunately, not sure how to do that.

lark_cython-0.0.11-cp310-cp310-macosx_10_9_x86_64.whl
lark_cython-0.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-cp310-cp310-musllinux_1_1_i686.whl
lark_cython-0.0.11-cp310-cp310-musllinux_1_1_x86_64.whl
lark_cython-0.0.11-cp310-cp310-win_amd64.whl
lark_cython-0.0.11-cp310-cp310-win32.whl
lark_cython-0.0.11-cp36-cp36m-macosx_10_9_x86_64.whl
lark_cython-0.0.11-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-cp36-cp36m-musllinux_1_1_i686.whl
lark_cython-0.0.11-cp36-cp36m-musllinux_1_1_x86_64.whl
lark_cython-0.0.11-cp36-cp36m-win_amd64.whl
lark_cython-0.0.11-cp36-cp36m-win32.whl
lark_cython-0.0.11-cp37-cp37m-macosx_10_9_x86_64.whl
lark_cython-0.0.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-cp37-cp37m-musllinux_1_1_i686.whl
lark_cython-0.0.11-cp37-cp37m-musllinux_1_1_x86_64.whl
lark_cython-0.0.11-cp37-cp37m-win_amd64.whl
lark_cython-0.0.11-cp37-cp37m-win32.whl
lark_cython-0.0.11-cp38-cp38-macosx_10_9_x86_64.whl
lark_cython-0.0.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-cp38-cp38-musllinux_1_1_i686.whl
lark_cython-0.0.11-cp38-cp38-musllinux_1_1_x86_64.whl
lark_cython-0.0.11-cp38-cp38-win_amd64.whl
lark_cython-0.0.11-cp38-cp38-win32.whl
lark_cython-0.0.11-cp39-cp39-macosx_10_9_x86_64.whl
lark_cython-0.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-cp39-cp39-musllinux_1_1_i686.whl
lark_cython-0.0.11-cp39-cp39-musllinux_1_1_x86_64.whl
lark_cython-0.0.11-cp39-cp39-win_amd64.whl
lark_cython-0.0.11-cp39-cp39-win32.whl
lark_cython-0.0.11-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
lark_cython-0.0.11-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-pp37-pypy37_pp73-win_amd64.whl
lark_cython-0.0.11-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
lark_cython-0.0.11-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-pp38-pypy38_pp73-win_amd64.whl
lark_cython-0.0.11-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
lark_cython-0.0.11-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
lark_cython-0.0.11-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lark_cython-0.0.11-pp39-pypy39_pp73-win_amd64.whl
Erotemic commented 2 years ago

This should be ready to merge. The wheels listed here: https://github.com/lark-parser/lark_cython/suites/7481642149/artifacts/306892242 could be manually uploaded to pypi if you wanted to do that.

erezsh commented 2 years ago

Any chance I could ask you to do a rebase? (and then push -f)

It would be nicer to have it concise, without "wip" commits.

erezsh commented 2 years ago

Btw, why are you installing XCode? Isn't that an IDE?

Erotemic commented 2 years ago

I've never tried this pipeline without the XCode part, it was in the original example I followed for cibuildwheel. I believe it is how the compiler toolchains are installed on OSX. But I'm not 100% sure it's necessary we could try removing it and see what happens?

Erotemic commented 2 years ago

Huh, it works without XCode. That's neat. I guess I'll remove that from my other pipelines.

erezsh commented 2 years ago

@Erotemic I'm wondering if we can also remove the QEmu dependency?

Erotemic commented 2 years ago

For QEMU, we will need it if we want to expand the architectures that we support. I removed the XCode logic completely, but commented out QEMU, as I think it's not invoked right now.

erezsh commented 2 years ago

Thanks for the great contribution!

erezsh commented 1 year ago

@Erotemic Hello!

Any idea why the current build fails? Looking at the list of version, looks like 3.6 should still be available.

Erotemic commented 1 year ago

Very strange. I see the action is using setup-python@v2, whereas the current version is at least actions/setup-python@v4.3.0, so maybe that needs to be updated? (Adding the github dependabot can help here).

But I'm not sure why that would be an issue.

erezsh commented 1 year ago

Any chance you can give it a look? Otherwise I'll look into it over the weekend.