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

Error if the --python option is specified after the subcommand name #12068

Merged
merged 5 commits into from
Jun 8, 2023

Conversation

pfmoore
Copy link
Member

@pfmoore pfmoore commented Jun 2, 2023

Fixes #12067

@pfmoore pfmoore changed the title Warn if the --python option is not specified before the subcommand name Warn if the --python option is specified after the subcommand name Jun 2, 2023
@uranusjr
Copy link
Member

uranusjr commented Jun 5, 2023

I wonder if we should fail instead of warn since this is likely not going to do what the user wants, and the unintended side efects may be difficult to revert.

@pfmoore
Copy link
Member Author

pfmoore commented Jun 5, 2023

I also wondered about that. I'm happy to change this.

@pfmoore
Copy link
Member Author

pfmoore commented Jun 5, 2023

Hmm, test errors look like test_install_nonlocal_compatible_wheel wasn't using the right option name for --python-version 🙁

I've corrected the option name in that test, but it's a bit worrying that the test didn't actually fail previously. If someone wants to fix that, they can do so in a followup PR, though - I think the feature that test was added for probably needs more comprehensive tests, or alternatively needs to try to test fewer things in a single test...

@pfmoore pfmoore changed the title Warn if the --python option is specified after the subcommand name Error if the --python option is specified after the subcommand name Jun 5, 2023
@pfmoore
Copy link
Member Author

pfmoore commented Jun 5, 2023

OK, this seems good now, moving out of draft status.

@pfmoore pfmoore marked this pull request as ready for review June 5, 2023 12:05
@pfmoore pfmoore merged commit 2d168e6 into pypa:main Jun 8, 2023
@pfmoore pfmoore deleted the python_option_subcommand branch June 8, 2023 13:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When --python option is placed after the subcommand name in pip install, it gets ignored
2 participants