fix: package hidden files in python source directories into sdists #3358
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 198 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.317
Real PR Conversation Timeline
1 comments
"Review active on #3358"
general
weight: 0.35
messense
Cargo-generated sdists silently drop dot-directories inside the python package — for example
.agentsagent-skill bundles, which live atpython/<pkg>/.agents/...per the Agent Skills convention.Real-world case: the
relate-db1.0.0 sdist on PyPI shipped 10 of the 13 files in its python package; the three.agentsskill files were missing. Worse,maturin build --sdistbuilds its wheel from the staged sdist tree, so the manylinux x86_64 wheel published from that lane was missing the files too, while the four wheels built without--sdistcarried them.Root cause:
add_python_sources(src/source_distribution/pyproject.rs) walks the python package withignore::WalkBuilderat default settings — theignorecrate skips dot-prefixed entries unless.hidden(false)is set. The wheel writer (src/module_writer/mod.rs) sets.hidden(false), and the git generator lists tracked dot files viagit ls-files; only the cargo generator (the default) dropped them.Fix:
.hidden(false)on the sdist walk — parity with the wheel writer and the git generator. Gitignored entries and compiled artifacts are still excluded as before, and explicit[tool.maturin] excludepatterns still win: the two fixtures with a package-dir.gitignore(pyo3-mixed-include-exclude,cffi-mixed-include-exclude) both exclude theirs via config, so no existing sdist snapshot changes.Test:
sdist_includes_hidden_files_in_python_source— copiespyo3-mixedinto a temp dir, addspyo3_mixed/.agents/skills/SKILL.md, and asserts the cargo-generated sdist carries it.