-
-
Notifications
You must be signed in to change notification settings - Fork 339
Only use all_features=true in sdist when local path dependencies exist #2674
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
Merged
messense
merged 7 commits into
main
from
copilot/fix-daaf2133-8e3c-4ffb-a3f2-1f3f8ef9bcb9
Jul 11, 2025
Merged
Only use all_features=true in sdist when local path dependencies exist #2674
messense
merged 7 commits into
main
from
copilot/fix-daaf2133-8e3c-4ffb-a3f2-1f3f8ef9bcb9
Jul 11, 2025
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
…encies exist Co-authored-by: messense <1556054+messense@users.noreply.github.com>
all_features: true
when local path dependencies detected in the binding crate's depdency graph
Copilot finished work on behalf of
messense
July 11, 2025 11:16
messense
reviewed
Jul 11, 2025
…ependencies Co-authored-by: messense <1556054+messense@users.noreply.github.com>
Copilot finished work on behalf of
messense
July 11, 2025 11:27
@copilot fix trailing whitespace |
Co-authored-by: messense <1556054+messense@users.noreply.github.com>
Copilot finished work on behalf of
messense
July 11, 2025 11:41
@copilot run |
…ublic Co-authored-by: messense <1556054+messense@users.noreply.github.com>
Copilot finished work on behalf of
messense
July 11, 2025 11:52
@copilot please fix conflicts with main branch |
Copilot finished work on behalf of
messense
July 11, 2025 12:19
messense
approved these changes
Jul 11, 2025
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this pull request
Aug 6, 2025
https://build.opensuse.org/request/show/1297806 by user mia + dimstar_suse - Update to 1.9.3 * Add support for RISC-V architecture in manylinux gh#PyO3/maturin#2694 * pyproject.toml: bump setuptools for PEP 639 gh#PyO3/maturin#2698 * Fix PEP 639 support for source distributions gh#PyO3/maturin#2704 * Fix relative README rewrite in source distributions gh#PyO3/maturin#2705 - Update to 1.9.2 * Respect PEP 621 dynamic fields when merging Cargo.toml metadata gh#PyO3/maturin#2672 * Only use all_features=true in sdist when local path dependencies exist gh#PyO3/maturin#2674 * auditwheel: add manylinux_2_26 policy gh#PyO3/maturin#2677 * Use user-specified library search paths in RUSTFLAGS in auditwheel gh#PyO3/maturin#2676 * pyproject.toml: add license-files gh#PyO3/maturin#2690 * Update manylinux/musllinux
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.
Problem
The
maturin sdist
command was always settingall_features: true
to ensure all optional path dependencies are packaged into the source distribution. However, this caused failures for projects with mutually exclusive features, as reported in #2673.For example, a project using
inkwell
with multiple incompatible features would fail during sdist generation because enabling all features simultaneously created conflicting dependencies.Solution
This PR modifies the sdist command to only enable
all_features: true
when the project actually has local path dependencies. The logic is:all_features: true
(preserves current behavior)Changes
Added
has_path_dependencies()
function insrc/source_distribution.rs
:true
if any path dependencies are found,false
otherwiseModified SDist command in
src/main.rs
:all_features
based on the resultfalse
if metadata cannot be retrievedAdded unit test to verify the path dependency detection works correctly for both scenarios
Testing
Example
Before this fix, a project with incompatible features would fail:
$ maturin sdist # Failed because all_features=true activated incompatible features
After this fix, the same project succeeds:
$ maturin sdist # Succeeds because no path dependencies detected, all_features=false
Projects with actual path dependencies continue to work as before, ensuring optional path dependencies are still properly packaged.
Fixes #2673
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.