Skip to content

Publish wheels to PyPI #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mxmlnkn opened this issue Aug 13, 2022 · 11 comments
Closed

Publish wheels to PyPI #21

mxmlnkn opened this issue Aug 13, 2022 · 11 comments

Comments

@mxmlnkn
Copy link

mxmlnkn commented Aug 13, 2022

Currently, installing this package with pip might fail with this error (excerpt from CI):

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include -Ilibarchive -I/opt/hostedtoolcache/Python/3.6.15/x64/include/python3.6m -c libarchive/_libarchive_wrap.c -o build/temp.linux-x86_64-3.6/libarchive/_libarchive_wrap.o
libarchive/_libarchive_wrap.c:2712:10: fatal error: archive.h: No such file or directory
 2712 | #include <archive.h>
      |          ^~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

Installing libarchive-dev on Ubuntu fixes this but it is an additional step the user has to be made aware of.

To ease installation issues like this one, providing wheels would be very much appreciated. Even better if it bundles libarchive, which thanks to its permissive license should be possible to do. It seems like @Vadiml1024 already tried to set up a CI for this. Personally, I'm using a pyproject.toml and the build package to build the tarball and cibuildwheel to build the wheels for my C++ indexed_bzip2/pragzip.

@mxmlnkn
Copy link
Author

mxmlnkn commented Aug 13, 2022

Unrelated low-impact issue: Archive.denit should probably be renamed Archive.deinit or maybe something more normal like close. I was confused why I couldn't find it with Ctrl+F. Note that changing it would be an API break, so maybe just add an alternative or increment to the version 5.m.p.

@cabarnes
Copy link
Member

@mxmlnkn I just added a deploy action to the repository. I don't know when I'll have a chance to work on adding wheels to the PyPI deployment. If you would like to create a PR that adds that support, I would be willing to consider it. I know that @Vadiml1024 was doing something similar, but I didn't want that much change all at once. As you know, I missed a couple things as it was.

@mxmlnkn
Copy link
Author

mxmlnkn commented Aug 16, 2022

@cabarnes Understood. I should have some time the coming weeks, I might get around to do this. The missing wheels and some (thread-)safe file objects to the contained files (related to #23) are the two blockers for me right now. Thank you for keeping this project alive.

@Vadiml1024
Copy link

I can easily produce a PR with with my github workflow which produces a wheel containing dependent shared libs.
however it produces only linux targeted wheel.

@Vadiml1024
Copy link

@mxmlnkn I just added a deploy action to the repository. I don't know when I'll have a chance to work on adding wheels to the PyPI deployment. If you would like to create a PR that adds that support, I would be willing to consider it. I know that @Vadiml1024 was doing something similar, but I didn't want that much change all at once. As you know, I missed a couple things as it was.

Just created PR (#27) with workflow to build wheel embedding libs

@cabarnes
Copy link
Member

@mxmlnkn @Vadiml1024 The PR has been merged and version 4.2.0b1 has been deployed. Can you both test that the wheels are working proplery?

@mxmlnkn
Copy link
Author

mxmlnkn commented Aug 23, 2022

It installs correctly for me locally as well as on my CI.

Note that, because it is a pre-relase, installation works only when explicitly requesting the version with python-libarchive==4.2.0b1.

python3 -c 'import libarchive; print(libarchive.version())' prints 3.6.1 even though I only have libarchive 3.6.0 installed on my system, so, I presume that statically linking against libarchive while creating the wheel also works.

I'm positively surprised that it also has Python 3.6 wheels. That way I can keep my Python 3.6 CI for a bit longer.

@Vadiml1024
Copy link

Well, it is not really statically linked. It's actually the wheel includes shared libs.

@mxmlnkn
Copy link
Author

mxmlnkn commented Aug 23, 2022

Well, it is not really statically linked. It's actually the wheel includes shared libs.

Ah ok, you are right. I can see all the shared libraries in my local site-packages folder. Interesting to know.

@cabarnes
Copy link
Member

I'm positively surprised that it also has Python 3.6 wheels.

Yes, it seems that it built everything, which I think is good.

Everything works for me on Ubuntu 20.04. I will do the final release of 4.2.0 today. Thanks for your help @mxmlnkn and @Vadiml1024 !

@cabarnes
Copy link
Member

4.2.0 has been released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants