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

Move --python and --python-version into the "Python options" help #5691

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Aug 1, 2024

Part of #4454

e.g. for uv help pip compile

Python options:
      --python <PYTHON>
          The Python interpreter against which to compile the requirements.
          
          By default, uv uses the virtual environment in the current working directory or any parent
          directory, falling back to searching for a Python executable in `PATH`. The `--python`
          option allows you to specify a different interpreter.
          
          Supported formats:
          - `3.10` looks for an installed Python 3.10 using `py --list-paths` on Windows, or
            `python3.10` on Linux and macOS.
          - `python3.10` or `python.exe` looks for a binary with the given name in `PATH`.
          - `/home/ferris/.local/bin/python3.10` uses the exact Python at the given path.

  -p, --python-version <PYTHON_VERSION>
          The minimum Python version that should be supported by the resolved requirements (e.g., `3.8` or `3.8.17`).
          
          If a patch version is omitted, the minimum patch version is assumed. For example, `3.8` is mapped to `3.8.0`.

      --python-preference <PYTHON_PREFERENCE>
          Whether to prefer using Python installations that are already present on the system, or those that are downloaded and installed by uv

          Possible values:
          - only-managed: Only use managed Python installations; never use system Python installations
          - managed:      Prefer managed Python installations over system Python installations
          - system:       Prefer system Python installations over managed Python installations
          - only-system:  Only use system Python installations; never use managed Python installations

      --python-fetch <PYTHON_FETCH>
          Whether to automatically download Python when required

          Possible values:
          - automatic: Automatically fetch managed Python installations when needed
          - manual:    Do not automatically fetch managed Python installations; require explicit installation

@zanieb zanieb added the cli Related to the command line interface label Aug 1, 2024
@zanieb
Copy link
Member Author

zanieb commented Aug 1, 2024

cc @eth3lbert

Copy link
Contributor

@eth3lbert eth3lbert left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Not a blocker, should we add some snapshots for these commands?

@zanieb
Copy link
Member Author

zanieb commented Aug 1, 2024

I don't feel strongly. The snapshots are going to be kind of annoying to update and it's not really critical? Not sure.

@zanieb zanieb merged commit 159108b into main Aug 1, 2024
57 checks passed
@zanieb zanieb deleted the zb/python-options branch August 1, 2024 16:55
@zanieb
Copy link
Member Author

zanieb commented Aug 1, 2024

Thanks for reviewing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants