Skip to content
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

add source distribution to pypi - to create conda package #231

Open
rxm7706 opened this issue Apr 30, 2024 · 4 comments
Open

add source distribution to pypi - to create conda package #231

rxm7706 opened this issue Apr 30, 2024 · 4 comments

Comments

@rxm7706
Copy link

rxm7706 commented Apr 30, 2024

Pypi distribution is missing source files -
https://pypi.org/project/wasmtime/#files
Adding the source will help create a conda package, and make wasmtime available for conda users.

@alexcrichton
Copy link
Member

Thanks for the report! I don't have a ton of experience with this myself, so if you're knowledgeable of how to do this a PR would be greatly appreciated! Wheels are produced in CI so it's in theory probably just a few edits to those files.

@whitequark
Copy link
Contributor

@alexcrichton You probably want to add one more of these blocks:

python setup.py bdist_wheel

but with python setup.py sdist instead of python setup.py bdist_wheel. This will produce a tarball which you publish in the same way as a wheel.

@alexcrichton
Copy link
Member

Ah ok! That's easy enough to add, but I should probably ask a bit more about this. I've got no experience with Conda myself, but is the idea that this package is buildable from source? If so that's not currently possible with scripts in this repository because it requires a build of the Wasmtime C API which this repository downloads from the Wasmtime repository when packages are uploaded. How would Conda know about this dependency relationship?

@whitequark
Copy link
Contributor

I (somewhat regretfully) have experience with Conda, so I can answer that.

How would Conda know about this dependency relationship?

Conda recipes are YAML files that include build scripts. They can do anything, including e.g. downloading and repackaging wheels. I think you could make an sdist useful in this regard (and also to non-Conda users) by making it so that setup.py bdist_wheel (which is the command that will get run eventually) downloads and installs the Wasmtime C API through any means necessary; this usually involves setuptools crimes.

With Conda specifically this isn't strictly a requirement as the scripts contain arbitrary shell scripts. I'm too out of date to say if having an sdist would help packagers much or not at all. But I do agree with you (I think) that an sdist should be actually useful on its own, i.e. contain commands to download the Wasmtime C API, otherwise there is no point in publishing it.

If that's not desired (it's somewhat annoying to get setuptools to do this) then you could lean on Conda packagers to use a git checkout instead, which is very much supported by Conda as well.

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