Open
Conversation
Follow symlinked directories when collecting Python package files for wheels and source distributions. This restores support for layouts that share Python code through symlinked package directories instead of duplicating files.
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.
Summary
Restore traversal of symlinked directories when maturin collects Python package sources for wheels and sdists.
I dont know if it was removed intentional or not. If it was, I could add some bool to the pyproject.toml that could toggle this behavior (and set the current default to false)
Why
In our team we package multiple Python packages that share some common code. We use symlinks for those shared directories and files so the source is maintained in one place instead of duplicated across package trees.
This worked previously (from what i remember - 1.7.0), but recent behavior no longer followed symlinked directories while building a pyo3 Rust + Python layout. Symlinked files were still included, but files inside symlinked directories were omitted from the wheel.
Fix
Use
follow_links(true)when walking Python package sources for both wheel and sdist generation.Validation
linked_dir/nested.pyis missing from the wheel.cargo test --test run -- pyo3_mixed_py_subdir_includes_symlinked_python_files.cargo fmt --allandgit diff --check.AI disclosure
Fix was written by codex 5.5