Commit graph

388 commits

Author SHA1 Message Date
Charlie Marsh
2153c6ac0d
Respect named --index and --default-index values in tool.uv.sources (#7910)
## Summary

If you pass a named index via the CLI, you can now reference it as a
named source. This required some surprisingly large refactors, since we
now need to be able to track whether a given index was provided on the
CLI vs. elsewhere (since, e.g., we don't want users to be able to
reference named indexes defined in global configuration).

Closes https://github.com/astral-sh/uv/issues/7899.
2024-10-15 23:56:24 +00:00
Charlie Marsh
a034a8b83b
Remove the flat index types (#7759)
## Summary

I think these really don't pull their weight.
2024-10-15 23:30:37 +00:00
Charlie Marsh
ad24cee7c6
Add index URLs when provided via uv add --index or --default-index (#7746)
## Summary

The behavior is as follows:

- If you provide `--index` or `--default-index` on the command-line, we
add those indexes to the `pyproject.toml` (with names, if provided, as
in `--index pytorch=https://download.pytorch.org/whl/cu121`.
- If you provide `--index-url` or `--default-index`, we warn, but don't
add the indexes to the file. (This seems wrong -- why not add them?)
- If you provide an index with a name or URL that already exists, we
remove that entry, and add the new index to the top of the list (since
it now has highest priority).
- If you provide a `--default-index`, and an index already has `default
= true`, we remove that entry, since it won't be used anymore.

We do _not_ pin packages to specific indexes yet.
2024-10-15 22:57:26 +00:00
Charlie Marsh
5b391770df
Add support for named and explicit indexes (#7481)
## Summary

This PR adds a first-class API for defining registry indexes, beyond our
existing `--index-url` and `--extra-index-url` setup.

Specifically, you now define indexes like so in a `uv.toml` or
`pyproject.toml` file:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
```

You can also provide indexes via `--index` and `UV_INDEX`, and override
the default index with `--default-index` and `UV_DEFAULT_INDEX`.

### Index priority

Indexes are prioritized in the order in which they're defined, such that
the first-defined index has highest priority.

Indexes are also inherited from parent configuration (e.g., the
user-level `uv.toml`), but are placed after any indexes in the current
project, matching our semantics for other array-based configuration
values.

You can mix `--index` and `--default-index` with the legacy
`--index-url` and `--extra-index-url` settings; the latter two are
merely treated as unnamed `[[tool.uv.index]]` entries.

### Index pinning

If an index includes a name (which is optional), it can then be
referenced via `tool.uv.sources`:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"

[tool.uv.sources]
torch = { index = "pytorch" }
```

If an index is marked as `explicit = true`, it can _only_ be used via
such references, and will never be searched implicitly:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
explicit = true

[tool.uv.sources]
torch = { index = "pytorch" }
```

Indexes defined outside of the current project (e.g., in the user-level
`uv.toml`) can _not_ be explicitly selected.

(As of now, we only support using a single index for a given
`tool.uv.sources` definition.)

### Default index

By default, we include PyPI as the default index. This remains true even
if the user defines a `[[tool.uv.index]]` -- PyPI is still used as a
fallback. You can mark an index as `default = true` to (1) disable the
use of PyPI, and (2) bump it to the bottom of the prioritized list, such
that it's used only if a package does not exist on a prior index:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
default = true
```

### Name reuse

If a name is reused, the higher-priority index with that name is used,
while the lower-priority indexes are ignored entirely.

For example, given:

```toml
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"

[[tool.uv.index]]
name = "pytorch"
url = "https://test.pypi.org/simple"
```

The `https://test.pypi.org/simple` index would be ignored entirely,
since it's lower-priority than `https://download.pytorch.org/whl/cu121`
but shares the same name.

Closes #171.

## Future work

- Users should be able to provide authentication for named indexes via
environment variables.
- `uv add` should automatically write `--index` entries to the
`pyproject.toml` file.
- Users should be able to provide multiple indexes for a given package,
stratified by platform:
```toml
[tool.uv.sources]
torch = [
  { index = "cpu", markers = "sys_platform == 'darwin'" },
  { index = "gpu", markers = "sys_platform != 'darwin'" },
]
```
- Users should be able to specify a proxy URL for a given index, to
avoid writing user-specific URLs to a lockfile:
```toml
[[tool.uv.index]]
name = "test"
url = "https://private.org/simple"
proxy = "http://<omitted>/pypi/simple"
```
2024-10-15 18:24:23 -04:00
samypr100
689611417b
chore(uv): more env var mappings (#8193)
## Summary

Small follow up to https://github.com/astral-sh/uv/pull/8151

## Test Plan

Existing tests
2024-10-15 07:59:03 -04:00
samypr100
01c44af3c3
chore: unify all env vars used (#8151)
## Summary

This PR declares and documents all environment variables that are used
in one way or another in `uv`, either internally, or externally, or
transitively under a common struct.

I think over time as uv has grown there's been many environment
variables introduced. Its harder to know which ones exists, which ones
are missing, what they're used for, or where are they used across the
code. The docs only documents a handful of them, for others you'd have
to dive into the code and inspect across crates to know which crates
they're used on or where they're relevant.

This PR is a starting attempt to unify them, make it easier to discover
which ones we have, and maybe unlock future posibilities in automating
generating documentation for them.

I think we can split out into multiple structs later to better organize,
but given the high influx of PR's and possibly new environment variables
introduced/re-used, it would be hard to try to organize them all now
into their proper namespaced struct while this is all happening given
merge conflicts and/or keeping up to date.

I don't think this has any impact on performance as they all should
still be inlined, although it may affect local build times on changes to
the environment vars as more crates would likely need a rebuild. Lastly,
some of them are declared but not used in the code, for example those in
`build.rs`. I left them declared because I still think it's useful to at
least have a reference.

Did I miss any? Are their initial docs cohesive?

Note, `uv-static` is a terrible name for a new crate, thoughts? Others
considered `uv-vars`, `uv-consts`.

## Test Plan

Existing tests
2024-10-14 16:48:13 -05:00
bluss
e67d87301a
Implement uv tree --no-dev (#8109)
## Summary

Allow pruning dev-dependencies in uv tree.
This is not inherently in conflict with --invert, but this pruning is
not yet implemented there.
2024-10-12 13:10:56 +00:00
Amos Wenger
715f28fd39
chore: Move all integration tests to a single binary (#8093)
As per
https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html

Before that, there were 91 separate integration tests binary.

(As discussed on Discord — I've done the `uv` crate, there's still a few
more commits coming before this is mergeable, and I want to see how it
performs in CI and locally).
2024-10-11 16:41:35 +02:00
Noam Teyssier
7bd0d97ce5
feat: add comma value-delimiter to with argument in tool run args to allow for multiple arguments in with flag (#7909)
This is to address my own issue #7908 

## Summary

This change makes use of the `clap` value_delimiter parser to populate
the `with` `Vec<String>` which currently can either only be empty or
with 1 value for each `--with` flag.

This makes use of the current code structure but allows for multiple
arguments with a single `--with` flag.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

Can be tested with the following CLI:

```bash
target/debug/uv tool run --with numpy,polars,matplotlib ipython -c "import numpy;import polars;import matplotlib;"
```

And former behavior of multiple `--with` flags are kept

```bash
target/debug/uv tool run --with numpy --with polars --with matplotlib ipython -c "import numpy;import polars;import matplotlib;"
```

<!-- How was it tested? -->

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-10-11 11:19:57 +02:00
Trevor Manz
585456a607
feat: Support remote scripts with uv run (#6375)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

First off, congratulations on the 0.3 release! The PEP 723 standalone
scripts support is awesome, and I can already imagine a long tail of
little scripts of my own that would benefit from this functionality.

## Background

I really like the Deno CLI's support for running and installing remote
scripts.

```
deno run <url>
```

```
deno install --name foo <url>
```

I can see parallels with `uv run` and `uvx`. After mentioning this on
Discord, @zanieb suggested I could take a stab at a PR to implement
similar functionality for uv.

## Summary

This PR attempts to add support for executing remote standalone scripts
directly with `uv run`. While this is already possible by downloading
the script (i.e., via curl/wget) and then using uv run, having direct
support would be convenient.

The proposed functionality is:

```sh
uv run <url>
```

Another addition/alternative could be to support running scripts via
stdin:

```sh
curl -sL <url> | uv run -
```

But that is not implemented in this PR.

## Test Plan

I noticed that GitHub and `files.pythonhosted.org` URLs are used in some
of the tests. I've created a personal [GitHub
Gist](https://gist.github.com/manzt/cb24f3066c32983672025b04b9f98d1f)
with the example from PEP 723 for now to test this functionality.

~However, I couldn't figure out how to get the `with_snapshot` config
filter to filter out the tempfile path, so the test is currently
failing. Any assistance with this would be appreciated.~

## Notes

I'm not totally pleased with the implementation of this PR. I think it
would be better to handle the case earlier (and probably reuse the
cache), and avoid mutation, but since run command requires a local path
this was the simplest implementation I could come up with.

I know that performance is paramount with uv so I totally understand if
this requires a different approach or something more explicit to avoid
"inferring" the path. I'm just taking this as an opportunity to learn a
little more Rust and acquaint myself with the code base. cheers!

---------

Co-authored-by: Andrew Gallant <jamslam@gmail.com>
2024-10-10 14:10:17 -04:00
Ahmed Ilyas
97af56a603
Support uv export --no-header (#8096)
## Summary

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

## Test Plan

`cargo test`
2024-10-10 17:17:44 +02:00
Charlie Marsh
46a0ed7fa2
Use comma-separated values for UV_FIND_LINKS (#8061)
## Summary

These values can include spaces when passed on the command-line... Clap
doesn't give us a way to provide a value separator for _only_ an
environment variable (as is pip's behavior), so I think we're stuck
using comma-separated for here right now.

See, e.g., https://github.com/clap-rs/clap/discussions/3796.

Closes #8057.
2024-10-09 23:05:51 +00:00
Ahmed Ilyas
1764a95d39
Support pip install --exact (#8044)
## Summary

Resolves #8041 

## Test Plan

`cargo test`
2024-10-09 15:31:28 +02:00
Jacob Coffee
e8b8d236a1
docs: add alias context to uv tool run --help command (#7695)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
- Adds detail to the `uv tool run --help` CLI that lets users know about
the shorthand, `uvx`

## Test Plan

<!-- How was it tested? -->
Building and running CLI
```
…📝✓] via 🐋 orbstack via 🎁 v0.4.16 via  pyenv via ⚙️ v1.81.0on ☁️  (us-east-2) took 3s 
➜ ./target/debug/uv tool run --help
Run a command provided by a Python package. Also available via the alias `uvx`.

Usage: uv tool run [OPTIONS] [COMMAND]

...

You can also use `uvx` as an alias for `uv tool run`. 
Use `uv help tool run` for more details.
```

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 21:43:50 +00:00
Kemal Akkoyun
1a39ffe391
uv run: List available scripts when a script is not specified (#7687)
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
## Summary

This PR adds the ability to list available scripts in the environment
when `uv run` is invoked without any arguments.
It somewhat mimics the behavior of `rye run` command
(See https://rye.astral.sh/guide/commands/run).

This is an attempt to fix #4024.

## Test Plan

I added test cases. The CI pipeline should pass.

### Manuel Tests

```shell
❯ uv run
Provide a command or script to invoke with `uv run <command>` or `uv run script.py`.

The following scripts are available:

normalizer
python
python3
python3.12

See `uv run --help` for more information.
```

---------

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 19:34:50 +00:00
konsti
282fab5f70
Hint at wrong endpoint in publish (#7872)
Improve hints when using the simple index URL instead of the upload URL
in `uv publish`. This is the most common confusion when publishing, so
we give it some extra care and put it more centrally in the CLI help.

Fixes #7860

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-10-08 19:16:02 +00:00
Jo
15e5e3f6af
Fill in authors filed during uv init (#7756)
## Summary

Fill in the `authors` field of `pyproject.toml` by fetching author info
from Git.

Resolves #7718
2024-10-08 14:06:37 -05:00
Krishnan Chandra
d73b25385f
Coerce empty string values to None for UV_PYTHON env var (#7878)
## Summary

Closes #7841. If there are other env vars that would also benefit from
this value parser, please let me know and I can add them to this PR.

## Test Plan

When running the same example from the linked issue, it now works:

```
UV_PYTHON= cargo run -- init x
   Compiling ...
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 29.06s
     Running `target/debug/uv init x`
Initialized project `x` at `/Users/krishnanchandra/Projects/uv/x`
```
2024-10-04 12:32:03 +01:00
Seth Morton
c591636dbe
Add UV_FIND_LINKS environment variable support for the --find-links command-line option (#7912)
## Summary

This PR adds support for the `UV_FIND_LINKS` environment variable as an
alternative to the `--find-links` command-line option, as requested in
#1839.

## Test Plan

A unit test was added to validate that setting `UV_FIND_LINKS` provided
the same result as a link provided with the `--find-links` command-line
option.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-10-04 11:30:49 +00:00
tfsingh
5ff7dc99cb
Support uv run --script (#7739)
This PR adds support for executing a script with ```uv run```, even when
the script does not have a ```.py``` extension. Addresses #7396.
2024-10-02 09:51:12 -05:00
Charlie Marsh
f0659e76cf
Rename install-wheel-rs library (#7855)
## Summary

I missed this one in the rename (the crate was renamed, but not the
library).
2024-10-01 20:45:39 -04:00
Charlie Marsh
14507a1793
Add uv- prefix to all internal crates (#7853)
## Summary

Brings more consistency to the repo and ensures that all crates
automatically show up in `--verbose` logging.
2024-10-01 20:15:32 -04:00
adisbladis
9f981c934a
Add UV_NO_SYNC environment variable (#7752)
## Summary

I have a workflow where I want use `uv` as a dependency solver only, and
manage my environments with external tooling (Nix).

## Test Plan

Manually tested. Automated testing seems excessive for such a trivial
change.

## Problems

It's still not as useful as I'd like it to be.
`uv` uncondtionally creates a virtual environment, something I would
expect that `--no-sync` should disable.
This looks a bit more tricky to achieve and I'm not sure about how to
best structure it.
2024-09-28 12:03:45 -04:00
Jo
0dbf9ae4a7
Support uv run -m foo to run a module (#7754)
## Summary

This is another attempt using `module: bool` instead of `module:
Option<String>` following #7322.
The original PR can't be reopened after a force-push to the branch, I've
created this new PR.

Resolves #6638
2024-09-28 10:07:21 -05:00
Ahmed Ilyas
805f1bd6f5
Add uv build --all option (#7724)
## Summary

Resolves #7705 

## Test Plan

`cargo test` and tested locally.

The snapshots were unstable due to the packages being built in a
non-deterministic order, so I used the quiet flag to suppress the
output.

Another question is whether we should label the build output to indicate
which package it belongs to?
2024-09-27 02:46:06 +00:00
Zanie Blue
ed1684a0e4
Add uv build --no-build-logs to silence the build backend logs (#7675)
Extends https://github.com/astral-sh/uv/pull/7674

The build backend can be pretty verbose, it seems nice to be able to
turn that off?
2024-09-26 23:39:47 +00:00
Jo
0c801f8f4b
Initialize a Git repository in uv init (#5476)
## Summary

Similiar to `cargo init --vcs <VCS>`, this PR adds the `--vcs <VCS>`
flag for `uv init`, allowing to create a version control system during
initialization. By default, `uv init` will create a Git repository if
the `--vcs` flag is not provided. Use `--vcs none` to disable this
feature.

Currently, only Git is supported. While Cargo also supports hg, pijul,
and fossil, this initial PR only includes Git. We can add more later if
there are any user requests.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-09-26 02:40:39 +00:00
tfsingh
6e9ecde9c2
Add support for uv init --script (#7565)
This PR adds support for ```uv init --script```, as defined in issue
#7402 (started working on this before I saw jbvsmo's PR). Wanted to
highlight a few decisions I made that differ from the existing PR:

1. ```--script``` takes a path, instead of a path/name. This potentially
leads to a little ambiguity (I can certainly elaborate in the docs,
lmk!), but strictly allowing ```uv init --script path/to/script.py```
felt a little more natural than allowing for ```uv init --script path/to
--name script.py``` (which I also thought would prompt more questions
for users, such as should the name include the .py extension?)
2. The request is processed immediately in the ```init``` method,
sharing logic in resolving which python version to use with ```uv add
--script```. This made more sense to me — since scripts are meant to
operate in isolation, they shouldn't consider the context of an
encompassing package should one exist (I also think this decision makes
the relative codepaths for scripts/packages easier to follow).
3. No readme — readme felt a little excessive for a script, but I can of
course add it in!

---------

Co-authored-by: João Bernardo Oliveira <jbvsmo@gmail.com>
2024-09-25 22:48:01 +00:00
tfsingh
106633a5e5
Add support for upgrading Python in tool environments (#7605)
This PR adds support for upgrading the build environment of tools with
the addition of a ```--python``` argument to ```uv upgrade```, as
specified in #7471.

Some things to note:
- I added support for individual packages — I didn't think there was a
good reason for ```--python``` to only apply to all packages
- Upgrading with ```--python``` also upgrades the package itself — I
think this is fair as if a user wants to _strictly_ switch the version
of Python being used to build a tool's environment they can use ```uv
install```. This behavior can of course be modified if others don't
agree!

Closes https://github.com/astral-sh/uv/issues/6297.

Closes https://github.com/astral-sh/uv/issues/7471.
2024-09-25 17:40:28 +00:00
konsti
c4c5378c0b
Add build backend scaffolding (#7662) 2024-09-24 19:23:17 +02:00
Zanie Blue
0c6117f5da
Unhide the --directory option (#7653) 2024-09-24 11:45:33 -05:00
konsti
205bf8cabe
Implement trusted publishing (#7548)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-09-24 16:07:20 +00:00
konsti
1995d20298
Add uv publish: Basic upload with username/password or keyring (#7475)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-09-24 15:33:06 +00:00
Huang, Hong-Chang
63b60bc0c8
Remove double whitespaces from the code (#7623)
Co-authored-by: konstin <konstin@mailbox.org>
2024-09-23 20:15:06 +00:00
Charlie Marsh
35d6274c31
Add a --project argument to run a command from a project (#7603)
## Summary

`uv run --project ./path/to/project` now uses the provided directory as
the starting point for any file discovery. However, relative paths are
still resolved relative to the current working directory.

Closes https://github.com/astral-sh/uv/issues/5613.
2024-09-21 20:19:49 +00:00
bluss
7a25a82fc9
Move uvx shell completion to uvx --generate-shell-completion (#7511)
## Summary

Because a problem was found with Powershell and combining the generated
completion scripts for uv and uvx, let's try separating uv and uvx
command completion scripts.

The generated powershell script template can be seen in clap_complete
source, and it starts with `using` directives, which makes it impossible
(apparently) to concatenate two of those script outputs.

As a side effect, this is available under `uv tool run
--generate-shell-completion` too.

Fixes #7482

## Test Plan

- `eval "$(cargo run --bin uvx -- --generate-shell-completion bash)"`
- Test Powershell
2024-09-20 01:27:25 +00:00
Charlie Marsh
fda227616c
Allow users to provide pre-defined metadata for resolution (#7442)
## Summary

This PR enables users to provide pre-defined static metadata for
dependencies. It's intended for situations in which the user depends on
a package that does _not_ declare static metadata (e.g., a
`setup.py`-only sdist), and that is expensive to build or even cannot be
built on some architectures. For example, you might have a Linux-only
dependency that can't be built on ARM -- but we need to build that
package in order to generate the lockfile. By providing static metadata,
the user can instruct uv to avoid building that package at all.

For example, to override all `anyio` versions:

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["anyio"]

[[tool.uv.dependency-metadata]]
name = "anyio"
requires-dist = ["iniconfig"]
```

Or, to override a specific version:

```toml
[project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = ["anyio"]

[[tool.uv.dependency-metadata]]
name = "anyio"
version = "3.7.0"
requires-dist = ["iniconfig"]
```

The current implementation uses `Metadata23` directly, so we adhere to
the exact schema expected internally and defined by the standards. Any
entries are treated similarly to overrides, in that we won't even look
for `anyio@3.7.0` metadata in the above example. (In a way, this also
enables #4422, since you could remove a dependency for a specific
package, though it's probably too unwieldy to use in practice, since
you'd need to redefine the _rest_ of the metadata, and do that for every
package that requires the package you want to omit.)

This is under-documented, since I want to get feedback on the core ideas
and names involved.

Closes https://github.com/astral-sh/uv/issues/7393.
2024-09-18 03:18:05 +00:00
kyoto7250
e5dd67f58e
Add support for --with-editable to uv tool (#6744)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary
<!-- What's the purpose of the change? What does it do, and why? -->
close #6272 

## Test Plan
<!-- How was it tested? -->
As in https://github.com/astral-sh/uv/pull/6262

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-09-17 20:51:34 +00:00
Charlie Marsh
778da3350a
Add --no-editable support to uv sync and uv export (#7371)
## Summary

Closes https://github.com/astral-sh/uv/issues/5792.
2024-09-17 14:50:36 +00:00
Charlie Marsh
c87ce7aaf8
Run cargo upgrade (#7448)
Co-authored-by: konstin <konstin@mailbox.org>
2024-09-17 12:39:58 +02:00
bluss
e9378be919
Generate shell completion for uvx (#7388)
## Summary

Generate shell completion for uvx.

Create a `uvx` toplevel command just for completion by combining `uv
tool uvx` (hidden alias for `uv tool run`) with global arguments. This
explicit combination is needed otherwise global arguments are missing
(if they are missing, clap debug assertions fail when `uv tool run`
arguments refer to global arguments in directives like conflicts with).


Fixes #7258 

## Test Plan

- Tested using bash using `eval "$(cargo run --bin uv
generate-shell-completion bash)"`
2024-09-17 03:27:19 +00:00
Charlie Marsh
5f2e536925
Add support for --only-dev to uv sync and uv export (#7367)
## Summary

Closes https://github.com/astral-sh/uv/issues/7255.

Closes https://github.com/astral-sh/uv/issues/6472.
2024-09-16 20:06:20 +00:00
Nathan McDougall
f82224124e
Fix grammatical error in CLI docs (#7353)
Fixing a grammatical error in the CLI docs, namely `in adhere with` ->
`in adherence with`.
2024-09-13 15:51:59 +00:00
Frost Ming
e1e85ab4c8
feat(cli): add --token option to self update command (#7279)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

It often reaches the GitHub API rate limit and shows error like `error:
HTTP status client error (403 Forbidden) for url
(https://api.github.com/repos/astral-sh/uv/releases)` when running `uv
self update`.

To bypass this rate limit issue, allow user to pass a GitHub token via
`--token` or `UV_GITHUB_TOKEN` env.

## Test Plan

<!-- How was it tested? -->

---------

Signed-off-by: Frost Ming <me@frostming.com>
2024-09-12 14:27:54 -05:00
Aditya Pratap Singh
adcb67a882
Fix documentation typos for uv build --build-constraint flag (#7330)
Summary

This pull request fixes a typo in the --build-constraints flag, which
should be singular (--build-constraint). This update ensures consistency
across the documentation and prevents potential confusion for users.

Closes #7315

## Test Plan
The change was verified by reviewing the relevant documentation files
where the flag is referenced. No functional code changes were made, so
no additional testing is required beyond confirming the documentation
update.

## Tested
The change was tested by visually inspecting the updated documentation
to confirm that the typo has been corrected
2024-09-12 14:07:33 -05:00
Charlie Marsh
3f011f3b7b
Add uv run --no-sync (#7192)
## Summary

When `--no-sync` is provided, we won't lock or sync, but we will run the
command in the project environment.

Closes https://github.com/astral-sh/uv/issues/7165.
2024-09-10 17:29:43 -04:00
Ahmed Ilyas
bbccee8bee
Allow setting a target version for uv self update (#7252)
## Summary

Resolves #6642 

## Test Plan

```console
❯ cargo build --bin uv --features self-update
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.78s
❯ cp target/debug/uv ~/.cargo/bin
❯ uv self update 0.3.4
info: Checking for updates...
success: Upgraded uv from v0.4.8 to v0.3.4! https://github.com/astral-sh/uv/releases/tag/0.3.4
❯ uv --version
uv 0.3.4 (39f3cd2a9 2024-08-26)
❯ cp target/debug/uv ~/.cargo/bin
❯ uv self update
info: Checking for updates...
success: Upgraded uv from v0.3.4 to v0.4.8! https://github.com/astral-sh/uv/releases/tag/0.4.8
❯ uv --version
uv 0.4.8 (956cadd1a 2024-09-09)
```
2024-09-10 13:35:31 +00:00
Mathieu Kniewallner
8341d810b2
docs: list supported sdist formats (#7168)
## Summary

Explicitly list the formats and extensions that uv supports, based on
[this
list](86ee8d2c01/crates/distribution-filename/src/extension.rs (L70-L77)).
Not a huge fan of adding the section in `concepts/resolution.md`, but I
did not find a better place. Alternatively we could maybe add a
dedicated page that shortly explains Python package types (wheels,
sdists), where such a section could live?

## Test Plan

Local run of the documentation.
2024-09-07 19:16:12 +00:00
Janosh Riebesell
e96eb946f9
Fix typo aaarch64->aarch64 (#7141)
copy pasted `--python-platform aaarch64-unknown-linux-gnu` [from the
docs](https://docs.astral.sh/uv/reference/cli/#uv-pip-compile) and got

> error: invalid value 'aaarch64-unknown-linux-gnu' for
'--python-platform <PYTHON_PLATFORM>'
> [possible values: windows, linux, macos, x86_64-pc-windows-msvc,
i686-pc-windows-msvc, x86_64-unknown-linux-gnu, aarch64-apple-darwin,
x86_64-apple-darwin, aarch64-unknown-linux-gnu,
aarch64-unknown-linux-musl, x86_64-unknown-linux-musl,
x86_64-manylinux_2_17, x86_64-manylinux_2_28, x86_64-manylinux_2_31,
aarch64-manylinux_2_17, aarch64-manylinux_2_28, aarch64-manylinux_2_31]
> 
>   tip: a similar value exists: 'aarch64-unknown-linux-gnu'
2024-09-06 23:25:46 +00:00
Zanie Blue
1422e18674
Fixup comment for export --output-file (#7111) 2024-09-05 20:18:39 -05:00