← Back to Pull requests

fix: package hidden files in python source directories into sdists #3358

Open
unknown opened this pull request with 198 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 11, 2026 21:49 UTC
Author

Cargo-generated sdists silently drop dot-directories inside the python package — for example .agents agent-skill bundles, which live at python/<pkg>/.agents/... per the Agent Skills convention.

Real-world case: the relate-db 1.0.0 sdist on PyPI shipped 10 of the 13 files in its python package; the three .agents skill files were missing. Worse, maturin build --sdist builds 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 --sdist carried them.

Root cause: add_python_sources (src/source_distribution/pyproject.rs) walks the python package with ignore::WalkBuilder at default settings — the ignore crate 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 via git 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] exclude patterns 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 — copies pyo3-mixed into a temp dir, adds pyo3_mixed/.agents/skills/SKILL.md, and asserts the cargo-generated sdist carries it.

Diff: 198 lines (+148 / -50) across 2 files Reviewer: messense Review duration: 27472m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.1% (MEDIUM) · Higher = larger blast radius
36.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.2% · Safe to merge
19.2%
Repository