Commit graph

2988 commits

Author SHA1 Message Date
Jp
2bfc450418
Parses wheels WHEEL and METADATA files content as email messages (#6616)
## Summary

Fixes: #6615 
Currently, some packages are not installable with `uv`, like `ziglang`
on Linux.
Everything is described in the issue! 😄 

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

## Test Plan

<!-- How was it tested? -->
I added a unit test for the problematic use case.
I also checked that previous unit test are still running in order to
ensure the backward compatibility.
2024-08-25 18:31:07 -04:00
Charlie Marsh
069b021e0f
Update lockfile after setting minimum bounds in uv add (#6618)
## Summary

If we update the project requirements, we _also_ need to update the
lockfile.

Closes https://github.com/astral-sh/uv/issues/6614.
2024-08-25 21:04:25 +00:00
Charlie Marsh
1c580723c5
Support PEP 723 scripts in GUI files (#6611)
## Summary

Just an oversight.
2024-08-25 16:08:52 +00:00
Charlie Marsh
5076f325cd
Add --refresh to tool run warning for --with dependencies (#6609)
## Summary

Closes https://github.com/astral-sh/uv/issues/6576.
2024-08-25 11:15:41 -04:00
Charlie Marsh
5b3e654dc9
Show --editable on the uv add CLI (#6608)
## Summary

`false` is the default, so like other booleans, we should show the
non-default.
2024-08-25 15:01:39 +00:00
Charlie Marsh
d0198abc10
Respect --no-build-isolation-package in uv sync (#6605)
## Summary

This was an oversight. The existing test was (correctly) failing, but
for the wrong reason (failing to build the package during _resolution_).
2024-08-25 14:15:13 +00:00
Charlie Marsh
0dc74f619c
Remove path-absolutize dependency (#6589)
## Summary

This is now in the standard library.
2024-08-25 12:01:07 +00:00
Charlie Marsh
7fa265a11b
Use relative paths for --find-links and local registries (#6566)
## Summary

See: https://github.com/astral-sh/uv/issues/6458
2024-08-25 02:41:47 +00:00
Charlie Marsh
3902bb498d
Fix lock_requires_python fixture (#6594) 2024-08-24 18:45:03 -04:00
Charlie Marsh
31019ff140
Use logger interface for remaining audit messages (#6586) 2024-08-24 16:46:41 +00:00
Charlie Marsh
1fc45db082
Fix flaky HTTP redact test (#6583) 2024-08-24 13:49:29 +00:00
Charlie Marsh
8ee53a9e38
Clarify need to include pyproject.toml with --no-install-project (#6581)
## Summary

See: https://github.com/astral-sh/uv/issues/6573
2024-08-24 09:45:23 -04:00
Charlie Marsh
1eb97c91fd
Remove FileLocation::Path variant (#6577)
## Summary

This is redundant now that we support `file://` URLs.
2024-08-24 07:52:43 -04:00
Zanie Blue
2f94422484
Fix basic authentication tests to reflect proxy changes (#6569)
Updates the snapshot for the deployment from
https://github.com/astral-sh/pypi-proxy/pull/9 — for a while now, we've
only been failing on file requests not registry requests because the
proxy auth was setup wrong.
2024-08-24 05:59:14 +00:00
Charlie Marsh
f7835243c5
Only use relative paths in lockfile (#6490)
For users who were using absolute paths in the `pyproject.toml`
previously, this is a behavior change: We now convert all absolute paths
in `path` entries to relative paths. Since i assume that no-one relies
on absolute path in their lockfiles - they are intended to be portable -
I'm tagging this as a bugfix.

Closes https://github.com/astral-sh/uv/pull/6438
Fixes https://github.com/astral-sh/uv/issues/6371
2024-08-23 22:19:10 -04:00
Charlie Marsh
611a9003c9
Don't canonicalize paths to user requirements (#6560) 2024-08-24 02:02:14 +00:00
Charlie Marsh
44e36a7e69
Store test temporary directories outside of /tmp (#6559)
## Summary

There's a long comment inline describing the motivation here.
2024-08-24 01:51:32 +00:00
Zanie Blue
deea6025a1
Bump version to 0.3.3 (#6558) 2024-08-23 18:35:55 -05:00
Charlie Marsh
3edf219882
Ignore errors in workspace discovery with --no-project (#6554)
## Summary

Closes https://github.com/astral-sh/uv/issues/6550.
2024-08-23 18:04:38 -05:00
Zanie Blue
c46ef0c68d
Update transformers test case (#6557)
cc @BurntSushi I'm not sure why this changed
1053333613/attempts/1
2024-08-23 18:04:27 -05:00
Charlie Marsh
b149cbe634
Remove --preview from tests (#6536)
Closes https://github.com/astral-sh/uv/issues/6532.
2024-08-23 18:12:07 -04:00
Zanie Blue
6cf5d13183
Include virtual environment interpreters in uv python find (#6521)
Previously, we excluded these and only looked at system interpreters.
However, it makes sense for this to match the typical Python discovery
experience. We could consider swapping the default... I'm not sure what
makes more sense. If we change the default (as written now) — this could
arguably be a breaking change.
2024-08-23 21:06:57 +00:00
Zanie Blue
d1cbcb30e3
Add uv sync --no-install-package to skip installation of specific packages (#6540)
Extends #6538 / #6539
See #4028

Allows excluding arbitrary packages from the sync.
2024-08-23 20:48:04 +00:00
Zanie Blue
ca50243174
Add uv sync --no-install-workspace to skip installation of all workspace members (#6539)
Extends #6538
See #4028

Another version of https://github.com/astral-sh/uv/pull/6398
2024-08-23 20:39:33 +00:00
Zanie Blue
be1599ebf6
Add uv sync --no-install-project to skip installation of the project (#6538)
See #4028

A smaller version of https://github.com/astral-sh/uv/pull/6398

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-08-23 20:19:47 +00:00
Zanie Blue
80b5384a4d
Set VIRTUAL_ENV for uv run invocations (#6543)
If we don't do this, and `uv run` invokes something like `uv run
--isolated uv pip install foo` uv won't mutate the isolated environment,
it'll mutate whatever outer environment it finds.
2024-08-23 20:03:38 +00:00
Charlie Marsh
9d1cd8e48c
Add UV_COMPILE_BYTECODE environment variable (#6530)
## Summary

Closes https://github.com/astral-sh/uv/issues/6493.
2024-08-23 18:05:32 +00:00
T-256
d0dda3798d
docs: Use proper environment variables for Windows (#6433)
ref: https://github.com/astral-sh/uv/issues/6397#issuecomment-2304512872
2024-08-23 13:04:08 -05:00
Thomas Quillan
429e6e61a8
Revert changes to pyproject.toml when sync fails duing uv add (#6526)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
This is a attempt at fixing https://github.com/astral-sh/uv/issues/6486.
It reverts changes made to `pyproject.toml` when sync fails during `uv
add`. This solution felt a little heavy handed and could probably be
improved but it is what happens when locking fails during `uv add` so I
thought it would be a good start.

## Test Plan

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

I have added a test case for this to `tests/edit.rs`. It uses
`pytorch==1.0.2` to achieve the desired failure.
2024-08-23 13:54:33 -04:00
Zanie Blue
4cdca06db2
Add --no-project alias for uv python pin --no-workspace (#6514)
This matches the other interfaces and seems like an oversight.
2024-08-23 16:08:27 +00:00
Charlie Marsh
57f833c302
Respect - as stdin channel for uv run (#6481)
## Summary

Closes https://github.com/astral-sh/uv/issues/6467.
2024-08-23 11:49:56 -04:00
Zanie Blue
01fc233dd0
Ignore .python-version files in uv venv with --no-config (#6513)
Dupe of  #6373 — merged into the wrong branch by accident.
2024-08-23 13:56:11 +00:00
Mathieu Kniewallner
7edd78c797
feat(self-update): show old version in update message (#6473)
## Summary

Indicate the previous version from which uv was upgraded when running
`uv self update`. Thought that it could be useful in some situations to
have a trace of the previous version that was installed.

## Test Plan

Did not find a way to test this, since this heavily relies on being able
to use the installation script and the ability to publish artifacts for
a specific tag.
2024-08-23 07:55:47 -05:00
Sofie Van Landeghem
665650fe2e
Two small typo fixes (#6500)
<!--
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

Two small typo fixes: one in the documentation and one in a comment in
the source code I happened to come across.
2024-08-23 12:13:36 +02:00
konsti
d8c41481ec
Fix generated docs (#6496)
Follow-up to #6494
2024-08-23 07:45:39 +00:00
Charlie Marsh
c5440001ce
Bump version to v0.3.2 (#6483) 2024-08-23 03:11:23 +00:00
Charlie Marsh
9b42142fe7
Avoid overwriting symlinks in pip compile output (#6487)
## Summary

Closes https://github.com/astral-sh/uv/issues/6485.
2024-08-23 02:54:45 +00:00
Charlie Marsh
be8ad0c507
Restore cache suffix on Windows cache path (#6482)
## Summary

We accidentally changed the Windows cache directory from
`C:\Users\User\AppData\Local\uv\cache` to
`C:\Users\User\AppData\Local\uv` in v0.3.0. We're considering this a
bug, since it does _not_ match the documentation, and prior to v0.3.0,
we always used the former. This PR migrates back to the previous
location. It should be seamless for users, as we move the cache items to
the new location on startup.

Closes https://github.com/astral-sh/uv/issues/6417.
2024-08-22 22:04:57 -04:00
Zanie Blue
34dd8401ed
Fix retrieval of credentials for URLs from cache (#6452)
While working on https://github.com/astral-sh/uv/pull/6389 I discovered
we never checked `cache.get_url` here, which is wrong — though I don't
think it had much effect in practice since the realm would typically
match first. The main problem is that when we call `get_url` later we
hard-code the username to `None` because we assume we checked up here
with the username if present.
2024-08-22 19:00:58 -05:00
Charlie Marsh
c743705dfb
Revert "Cache downloaded wheel when range requests aren't supported" (#6470)
## Summary

This reverts commit 7d92915f3d.

I thought this would be a net performance improvement, but we've now had
multiple reports that this made locking _extremely_ slow. I also tested
this today with a very large codebase against a registry that does not
support range requests, and the number of downloads was sort of wild to
watch. Reverting the reduced resolution time by over 50%.

Closes #6104.
2024-08-22 19:54:42 -04:00
Zanie Blue
7502a963e1
Add support for configuring python-downloads with UV_PYTHON_DOWNLOADS (#6436)
Part of https://github.com/astral-sh/uv/issues/6406

Replaces #6416
2024-08-22 23:19:03 +00:00
Zanie Blue
99d278f9f5
Treat .pyw files as scripts in uv run on Windows (#6453)
Closes https://github.com/astral-sh/uv/issues/6435
2024-08-22 23:07:30 +00:00
Charlie Marsh
9ee52e4e39
Deny invalid members in workspace schema (#6450)
## Summary

This has bitten me a few times.
2024-08-22 16:48:00 -04:00
Charlie Marsh
4591d0b4b2
Remove URI type from JSON Schema (#6449)
## Summary

Relative paths (like `./foo/bar`) are also welcome here!
2024-08-22 16:39:27 -04:00
Zanie Blue
0c8661340e
Add support for configuring the python-preference with UV_PYTHON_PREFERENCE (#6432)
Part of https://github.com/astral-sh/uv/issues/6406
2024-08-22 10:57:36 -05:00
Zanie Blue
3dd39e6d35
Fix references to --python-downloads (it is --no-python-downloads) (#6439)
Noticed in https://github.com/astral-sh/uv/pull/6409
2024-08-22 09:22:55 -05:00
Zanie Blue
fc9fdd2dbb
Revert "Env variables for python downloads" (#6431)
This reverts commit bbd9adaa40 from #6416
— the Python download variable is not aligned with the setting.
2024-08-22 13:29:09 +00:00
Ahmed Ilyas
bbd9adaa40
Env variables for python downloads (#6416)
## Summary

Resolves #6406

## Test Plan

```
❯ UV_PYTHON_PREFERENCE=only-managed cargo run -q -- sync --show-settings | rg python_preference
    python_preference: OnlyManaged,
❯ UV_PYTHON_PREFERENCE=system cargo run -q -- sync --show-settings | rg python_preference
    python_preference: System,
❯ UV_NO_PYTHON_DOWNLOADS=1 cargo run -q -- sync --show-settings | rg python_downloads
    python_downloads: Never,
❯ UV_ALLOW_PYTHON_DOWNLOADS=1 cargo run -q -- sync --show-settings | rg python_downloads
    python_downloads: Automatic,
```
2024-08-22 08:52:52 -04:00
Michał Górny
04e2ff57aa
Mark emit_marker_expression* tests as requiring python-patch (#6411)
## Summary

Mark the new tests requiring Python 3.12.1 specifically as requiring
python-patch feature. This makes the test suite pass again on systems
not having this specific version (and disabling the feature).

## Test Plan

`cargo test` on Gentoo :-).
2024-08-22 10:37:40 +02:00
konsti
dc94b4836f
Use backticks in pep508-rs (#6415)
In accordance with the style guide, use backticks in pep508-rs error
messages.
2024-08-22 08:31:04 +00:00