Charlie Marsh
fff3a7d8f9
Always accept already-installed pre-releases ( #5419 )
...
## Summary
If a pre-release is already installed, we should allow it to be used
even if it doesn't match the strategy.
Closes https://github.com/astral-sh/uv/issues/5418 .
2024-07-24 19:23:14 +00:00
Jo
7bcafec778
Add uv init --virtual ( #5396 )
...
## Summary
Add `uv init --virtual` to create an explicit virtual workspace.
Relates to #5338
2024-07-24 18:52:33 +00:00
Andrew Gallant
ac614ee70f
uv/tests: tweak cache clean all test
...
The test asserts that 28 files were removed. But on my system, 27 files
are removed.
This PR is first about debugging what the difference is (since CI
presumably passes with the status quo snapshot). And then I'm thinking
the right way to fix the test failure is with a filter that replaces the
specific number of files removed (limited to what we know to be
correct) with a placeholder.
2024-07-24 10:41:33 -07:00
Charlie Marsh
9c9510c9ef
Ignore hidden directories in workspace discovery ( #5408 )
...
## Summary
This is surprisingly complex because we need to decide what happens if
you run `uv run` from within a hidden folder, etc. For now, I did the
simplest thing: we just ignore workspace members that are hidden
directories if they lack a `pyproject.toml`, so you can still include
hidden members, they're just ignored if they don't seem to be projects.
Closes https://github.com/astral-sh/uv/issues/5403 .
2024-07-24 16:21:34 +00:00
Charlie Marsh
22db997240
Always show lock updates in uv lock ( #5413 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5412 .
2024-07-24 15:54:18 +00:00
Charlie Marsh
3d36b71ab1
Show additions and removals in uv lock updates ( #5410 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5401 .
2024-07-24 15:33:09 +00:00
Zanie Blue
eef7a78d7e
Omit interpreter path from output when using managed Python ( #5313 )
...
Extending https://github.com/astral-sh/uv/pull/5311 to the project API
2024-07-24 10:19:12 -05:00
Trevor Manz
d642705104
Omit empty uv.tool.dev-dependencies on uv init ( #5406 )
...
<!--
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
Implements #5340
## Test Plan
<!-- How was it tested? -->
2024-07-24 09:53:49 -05:00
Charlie Marsh
cf971a86d7
Remove resolved TODO in uv run ( #5407 )
2024-07-24 09:54:16 -04:00
konsti
9b12fcb90d
Remove outdated DistributionWire serde annotations ( #5400 )
...
This struct doesn't implement `serde::Serialize`, the annotations are
dead.
2024-07-24 15:30:58 +02:00
Charlie Marsh
82f4864386
Ignore Ctrl-C signals in uv run and uv tool run ( #5395 )
...
## Summary
This is a bit simpler than #5333 , but seems to work in my testing on
macOS and Windows. It's based on implementations that I found in
[Pixi](https://github.com/prefix-dev/pixi/blob/36f1bb297db04337172510f41e5b03d7da13c49f/src/cli/exec.rs#L99 )
and
[Wasmer](https://github.com/wasmerio/wasmer/blob/49e60af8df31015cadee063c0e4618b81573fec2/lib/wasix/src/state/builder.rs#L1058 ).
Closes https://github.com/astral-sh/uv/issues/5257 .
## Test Plan
On both macOS and Windows:
- `cargo run -- tool run --from jupyterlab jupyter-lab` -- hit Ctrl-C;
verify that the process exits and the terminal is left in a good state.
- `cargo run -- run python` -- hit Ctrl-C; verify that the process does
_not_ exit, but does on Ctrl-D.
2024-07-24 08:33:10 -04:00
konsti
20018cd0fc
Add two ForkState methods ( #5404 )
...
Small refactoring split out of the instability work. No functional
changes.
2024-07-24 12:09:33 +00:00
konsti
6d34f53ee5
Update Resolution docs ( #5402 )
...
They didn't reflect the recent nodes/edges changes.
2024-07-24 11:39:48 +00:00
Jo
62e72f51ff
Remove an extra quote in sync-python-releaes.yml ( #5393 )
2024-07-24 02:53:00 +00:00
Jo
17d63b0e07
Update python-build-standalone workflow ( #5390 )
...
## Summary
After #5337 , `fetch-download-metadata.py` fetches not just from
`python-build-standalone`, so updates the workflow to
`sync-python-releases.yml`.
Also includes `crates/uv-python/download-metadata.json` in `add-paths`.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev >
2024-07-24 02:11:52 +00:00
Charlie Marsh
41b699e7ac
Add warning to --link-mode=symlink documentation ( #5387 )
2024-07-23 22:35:56 +00:00
Zanie Blue
3822a43560
Fix blurring from nav title box shadow ( #5374 )
...
Fixes blur noted in https://github.com/astral-sh/uv/pull/5316 but
doesn't drop the title entirely.
https://github.com/astral-sh/uv/pull/5316 is my preferred design, if the
implementation was cost-free.
<img width="1259" alt="Screenshot 2024-07-23 at 3 53 48 PM"
src="https://github.com/user-attachments/assets/6f9b828b-884f-447d-8508-ba4023152e2f ">
(nothing to see at the rest of the breakpoints >1220)
<img width="1259" alt="Screenshot 2024-07-23 at 3 53 56 PM"
src="https://github.com/user-attachments/assets/b892cd76-cd91-4e78-b8c8-58e16a8b1130 ">
2024-07-23 17:33:57 -05:00
Zanie Blue
499b035c8e
Increase padding between each nav section ( #5373 )
...
<img width="1259" alt="Screenshot 2024-07-23 at 3 46 45 PM"
src="https://github.com/user-attachments/assets/dae4df4e-cea3-41a2-842c-652b4f9ca014 ">
<img width="1259" alt="Screenshot 2024-07-23 at 3 46 53 PM"
src="https://github.com/user-attachments/assets/b0751c4b-80bb-4344-816c-e23d5e45f0e4 ">
<img width="1259" alt="Screenshot 2024-07-23 at 3 46 57 PM"
src="https://github.com/user-attachments/assets/1cea6223-2757-49a0-9b87-1961f9bbd17b ">
<img width="1259" alt="Screenshot 2024-07-23 at 3 47 10 PM"
src="https://github.com/user-attachments/assets/a41061c6-f198-45ca-91b6-423f46375089 ">
2024-07-23 17:31:12 -05:00
Charlie Marsh
2271486e0e
Skip 'Nothing to uninstall' message when removing dangling environments ( #5382 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5379 .
2024-07-23 18:28:22 -04:00
Charlie Marsh
ad4a15d0c2
Allow symlinks to files in scripts directory ( #5380 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5359 .
## Test Plan
Unfortunately, the only packages I know of that use this are Ruff and
uv, and both are too heavy to install in a recurring test, so:
`uv tool install hatch==1.12.0 --with uv==0.2.27 --force
--link-mode=symlink`
2024-07-23 22:24:43 +00:00
Charlie Marsh
8942ec36c0
Mark --raw-sources as conflicting with sources-specific arguments ( #5378 )
...
## Summary
We should error on, e.g., `--raw-sources --tag 0.0.1`.
2024-07-23 22:03:01 +00:00
Charlie Marsh
76566b09be
Reject Git CLI arguments with non-Git sources ( #5377 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5335 .
2024-07-23 21:48:50 +00:00
Zanie Blue
aced05d427
Use the docs bot email for docs publish commits ( #5369 )
2024-07-23 16:04:12 -05:00
Charlie Marsh
4863ec8b5b
Allow uv init in unmanaged projects ( #5372 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5368 .
2024-07-23 16:51:30 -04:00
Charlie Marsh
c271eda6b6
Retain dependency specifier in uv add with sources ( #5370 )
...
## Summary
Only clear the version if it's a URL.
Closes https://github.com/astral-sh/uv/issues/5339 .
2024-07-23 16:48:41 -04:00
Charlie Marsh
25c7599030
Warn on requirements.txt-provided arguments in uv run et al ( #5364 )
...
## Summary
Also applies to `uv tool run` and `uv tool install`.
Closes https://github.com/astral-sh/uv/issues/5349 .
2024-07-23 16:34:01 -04:00
Charlie Marsh
ada2b2bc29
Pre-populate authentication sources in Project and Tools APIs ( #5367 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5366 .
2024-07-23 16:33:53 -04:00
Zanie Blue
7908436a76
Display Python installation key for discovered interpreters ( #5365 )
...
> DEBUG Found `cpython-3.12.1-macos-aarch64-none` at
`/Users/zb/Library/Application
Support/uv/python/cpython-3.12.1-macos-aarch64-none/bin/python3`
(managed installations)
Instead of `<implementation> <version>`
> DEBUG Found cpython 3.12.1 at `/Users/zb/Library/Application
Support/uv/python/cpython-3.12.1-macos-aarch64-none/bin/python3`
(managed installations)
2024-07-23 15:29:15 -05:00
Charlie Marsh
2cdcc61da9
Support requirements.txt files in uv tool install and uv tool run ( #5362 )
...
## Summary
Closes https://github.com/astral-sh/uv/issues/5347 .
Closes https://github.com/astral-sh/uv/issues/5348 .
2024-07-23 20:06:17 +00:00
Jo
7ddf67a72b
Add PyPy finder ( #5337 )
...
## Summary
This PR adds PyPy finder and adds PyPy to uv managed Python versions.
## Test Plan
```console
$ cargo run -- python install
```
2024-07-23 14:58:04 -05:00
Jo
96b24345eb
Allow comments in .python-version[s] ( #5350 )
...
## Summary
Do the same thing as https://github.com/astral-sh/rye/pull/1038 .
2024-07-23 14:56:50 -05:00
Zanie Blue
6fe9bd8a80
Omit interpreter path during uv venv with managed Python ( #5311 )
...
e.g.
```
❯ cargo run -q -- venv --preview
Using Python 3.12.1
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
```
instead of
```
❯ cargo run -q -- venv --preview
Using Python 3.12.1 interpreter at: /Users/zb/Library/Application Support/uv/python/cpython-3.12.1-macos-aarch64-none/bin/python3
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
```
2024-07-23 14:20:23 -05:00
Zanie Blue
3a85353707
Bump version to 0.2.28 ( #5363 )
2024-07-23 14:04:55 -05:00
Zanie Blue
dac696e950
Bundle of documentation changes ( #5307 )
...
Following #5239
2024-07-23 13:29:59 -05:00
Zanie Blue
b2a21468ee
Add recommendation to use title to style guide ( #5361 )
2024-07-23 13:24:50 -05:00
Jo
68c27cbd06
Avoid project discovery in uv python pin if --isolated is provided ( #5354 )
...
## Summary
Instead of discovering and then discarding, try to avoid unnecessary
discovery.
2024-07-23 13:07:25 -05:00
Zanie Blue
3e067766de
Stylize Requires-Python consistently ( #5304 )
2024-07-23 18:05:21 +00:00
Charlie Marsh
07d038b90c
Add tests for uv cache clean ( #5356 )
2024-07-23 18:03:02 +00:00
Zanie Blue
337a1c2083
Add a style guide ( #5209 )
...
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com >
2024-07-23 12:57:32 -05:00
Charlie Marsh
097acb628d
Remove Simple API cache files for alternative indexes in cache clean ( #5353 )
...
## Summary
The `simple-v9` directory was missing the `index` segment. See before:

And after:

Every other bucket has this `index` segment for non-PyPI indexes, e.g.:

Closes https://github.com/astral-sh/uv/issues/5352 .
2024-07-23 13:42:51 -04:00
Zanie Blue
5f1f9c8293
Add support for requirements files in uv run ( #4973 )
...
Closes https://github.com/astral-sh/uv/issues/4824 .
---------
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com >
2024-07-23 12:51:09 -04:00
Zanie Blue
49ea4a7a91
Reduce spacing between nav items ( #5310 )
...
**Before**
<img width="1475" alt="Screenshot 2024-07-22 at 3 56 46 PM"
src="https://github.com/user-attachments/assets/a9c6b929-0569-45a6-9840-d49d955dd55a ">
--------
**After**
<img width="1475" alt="Screenshot 2024-07-22 at 3 56 38 PM"
src="https://github.com/user-attachments/assets/98c85e03-fe62-4894-99f6-a49293eacf0b ">
2024-07-23 11:50:00 -05:00
Charlie Marsh
8ebc0d56c7
Fix failing prerelease tests ( #5346 )
...
## Summary
Likely due to simultaneous merge.
2024-07-23 12:45:55 -04:00
eth3lbert
e05d653a71
Show symbolic links in uv python list ( #5343 )
...
## Summary
This PR displays symbolic links in `uv python list` and produces output
similar to the following:
```
:) uv python list --preview
cpython-3.12.1-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python3.12 -> versions/cpython@3.12 .1/install/bin/python3
cpython-3.12.1-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python3 -> versions/cpython@3.12 .1/install/bin/python3
cpython-3.12.1-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python -> versions/cpython@3.12 .1/install/bin/python3
cpython-3.11.7-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python3.11 -> versions/cpython@3.11 .7/install/bin/python3
cpython-3.10.13-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python3.10 -> versions/cpython@3.10.13/install/bin/python3
cpython-3.9.18-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python3.9 -> versions/cpython@3.9.18/install/bin/python3
cpython-3.8.18-macos-aarch64-none /Users/eth/workspace/astral-sh/uv/bin/python3.8 -> versions/cpython@3.8.18/install/bin/python3
```
Resolves #5308
## Test Plan
```
$ cargo run python list
```
2024-07-23 11:41:29 -05:00
Charlie Marsh
0f8186d9ad
Add requires-python to uv init ( #5322 )
...
## Summary
Prefers, in order:
- The major-minor version of an interpreter discovered via `--python`.
- The `requires-python` from the workspace.
- The major-minor version of the default interpreter.
If the `--python` request is a version or a version range, we use that
without fetching an interpreter.
Closes https://github.com/astral-sh/uv/issues/5299 .
2024-07-23 16:02:40 +00:00
Ibraheem Ahmed
c8ac8ee57a
Allow conflicting prerelease strategies when forking ( #5150 )
...
## Summary
Similar to https://github.com/astral-sh/uv/pull/5232 , we should also
track prerelease strategies per-fork, instead of globally per package.
The common functionality for tracking locals and prerelease versions
across forks is extracted into the `ForkMap` type.
Resolves https://github.com/astral-sh/uv/issues/4579 . This doesn't quite
solve https://github.com/astral-sh/uv/issues/4959 , as that issue relies
on overlapping markers.
2024-07-23 11:57:14 -04:00
konsti
bea8bc6c61
Stable sorting of requirements.txt in universal mode ( #5334 )
...
The `RequirementsTxtComparator` was written assuming there is one
distribution per package name. This changed with the universal
resolution, which allows multiple versions or urls for the same package
name. The sorting we emitted for these new entries was incidental.
With this change, we properly sort these entries by name, version and
then url in universal mode.
This is an output format change for `--universal` users.
2024-07-23 16:46:32 +02:00
Jo
43084249ee
Add mypy type check for uv-python scripts ( #5332 )
...
## Summary
Per https://github.com/astral-sh/uv/pull/4853#issuecomment-2212505407
> If we're going to aim for full type coverage, we should probably
follow this by adding type checking in CI too otherwise it seems too
easy for it to become out of date.
2024-07-23 09:14:05 -05:00
Jo
025f2f3162
Fix python-build-standalone workflow ( #5327 )
...
## Summary
The script reads `GITHUB_TOKEN` instead. And since #4853 merged, there
is no need to use `uv run --with`.
2024-07-23 08:20:36 -04:00
eth3lbert
df7a733e51
Fix uv init . ( #5330 )
...
## Summary
This PR avoids an `Invalid package name` error that occurs when using
`uv init .`. This is achieved by slightly reorganizing the code block to
determine the name after the path is canonicalized. The dot path is
expanded to the current directory, and the `file_name` then works as
expected.
Resolve #5329 .
---------
Co-authored-by: konstin <konstin@mailbox.org >
2024-07-23 08:20:13 -04:00