-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: make -p flag in an alias for --python #11437
fix: make -p flag in an alias for --python #11437
Conversation
long = "python", | ||
short = 'p', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the verbose long
and short
options — we don't use that anywhere and coherence with the existing style is important.
This also seems to add support for the UV_PYTHON
variable. It's fine to leave here, but please be careful with changes like that / note them in the summary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Unfortunately this is a breaking change and we'll need to do some tricks to make this roughly backwards compatible. I can own that. |
The failure mode can be seen in CI
We could decide this is okay and just hint to use The alternative is |
I tried a different approach in #11486 |
…#11486) Closes #11285 Closes #11437 This changes `-p` from an alias of `--python-version` to `--python` while retaining backwards compatibility for `--python-version`-like fallback behavior when the requested version, e.g., `-p 3.12`, cannot be found. This was initially implemented with a hidden `--python-legacy` flag which allows us to special case the short `-p` flag — unlike the implementation in #11437. However, after further discussion, we decided the behavior difference between `-p` and `--python` would be confusing so now `-p` is an alias for `--python` and `--python` is special-cased when a version is used. Additionally, we now respect the `UV_PYTHON` environment variable, but it is ignored when `--python-version` is set. If you want different `--python-version` and `--python` values, you must do so explicitly. I considered banning this, but it is valid for e.g. `--python pypy --python-version 3.12`
…#11486) Closes #11285 Closes #11437 This changes `-p` from an alias of `--python-version` to `--python` while retaining backwards compatibility for `--python-version`-like fallback behavior when the requested version, e.g., `-p 3.12`, cannot be found. This was initially implemented with a hidden `--python-legacy` flag which allows us to special case the short `-p` flag — unlike the implementation in #11437. However, after further discussion, we decided the behavior difference between `-p` and `--python` would be confusing so now `-p` is an alias for `--python` and `--python` is special-cased when a version is used. Additionally, we now respect the `UV_PYTHON` environment variable, but it is ignored when `--python-version` is set. If you want different `--python-version` and `--python` values, you must do so explicitly. I considered banning this, but it is valid for e.g. `--python pypy --python-version 3.12`
…#11486) Closes #11285 Closes #11437 This changes `-p` from an alias of `--python-version` to `--python` while retaining backwards compatibility for `--python-version`-like fallback behavior when the requested version, e.g., `-p 3.12`, cannot be found. This was initially implemented with a hidden `--python-legacy` flag which allows us to special case the short `-p` flag — unlike the implementation in #11437. However, after further discussion, we decided the behavior difference between `-p` and `--python` would be confusing so now `-p` is an alias for `--python` and `--python` is special-cased when a version is used. Additionally, we now respect the `UV_PYTHON` environment variable, but it is ignored when `--python-version` is set. If you want different `--python-version` and `--python` values, you must do so explicitly. I considered banning this, but it is valid for e.g. `--python pypy --python-version 3.12`
closes #11285
Changes
PipCompileArgs
to make-p
alias to--python
--python-version
option