Commit graph

4903 commits

Author SHA1 Message Date
konsti
33bde826a0
Update pubgrub to use a dependency provider (#2648)
With https://github.com/pubgrub-rs/pubgrub/pull/190, pubgrub attaches
all types to a dependency provider to reduce the number of generics. We
need a dummy dependency provider now to emulate this. On the plus side,
pep440_rs drops its pubgrub dependency.
2024-03-25 15:51:31 +01:00
Andrew Gallant
8cc69a723d
uv-client: fix linehaul test (#2647)
This test was introduced in 42973cd9cb. It
looks like it compares some values against some platform specific code
that attempts to find the OS version. But the comparisons made some
assumptions about what kind of data is available. In this commit, we try
to make the test a little more flexible on Linux by not assuming that
`Option` values are `Some`.
2024-03-25 10:12:00 -04:00
Charlie Marsh
1601ea08e6
Rename scripts/editable-installs to scripts/packages (#2644)
## Summary

This was discussed in a prior PR.
2024-03-25 03:56:00 +00:00
Shantanu
a6602ad416
Do not force recompile pyc files (#2642)
Helps with #2637
2024-03-24 20:02:53 -04:00
Charlie Marsh
a7b251f65e
Limit overrides and constraints to requirements.txt format (#2632)
## Summary

I don't see a great reason to allow this, and it adds a lot of
complexity, so `pyproject.toml` files are now limited to `pip compile`
and `pip install -r` -- they can't be passed as `-c` or `--override`.
2024-03-23 09:33:29 -04:00
Hans Baker
a632d2485b
Don't error on multiple matching index URLs (#2627)
## Summary

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

## Test Plan

```
cargo run -- pip install -r dev-requirements.txt -r requirements.txt
```
where both requirements files have same `--index-url`
2024-03-22 23:37:02 +00:00
Zanie Blue
d0cb301d59
Use dense formatting for requirement version specifiers in diagnostics (#2601)
For consistency with the output in "no solution" errors
2024-03-22 16:35:49 -05:00
Charlie Marsh
90a1f89ac4
Extract local versions from direct URL requirements (#2624)
## Summary

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

## Test Plan

`cargo run pip install -r requirements.txt`, with:

```
 whisperX @ befe2b242e.zip
 pyannote-audio @ git+https://github.com/pyannote/pyannote-audio@11b56a137a578db9335efc00298f6ec1932e6317
 torch @ https://download.pytorch.org/whl/cu118/torch-2.2.1%2Bcu118-cp311-cp311-linux_x86_64.whl#sha256=84328a35621cc6a67a182a327baaab67e5f5869981c4b1677ed05f92c15cceb1
 torchaudio @ https://download.pytorch.org/whl/cu118/torchaudio-2.2.1%2Bcu118-cp311-cp311-linux_x86_64.whl#sha256=cd3b1c3582b17792c6d7a367dea0459b123e54d7a4242809ea87ccc10fa220e5
 pytorch_triton @ https://download.pytorch.org/whl/nightly/pytorch_triton-2.1.0%2B7d1a95b046-cp311-cp311-linux_x86_64.whl
```
2024-03-22 21:34:14 +00:00
Charlie Marsh
01b7a27be4
Add top-level benchmark to the README (#2622)
## Summary

Steps involved in creating this:

- Open the raw data in
[Vega-Lite](https://vega.github.io/editor/#/url/vega-lite/N4IgJAzgxgFgpgWwIYgFwhgF0wBwqgegIDc4BzJAOjIEtMYBXAI0poHsDp5kTykBaADZ04JAKyUAVhDYA7EABoQAEySYUqUMSSCGcCGgDaoTGzaC0IHAwBmNmvKVQksOJYDuSAE4JFIJnCysMheANaWXvrmpH6YNAhuqAAMlEkAjADMACwA7GIAbBn5AJw5ABxiYlkATGn5SnEJAGJsPmqWKekGAL4KJmYW6NZ2Dn7Orh7evkoBQTAh4egOEOqCFg3xiZ1iOfnVZcXFSWUbza3ImB2p+T19IKbmlsP2jiDj8JZQ5sp+s8HeixAkRkghipy2lDESSSWQyOSSxXye3BLTal3QKSht36jyGbDgmC8AE8xi4PuhPD5foF-mEIlFQW5wWgUvkktVyvDqvkcllodDqijzu0MZQ2dj7gMnrYXqSJugvoIfjMafMAZZlqt1vdNizKDkjjk0pk0sU6vz0kK0VcDRKHoMrPjCSSnGTEiBKdN-KqFhrZCsdNrGhDimUcrUykUxEcLWkrRcroc7VKhjQcPwvggcDRBEy3m7JlSVXNfehgdE88G0GlIQU6vkxGUEVl4yKQDWCsncVZlF73u7PdSS+qlv6tbFdagawcSvk0tUsmbDsviq30e3KEcuw6cE7iXLyW9vkPaYDNYGJwk0NVKPOF-kso3o-UdWdregb-Pt09ewf3YrlW9Yc6VHAM1kvRIbyyMMkiKNI+SSF9g1RBMP0oRdvyGX9XXlD0phPNUQKBBkwVfRIMkoOE+SyWEMmOBDoQyNdLAouFMMdAl9xww8AII0tiJBUiq1QLJKGqYoCgqaFigyQUyJQttRLo9js3TTNs1zP9PmPYtT3pQTK0nUTKjEDJSjSMosnnZj0GMm4QF6HEdzTfgICJIItIpfDdMIs8xwvZkRLFDJMmgjIym5GyQFEwoVJctyPO4-8dKAvTQPHQKclSapGJhNkyjZaE43k4V1yy9kVOw-NcN4nz+PLRkILQLLahycKihhJdlyilrqh6ABdXp7i8JB-Rsc4jFAexBEwOAvEsVRMAYBBKH7AACABeDa1oAck9HaHLuabZvm9BFuWyg-l8zbtp2881gO7p+qcOR7DINBQBwJBlGUBx3uSJQvpGhADFQYwQFkJArzOuAbCQBgZpaWRLiUbRdHdfgkBwHBc1cokVkQBQACFhFkUIAFkXAAZXx2aECRzAFAAHRAKnyHxNaAFUAEkWYUAAJOBGTiZwFAAQS8GgdAUCBRogVy5poGxmZAMXsdzNaAGFzFaNaAFEEDYSQaD5lm2bIDmef1w3jZZw7QEh6GdUwXNtcEVo-DRvRLAAYgyf2A-tiGofdQQkACQQ3Y91GdG99A-YD-2HOejA4G+uaPpAMOI4ZzO4AADxwU6VFh+HEbkS4hriF24FzzQQALouFtLhHMFzqu6FzBmAHU4BoMgsDQKEkirgv0Smiu88L4vlBb8vkcOo93dO0BG+L7Ohaj+buiG0sJ4X+u1+buHW-bl7l6npv0A3yOde3jua8z8aD9X6fj7LtvJ6GiBmGrrvJ8Pm-GGJ956VyUM-TAvd+6D1QMPIaSB840FBqAG+W9L7r3DpvO+i8b511flfEuIDP4Lwfv-F+DcgGEI-mfZ2ZDIF9wHuiYeGwa5oMAQQv+cA0GkNrhXKmNAABeiR5xDVzGQQIPx66cJ7gwmBzDaFcOwew4unDuEsLofwoR1Y5KoKUfgjBEc1FZ0wYIPBFCCGzyITQ6RAD9Hv1Pl-IaxAaBwHcJnFYXg2ChESLIBGgghpMBcKEMgniGCyEkcNOWQNAhgJABAL6UA-poCKDMIJIS2BhIiYSKJ3gYl+DhlAAkmdPFuPrvYIWESrq+iUDILw65Z7QAkUk9RPi-FKHgOnU6vi1g7yUA1GI9doA6ESKAfOfpZ44AkXkpQJJRwTKmSQ7+kyoB5yCGwX6sh-qgFmVNFxSpLD2liESSZlhZBsAQA4HQfgEFIMziEmgki4aCAgHAFpaBumCCULgvhgjhFyRFqEUGTyXlfJMQABW+hs-6aQkhKGUOcpAoxUDArgN-Vo6IPlDTGfXJAZAQl8FmpYH+Xpyn7PQFWBoxz3QAEcGCjWrmoGgpEbnIIUe8tpxiI560oedFaXs4BrQANS7QgAdDYUBQjazCeiJiOoJWaK2KCiOEKfpJNQC+G+YthBkHkAqGJGclVCwZgq7R4rJVKKBGQQJAAKecOQFB2odRyBQKRqhiAAJR+HucoNhlqbWOoDc611Hq-DwuQEilFO8hrwGgeiI4Sh3APPoGgBCoKiQZzBqAfigT5pKBpOstVoAIC-Mzvy6sGQhqKg9vXL44S6DsF1SYfQ9S1AXXtDdXazwHBipAGW+OhQ+Ri01ovPtIAfYDqSEOhyvSTAjTGhNTNIBjoZpUK2la7aACEW1O0ym7cnJQe97hUoOWPa52rdVZ1hijfwSAXmk3dBcn6mk4XYpfBAk1U45LTQdAnROi981QszrNfO48l17KyZsBSlcZ2RPnVSRdy6Z5rsoO2rat0u2yEeinQ9mBj3ktPUoHQ-cL25hsNewJd6HAPoecoZ9KhX3gJ+Voz9jHkZQMYZYJgx4hoAcLfcU9ZTwMHMg6VRe37M61t+nEOQQHm0LWQ6h9Du7MOe1ju6X9gcnFqd9onJOUbBrdCAA).
- Download as SVG.
- Manually edit to: (1) remove all class names, (2) change the width and
height to match the view box, (3) change puffin to uv, (4) make uv bold.
- Copy to create the dark-mode variant, and replace `#333333` with
`#C9D1D9`.
2024-03-22 16:07:31 -04:00
Zanie Blue
a5cae02922
Bump version to 0.1.24 (#2621) 2024-03-22 14:58:10 -05:00
konsti
fca2883864
Avoid ignore crate finding cache gitignore (#2615)
We put a `.gitignore` with `*` at the top of our cache. When maturin was
building a source distribution inside the cache, it would walk up the
tree to find a gitignore, see that and ignore all python files. We now
add an (empty) `.git` directory one directory below, in the root of
built-wheels cache. This prevents ignore walking further up (it marks
the top level a git repository).

Deptry (from #2490) is a mid sized rust package with additional python
packages, so instead of using it in the test i've replaced it with a
small (44KB total) reproducer that uses cffi for faster building, the
entire test taking <2s on my machine.

Fixes #2490
2024-03-22 14:36:07 -05:00
Charlie Marsh
fc32a693c2
Remove unnamed requirements limitation from PIP_COMPATIBILITY.md (#2619)
We now support `uv pip install .` and friends.
2024-03-22 15:32:19 -04:00
konsti
95a70084c7
Update minimum rust version (cargo) to 1.76 (#2618)
This should address (fix?) #2442, it blocks building with a version that
doesn't support return type impl trait.

```
$ cargo +1.74 check
  error: package `pep508_rs v0.4.2 (/home/konsti/projects/uv/crates/pep508-rs)` cannot be built because it requires rustc 1.76 or newer, while the currently active rustc version is 1.74.1
```

While we should encourage our dependencies to set a msrv, if we set our
rust-toolchain.toml version as cargo msrv our users on no-wheel
no-installer platforms will also be fine (or at least get helpful error
messages).
2024-03-22 18:45:16 +00:00
Auca Coyan
7d5d9a92c3
return the link to the CI badge (#2616)
## Summary

After I did #2612 , broke the badge and #2613 fixed it (thanks konstin!)
I return the functionality to go to the actions tab when you click the
badge:

[![Actions
status](https://github.com/astral-sh/uv/actions/workflows/ci.yml/badge.svg)](https://github.com/astral-sh/uv/actions)
2024-03-22 15:58:10 +00:00
Wolf Vollprecht
68432e77e5
fix: expose AllowedYanks (#2608)
## Summary

If I see correctly, this is used in the interface of
`DefaultResolverProvider` but not accessible outside.
2024-03-22 09:15:22 -05:00
konsti
a4fb2ad739
Add missing .yml for badge (#2613) 2024-03-22 13:55:50 +00:00
Auca Coyan
c1e1562a89
Update badge to current CI status. Remove the link to /actions (#2612)
## Summary

Hi! I noticed the badge in the `README.md` says CI it's failing

[![Actions
status](https://github.com/astral-sh/uv/workflows/CI/badge.svg)](https://github.com/astral-sh/uv/actions)

But current main CI is okay. The problem is that badge is bringing the
latest actions ran in the repo. Even if it's from a PR
So I changed to this link:

![Action
Status](https://github.com/astral-sh/uv/actions/workflows/ci.yml/badge.svg)

It shows the current main branch CI status, but _I couldn't get the link
to work (go into `uv/actions`)_. Is it acceptable to lose some
functionality in order to display the correct information?

## Test Plan

manually
2024-03-22 12:38:56 +00:00
konsti
48bd02b8a8
Update miette v7, pubgrub and small Cargo.toml cleanup (#2610)
I was going through the output of `cargo tree --duplicate -p uv`, not
much success except these small cleanups.
2024-03-22 10:42:48 +00:00
konsti
375b33ff0c
Remove unused deps with cargo machete (#2609) 2024-03-22 10:01:17 +00:00
Charlie Marsh
9986710a53
Make self-update an opt-in Cargo feature (#2606)
## Summary

Ensures that (e.g.) installs from conda-forge, Homebrew, and other
distributions don't expose `uv self update` at all.

We'll still show `uv self update` for `pip install uv`, but it will fail
with a good error. Removing the `uv self update` from `pip`-installed
`uv` is more complicated, since we'd need to build separately for the
installer vs. for PyPI.

Closes #2588.
2024-03-22 00:23:09 -04:00
Charlie Marsh
0ea51d43f5
Add progress reporting for named requirement resolution (#2605) 2024-03-22 04:01:10 +00:00
Charlie Marsh
31743f2bd8
Use PEP 517 build hooks to resolve unnamed requirements (#2604) 2024-03-22 03:20:40 +00:00
Charlie Marsh
5d7d7dce24
Enable PEP 517 builds for unnamed requirements (#2600)
## Summary

This PR enables the source distribution database to be used with unnamed
requirements (i.e., URLs without a package name). The (significant)
upside here is that we can now use PEP 517 hooks to resolve unnamed
requirement metadata _and_ reuse any computation in the cache.

The changes to `crates/uv-distribution/src/source/mod.rs` are quite
extensive, but mostly mechanical. The core idea is that we introduce a
new `BuildableSource` abstraction, which can either be a distribution,
or an unnamed URL:

```rust
/// A reference to a source that can be built into a built distribution.
///
/// This can either be a distribution (e.g., a package on a registry) or a direct URL.
///
/// Distributions can _also_ point to URLs in lieu of a registry; however, the primary distinction
/// here is that a distribution will always include a package name, while a URL will not.
#[derive(Debug, Clone, Copy)]
pub enum BuildableSource<'a> {
    Dist(&'a SourceDist),
    Url(SourceUrl<'a>),
}
```

All the methods on the source distribution database now accept
`BuildableSource`. `BuildableSource` has a `name()` method, but it
returns `Option<&PackageName>`, and everything is required to work with
and without a package name.

The main drawback of this approach (which isn't a terrible one) is that
we can no longer include the package name in the cache. (We do continue
to use the package name for registry-based distributions, since those
always have a name.). The package name was included in the cache route
for two reasons: (1) it's nice for debugging; and (2) we use it to power
`uv cache clean flask`, to identify the entries that are relevant for
Flask.

To solve this, I changed the `uv cache clean` code to look one level
deeper. So, when we want to determine whether to remove the cache entry
for a given URL, we now look into the directory to see if there are any
wheels that match the package name. This isn't as nice, but it does work
(and we have test coverage for it -- all passing).

I also considered removing the package name from the cache routes for
non-registry _wheels_, for consistency... But, it would require a cache
bump, and it didn't feel important enough to merit that.
2024-03-21 22:46:39 -04:00
Charlie Marsh
12192dd872
Remove unused requirements.rs file (#2603)
This was accidentally duplicated in a rebase.
2024-03-22 02:21:36 +00:00
Wolf Vollprecht
7d285148b2
fix: do not error when there are warnings on stderr (#2599)
## Summary

We had some users report bugs because the Python querying failed due to
warnings in `stderr`. I don't think this should fail on any `stderr`
output.

E.g.

```
  × Querying Python at `USER/.pixi/envs/default/bin/python3.10` failed with status exit status: 0 with exit status: 0
  │ --- stdout:
  │ {"markers": {"implementation_name": "cpython", "implementation_version": "3.10.0", "os_name": "posix", "platform_machine": "x86_64", "platform_python_implementation": "CPython", "platform_release": "5.15.146.1-microsoft-standard-WSL2",
  │ "platform_system": "Linux", "platform_version": "#1 SMP Thu Jan 11 04:09:03 UTC 2024", "python_full_version": "3.10.0", "python_version": "3.10", "sys_platform": "linux"}, "base_prefix": "USER/.pixi/
  │ envs/default", "base_exec_prefix": "USER/.pixi/envs/default", "prefix": "USER/.pixi/envs/default", "base_executable": "USER/.pixi/envs/default/
  │ bin/python3.10", "sys_executable": "USER/.pixi/envs/default/bin/python3.10", "stdlib": "USER/.pixi/envs/default/lib/python3.10", "scheme": {"platlib": "/home/mvanniekerk/
  │ code/vice-python/.pixi/envs/default/lib/python3.10/site-packages", "purelib": "USER/.pixi/envs/default/lib/python3.10/site-packages", "include": "USER/.pixi/envs/default/
  │ include/python3.10", "scripts": "USER/.pixi/envs/default/bin", "data": "USER/.pixi/envs/default"}, "virtualenv": {"purelib": "lib/python3.10/site-packages", "platlib": "lib/
  │ python3.10/site-packages", "include": "include/site/python3.10", "scripts": "bin", "data": ""}}
  │ --- stderr:
  │ [03/21/24 15:59:48] WARNING  pyproject.toml does not contain a setuptools.py:119
  │                              tool.setuptools_scm section
  │ ---
```
2024-03-21 19:23:41 -04:00
Charlie Marsh
63a8bc2b8f
Bump axoupdater to v0.3.3 to fix Windows self-updates (#2598)
Closes #2585.
2024-03-21 16:58:57 -04:00
Zanie Blue
c6e181d233
Respect HTTP client options when reading remote requirements files (#2434)
Uses the base client introduced in #2431 to restore use of our fully
configured client when reading remote requirements files.

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

## Test plan

```
npx http-server --username user --password password
cargo run -- pip install -r http://user:password@127.0.0.1:8080/requirements.txt
```

Fails on main succeeds on branch.
2024-03-21 13:48:57 -05:00
Charlie Marsh
9654da418e
Don't install pydantic_core on Python 3.13 (#2595)
See:
2294712845

![Screenshot 2024-03-21 at 2 06
40 PM](227d9e76-7b5d-4730-8f13-cc8bb4a7ac33)
2024-03-21 14:15:43 -04:00
Charlie Marsh
0f96386032
Add a garbage collection mechanism to the CLI (#1217)
## Summary

Detects unused cache entries, which can come in a few forms:

1. Directories that are out-dated via our versioning scheme.
2. Old source distribution builds (i.e., we have a more recent version).
3. Old wheels (stored in `archive-v0`, but not symlinked-to from
anywhere in the cache).

Closes https://github.com/astral-sh/puffin/issues/1059.
2024-03-21 18:07:48 +00:00
Zanie Blue
7ee90dc71f
Fix authentication with JFrog artifactories (#2592)
Closes #2566 

We were storing the username e.g. `charlie@astral.sh` as a
percent-encoded string `charlie%40astral.sh` which resulted in different
headers and broke JFrog's artifactory which apparently does not decode
usernames.

Tested with a JFrog artifactory and AWS CodeArtifact although it is
worth noting that AWS does _not_ have a username with an `@` — it'd be
nice to test another artifactory with percent-encoded characters in the
username and/or password.
2024-03-21 12:10:43 -05:00
konsti
2375008cc1
Use c-string literals and update trampolines (#2590)
Rust 1.77 has stabilized c-string literals (`c"<string>"`):
https://doc.rust-lang.org/nightly/edition-guide/rust-2021/c-string-literals.html.
This PR replaces the usages of the custom c-string literal macro in the
trampoline with the new syntax.
2024-03-21 15:36:00 +00:00
Charlie Marsh
f91ce521c5
Move requirements resolution into its own crate (#2579)
## Summary

No functional changes, but this was a lot of core logic in the `uv`
crate, which is mostly meant to be the CLI.
2024-03-21 13:52:47 +00:00
Charlie Marsh
2979918320
Add support for unnamed Git and HTTP requirements (#2578)
## Summary

Enables, e.g., `uv pip install
git+https://github.com/pallets/flask.git`.

Part of: https://github.com/astral-sh/uv/issues/313.
2024-03-21 13:44:54 +00:00
Tim de Jager
fc9761d020
feat: make direct_url public (#2584)
## Summary

Made the `direct_url` method public because it was not :) Can be merged
instead of in addition to: https://github.com/astral-sh/uv/pull/2510
2024-03-21 09:37:15 -04:00
veryyet
d6dad57fab
chore: fix some typos (#2581) 2024-03-21 04:09:37 +00:00
Charlie Marsh
7c728a2e77
Support unnamed requirements directly in pip uninstall (#2577)
## Summary

In `pip uninstall`, we shouldn't need to resolve unnamed requirements,
since we already index packages in `site-packages` by their URL.

This also changes `uninstall` to ignore editables, which matches pip's
behavior.

Part of: https://github.com/astral-sh/uv/issues/313.

## Test Plan

Run `cargo run pip install ./scripts/editable-installs/black_editable`,
followed by each of the following:

- `cargo run pip uninstall ./scripts/editable-installs/black_editable`
- `cargo run pip uninstall black`
- `cargo run pip uninstall ./scripts/editable-installs/black_editable
black`
2024-03-21 00:02:06 -04:00
Charlie Marsh
34bef37072
Enable install audits without resolving named requirements (#2575)
## Summary

This PR ensures that if a package is already satisfied by the current
environment, we don't bother resolving the named requirement.

Part of: https://github.com/astral-sh/uv/issues/313.

## Test Plan

- `cargo run pip install ./scripts/editable-installs/black_editable`
- `cargo run pip install black --verbose`
2024-03-20 23:54:45 -04:00
Charlie Marsh
e5b0cf7f89
Add support for unnamed local directory requirements (#2571)
## Summary

For example: `cargo run pip install .`

The strategy taken here is to attempt to extract the package name from
the distribution without executing the PEP 517 build steps. We could
choose to do that in the future if this proves lacking, but it adds
complexity.

Part of: https://github.com/astral-sh/uv/issues/313.
2024-03-21 03:46:11 +00:00
Charlie Marsh
4d96255ade
Enable unnamed requirements for direct URLs (#2569)
## Summary

This PR enables `uv pip install` to accept unnamed requirements, as long
as the requirement ends with the wheel or source distribution archive
name. For example: `cargo run pip install
~/Downloads/anyio-4.3.0.tar.gz`.

In subsequent PRs, I'll expand the scope of supported archives and
patterns.

Part of: https://github.com/astral-sh/uv/issues/313.
2024-03-21 03:39:02 +00:00
Charlie Marsh
ee211b35bc
Add support for parsing unnamed URL requirements (#2567)
## Summary

First piece of https://github.com/astral-sh/uv/issues/313. In order to
support unnamed requirements, we need to be able to parse them in
`requirements-txt`, which in turn means that we need to introduce a new
type that's distinct from `pep508::Requirement`, given that these
_aren't_ PEP 508-compatible requirements.

Part of: https://github.com/astral-sh/uv/issues/313.
2024-03-21 03:28:58 +00:00
Charlie Marsh
0af6a3d41d
Bump version to v0.1.23 (#2580) 2024-03-21 02:51:21 +00:00
konsti
a873963e5d
Fix cargo warning (#2576) 2024-03-20 21:25:09 +00:00
konsti
70e0967dbd
Avoid repeating paths of workspace packages (#2573)
Scott schafer got me the idea: We can avoid repeating the path for
workspaces dependencies everywhere if we declare them in the virtual
package once and treat them as workspace dependencies from there on.
2024-03-20 16:16:02 -04:00
konsti
7111fdd637
VIRTUAL_ENV takes precedence over CONDA_PREFIX (#2574)
It is a common pattern to have an active conda base env (that sets
`CONDA_PREFIX`) and then create a venv on top of that (setting
`VIRTUAL_ENV`).

Previously, we would error when both `VIRTUAL_ENV` and `CONDA_PREFIX`
were set, now `VIRTUAL_ENV` takes precedence over `CONDA_PREFIX`.

Fixes #2028
2024-03-20 16:14:44 -04:00
Wolf Vollprecht
1255c981a7
feat: allow setting installer name other than uv (#2561)
## Summary

We would like to be able to configure the installer-name so that other
tools can co-exist with `uv`. In `pixi` we would like to use `pixi-uv`
as the installer name, for example, to be able to distinguish them from
packages installed by pure `uv`.
2024-03-20 10:36:49 -04:00
Charlie Marsh
00fc44012c
Use relative paths for user display (#2559)
## Summary

This PR changes our user-facing representation for paths to use relative
paths, when the path is within the current working directory. This
mirrors what we do in Ruff. (If the path is _outside_ the current
working directory, we print an absolute path.)

Before:

```shell
❯ uv venv .venv2
Using Python 3.12.2 interpreter at: /Users/crmarsh/workspace/uv/.venv/bin/python3
Creating virtualenv at: .venv2
Activate with: source .venv2/bin/activate
```

After:

```shell
❯ cargo run venv .venv2
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/uv venv .venv2`
Using Python 3.12.2 interpreter at: .venv/bin/python3
Creating virtualenv at: .venv2
Activate with: source .venv2/bin/activate
```

Note that we still want to use the existing `.simplified_display()`
anywhere that the path is being simplified, but _still_ intended for
machine consumption (e.g., when passing to `.current_dir()`).
2024-03-20 09:52:50 -04:00
Hans Baker
204b159cf4
Add CUSTOM_COMPILE_COMMAND support to uv pip compile (#2554)
<!--
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? -->

This adds support for `CUSTOM_COMPILE_COMMAND` support to change the
header comment in generated requirements files.

See Issue:  
- #1527 

From [pip-tools docs](https://pip-tools.readthedocs.io/en/latest/):

> You might be wrapping the pip-compile command in another script. To
avoid confusing consumers of your custom script you can override the
update command generated at the top of requirements files by setting the
CUSTOM_COMPILE_COMMAND environment variable.

## Test Plan

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

See unit test included

---------

Co-authored-by: konsti <konstin@mailbox.org>
2024-03-20 11:22:18 +00:00
konsti
32b9eeb532
Use mac version from python for linehaul information (#2509)
See
https://github.com/astral-sh/uv/pull/2493#pullrequestreview-1942899151.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-03-20 10:55:50 +01:00
Charlie Marsh
cfd18aa1a2
Treat uninstallable packages as warnings, rather than errors (#2557)
## Summary

Closes https://github.com/astral-sh/uv/issues/2467.
2024-03-20 01:02:12 +00:00
Zanie Blue
baa30697a4
Ensure mtime of site packages is updated during wheel installation (#2545)
Closes https://github.com/astral-sh/uv/issues/2530
2024-03-20 00:54:05 +00:00