Repository navigation
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



A one-line packaging fix that #305 (the Rust CLI) needs before it can land.
The problem
maturin sdistcopies the workspace'sCargo.tomlas it is, and takes the crate's files fromcargo package, which leaves out everything outside the crate'sinclude(src/, the data, LICENSE, NOTICE, README.md). #304 already addedbenches/andexamples/to the sdist for that reason: Cargo.toml names[[bench]]and[[example]]targets, and cargo refuses to read a manifest whose explicit targets have no file.#305 adds an explicit
[[test]] name = "cli"(required-features = ["cli"]). Withouttests/cli.rsin the sdist,pip installfrom the sdist fails. I checked this on #305's branch as pywhat-rs-cli has rebased it onto main 0c78b02 (their commits f1bc150, 896c2fe and 5f38d67, not pushed yet):Once #305 is rebased, the Release workflow will run on it (it changes Cargo.toml), and its
sdistjob (Try the sdist) will fail the same way.The fix
pyproject.toml:{ path = "tests/**/*.rs", format = "sdist" }next to the benches and examples. The sdist only builds the library, so the tests' contents don't matter; they make the manifest readable. The.cratethatcargo packagebuilds doesn't change.Commands and results
maturin sdist(maturin 1.16.0) gives an sdist withtests/charset_only.rs,tests/cli.rs,tests/examples.rs,tests/golden.rs,tests/whole.rs(and LICENSE, NOTICE, the benches and the example).pip installof it into a fresh Python 3.12 venv works:pywhat --versionprintsPyWhat version 6.0.0a1, andpywhat._pywhathasMatchError,Textandfinditer.pyproject.toml: the same, andpip installfrom the sdist works (rc 0). Without it: the error above./local/home/skerraut/herd-synth3/reports/pywhat-rs-py-evidence/local_ci.shundergate.sh) on this head: cargo fmt, clippy (3 runs, with-p pywhat-py), cargo test (3 runs) pass;nox -s testson Python 3.8: 2424 passed, 6 skipped; on 3.12: 2427 passed, 3 skipped; the wheel (1,676,699 bytes) installs on 3.8 and 3.12, the sdist (719,102 bytes) on 3.12, and the smoke test finds['LICENSE', 'NOTICE']in both.cargo package --list -p pywhat(39 files) are the same on main and on this head.