Commit graph

235 commits

Author SHA1 Message Date
Zanie Blue
6bc8639ce8
Allow customizing the tool install directory with UV_TOOL_BIN_DIR (#6207)
Requested in #6067
2024-08-19 15:02:10 +00:00
Di-Is
ad8e3a2c32
Hide global option in uv generate-shell-completion (#6170)
Resolve #6152 

## Summary

## Test Plan

Execution result of `cargo run generate-shell-completion --help`

```bash
Generate shell completion

Usage: uv generate-shell-completion <SHELL>

Arguments:
  <SHELL>  The shell to generate the completion script for [possible values: bash, elvish, fish, nushell, powershell, zsh]
```

Execution result of `cargo run help generate-shell-completion`

```bash
Generate shell completion

Usage: uv generate-shell-completion <SHELL>

Arguments:
  <SHELL>
          The shell to generate the completion script for
          
          [possible values: bash, elvish, fish, nushell, powershell, zsh]
```
2024-08-17 13:34:34 -05:00
Zanie Blue
0091adfa5b
Document uv add and uv remove behavior with markers (#6163) 2024-08-16 23:16:42 +00:00
Ahmed Ilyas
268c6de7fd
Support uv add -r requirements.txt (#6005)
## Summary

Resolves https://github.com/astral-sh/uv/issues/4537

- First commit avoids overwriting dependencies with different markers.
- Second commit supports adding from requirements files.

## Test Plan

`cargo test`
2024-08-16 21:57:45 +00:00
Zanie Blue
b93b0f2bcd
Show uv generate-shell-completion in CLI documentation reference (#6146)
We need to follow this with:

1) Hide a bunch of global arguments for this command
2) Add an about section for the command
2024-08-16 11:40:05 -05:00
Charlie Marsh
171c39d365
Remove 'tool' reference on uv run CLI (#6110) 2024-08-15 14:09:02 +00:00
eth3lbert
ef948619ee
Hide python options in uv tool list help (#6003)
## Summary

Closes #5982 .

## Test Plan

```
cargo run tool list --help
```

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-08-13 11:21:44 -05:00
Zanie Blue
f6f1bd2f14
Improve top-level help for uv tool commands (#5983)
More work needs to be done for all of the options
2024-08-12 17:35:50 +00:00
Ahmed Ilyas
2d53e35e39
Support PEP 723 scripts in uv add and uv remove (#5995)
## Summary

Resolves https://github.com/astral-sh/uv/issues/4667

## Test Plan

`cargo test`
2024-08-11 01:40:59 +00:00
Zanie Blue
921050d747
Improve the uv sync CLI documentation (#5930) 2024-08-09 14:46:32 -05:00
Zanie Blue
d6c587c21c
Improve the uv python CLI documentation (#5961) 2024-08-09 14:46:21 -05:00
Charlie Marsh
f89403f4f6
Retain and respect settings in tool upgrades (#5937)
## Summary

We now persist the `ResolverInstallerOptions` when writing out a tool
receipt. When upgrading, we grab the saved options, and merge with the
command-line arguments and user-level filesystem settings (CLI > receipt
> filesystem).
2024-08-09 18:21:49 +00:00
Zanie Blue
4df0fe9a01
Update the interface for declaring Python download preferences (#5936)
The loose consensus is that "fetch" doesn't have much meaning and that a
boolean flag makes more sense from the command line.

1. Adds `--allow-python-downloads` (hidden, default) and
`--no-python-downloads` to the CLI to quickly enable or disable
downloads
2. Deprecates `--python-fetch` in favor of the options from (1)
3. Removes  `python-fetch` in favor of a `python-downloads` setting
5. Adds a `never` variant to the enum, allowing even explicit installs
to be disabled via the configuration file

## Test plan

I tested this with various `pyproject.toml`-level settings and `uv venv
--preview --python 3.12.2` and `uv python install 3.12.2` with and
without the new CLI flags.
2024-08-09 13:10:19 -05:00
Zanie Blue
3228fc5f35
Improve the uv venv CLI documentation (#5963)
This was actually in pretty good shape already!
2024-08-09 12:15:22 -05:00
Zanie Blue
4330f9718b
Improve the uv lock CLI documentation (#5932) 2024-08-09 08:51:03 -05:00
Charlie Marsh
fd1d508108
Make --upgrade imply --refresh (#5943)
## Summary

I think this seems reasonable... Otherwise, we might not go back to PyPI
to revalidate the list of available versions despite the user passing
`--upgrade`.
2024-08-08 20:11:31 -04:00
Ahmed Ilyas
cbc3274848
Add uv tool upgrade command (#5197)
## Summary

Resolves #5188. Most of the changes involve creating a new function in
`tool/common.rs` to contain the common functionality previously found in
`tool/install.rs`.

## Test Plan

`cargo test`

```console
❯ ./target/debug/uv tool upgrade black
warning: `uv tool upgrade` is experimental and may change without warning.
Resolved 6 packages in 25ms
Uninstalled 1 package in 3ms
Installed 1 package in 19ms
 - black==23.1.0
 + black==24.4.2
Installed 2 executables: black, blackd
```
2024-08-08 16:48:14 -04:00
Zanie Blue
bf0497e652
Add CLI flags to reference documentation (#5926)
Oopsies, options are only arguments that take values in Clap-land

Closes https://github.com/astral-sh/uv/issues/5924
2024-08-08 18:51:27 +00:00
Zanie Blue
d2681320d3
Improve the CLI documentation for uv remove (#5916)
Also, renames a `requirements` variable to `packages` for clarity and
fixes the definition of `frozen` for `uv add`.
2024-08-08 13:12:49 -05:00
Zanie Blue
eb6251e0ed
Improve the CLI documentation for uv add (#5914) 2024-08-08 10:52:38 -05:00
Ahmed Ilyas
acbd367ead
Support no-build-isolation-package (#5894)
## Summary

Resolves #5831 

## Test Plan

`cargo test`
2024-08-08 01:35:56 +00:00
Zanie Blue
c95bf76dfe
Replace uv help python references in CLI documentation with links (#5871)
Following #5869, the documentation has some less-than-helpful
suggestions to use `uv help python` for details — we should link to the
`uv python` section instead.
2024-08-07 12:21:09 -05:00
Zanie Blue
fe2849af6a
Improve CLI documentation for uv tree (#5870) 2024-08-07 16:59:27 +00:00
Zanie Blue
2df2092084
Improve --python CLI documentation (#5869)
Closes #4400
2024-08-07 16:37:10 +00:00
Zanie Blue
32d8ea1698
Improve documentation for uv init CLI (#5862) 2024-08-07 11:26:00 -05:00
Zanie Blue
8998149ac1
Improve CLI documentation for uv run (#5841)
Adds more long-form help to `uv run`, which renders in `uv help run` and
the CLI reference on the website.
2024-08-07 13:26:24 +00:00
Zanie Blue
d1614c8f10
Improve CLI documentation for global options (#5834)
Slowly auditing our CLI help text
2024-08-06 20:50:29 -05:00
Zanie Blue
c0c26cc542
Improve display order of top-level commands (#5830)
Closes https://github.com/astral-sh/uv/issues/5702

Since Clap 4, the default order follows the declarations.

Also improves some descriptions.
2024-08-06 16:18:05 -05:00
Charlie Marsh
6b45baf7be
Support --python-platform in uv tree (#5764)
## Summary

This allows you to set (e.g.) `--python-platform windows` to view the
resolved dependencies on Windows.

Closes https://github.com/astral-sh/uv/issues/5760.
2024-08-05 19:02:35 +00:00
eth3lbert
f2c4b9c752
Show default and possible options in CLI reference documentation (#5720)
## Summary

Closes #5692 .
2024-08-02 12:55:50 +00:00
Ahmed Ilyas
a6416aa450
Fix CLI reference URLs to subcommands (#5722)
## Summary

Currently all of these links end up 404-ed. I've added a `#` to fix the
URLs.

<img width="653" alt="Screenshot 2024-08-02 at 12 34 22"
src="https://github.com/user-attachments/assets/9b66adcc-431c-441a-8f4f-1b579472fdce">

## Test Plan

Checked manually.
2024-08-02 07:35:33 -05:00
Ahmed Ilyas
ff9f3dede1
Support build constraints (#5639)
## Summary

Partially resolves #5561. Haven't added overrides support yet but I can
add it tomorrow if the current approach for constraints is ok.

## Test Plan

`cargo test`

Manually checked trace logs after changing the constraints.
2024-08-02 02:15:58 +00:00
Zanie Blue
6797caccdb
Update top-level command descriptions (#5706)
Addresses feedback in https://github.com/astral-sh/uv/pull/5700
2024-08-01 20:29:26 +00:00
Zanie Blue
34f657c964
Unhide the experimental top-level commands (#5700) 2024-08-01 14:06:07 -05:00
Zanie Blue
f107406727
Generate CLI reference for documentation (#5685)
Loosely based on [Cargo's
format](https://github.com/rust-lang/cargo/blob/master/src/doc/src/commands/cargo-build.md)

<img width="896" alt="Screenshot 2024-08-01 at 9 44 03 AM"
src="https://github.com/user-attachments/assets/7c016bb3-2b54-46af-8ea8-ce82e07a0e30">

Future work includes:

- Grouping options
- Enforcing some sort of specific command ordering
- Showing possible values for enums
- Adding "long_about" to commands for more context
2024-08-01 16:04:16 +00:00