Skip to content
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

Consider requires-python when searching for interpreters #495

Merged
merged 1 commit into from
Apr 20, 2021

Conversation

konstin
Copy link
Member

@konstin konstin commented Apr 9, 2021

Fixes #195

Not sure if there's any better way to test this.

@@ -176,9 +177,9 @@ impl BuildOptions {
// Only build a source distribution
Some(ref interpreter) if interpreter.is_empty() => vec![],
// User given list of interpreters
Some(interpreter) => find_interpreter(&bridge, &interpreter, &target)?,
Some(interpreter) => find_interpreter(&bridge, &interpreter, &target, None)?,
Copy link
Member

@messense messense Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also filter the user given list of interpreters if requires-python specified?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in that case I'd trust the users list more than the PEP 440 heuristic

@konstin konstin force-pushed the requires_python_for_interpreter_search branch from adf0717 to 4ac4f5b Compare April 20, 2021 13:16
@konstin konstin merged commit ecffb57 into main Apr 20, 2021
@konstin konstin deleted the requires_python_for_interpreter_search branch April 20, 2021 13:27
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request May 8, 2021
https://build.opensuse.org/request/show/891567
by user mia + dimstar_suse
- Update to 0.10.4
  * Interpreter search now uses python 3.6 to 3.12
    gh#PyO3/maturin#495
  * Consider requires-python when searching for interpreters
    gh#PyO3/maturin#495
  * Support Rust extension as a submodule in mixed Python/Rust
    project  gh#PyO3/maturin#489
@messense
Copy link
Member

messense commented Jul 4, 2021

The error message isn't good when maturin can't find any interpreters with requries-python set.

🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings
💥 maturin failed
  Caused by: Couldn't find any python interpreters. Please specify at least one with -i

It's kinda confusing if user already has some other Python versions installed. It would be much nicer if it says Couldn't find any python interpreters version >= 3.7. Please specify at least one with -i.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Do not build wheels for python versions not supported by package
2 participants