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

The watchfiles tarball released on PyPi do not include Cargo.lock #192

Closed
rszamszur opened this issue Oct 1, 2022 · 5 comments · Fixed by #193
Closed

The watchfiles tarball released on PyPi do not include Cargo.lock #192

rszamszur opened this issue Oct 1, 2022 · 5 comments · Fixed by #193

Comments

@rszamszur
Copy link

Hello there 👋

Is there any particular reason why the Cargo.lock file is not included in the tarball released on PyPI? Having it would help build watchfiles with Nix. Otherwise, one has to hardcode and update cargo hashes, which can be a burden to maintain. I saw some projects include it (for instance: cryptography-38.0.1.tar.gz under src/rust). I do not know the playbook for Python-Rust projects, and I'm genuinely curious.

More context: nix-community/poetry2nix#731

Have a good one!

@samuelcolvin
Copy link
Owner

Interesting, I would have thought it should be included, but I feel like there's a specific reason it's not.

See PyO3/maturin#1153, it seems that cargo package --list --allow-dirty does not include Cargo.lock, hence it's omitted.

Even if I add Cargo.lock to Cargo.toml::package::include, it still doesn't seem to be added to the tarball.

@messense what do you think?

@messense
Copy link
Collaborator

messense commented Oct 6, 2022

I guess cargo excludes Cargo.lock for library crate automatically. You can add it to sdist via sdist-include though

[tool.maturin]
sdist-include = ["Cargo.lock"]

@samuelcolvin
Copy link
Owner

Thanks @messense, what do you think about updating maturin to include it by default?

@messense
Copy link
Collaborator

messense commented Oct 6, 2022

Thanks @messense, what do you think about updating maturin to include it by default?

Include it by default should be easy, there is a question though, do we need to provide ways to opt-out of the default?

@samuelcolvin
Copy link
Owner

Humm, I can't imagine why you wouldn't want a Cargo.lock file in the tarball, but maybe I'm wrong.

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

Successfully merging a pull request may close this issue.

3 participants