Commit Graph

70 Commits

Author SHA1 Message Date
samypr100 e0ac5b4e84
feat: keep backwards compatibility with `SSL_CERT_FILE` without requiring `--native-tls` (#2401)
## Summary

Small follow up to https://github.com/astral-sh/uv/pull/2362 to check if
`SSL_CERT_FILE` is set to enable `--native-tls` functionality. This
maintains backwards compatibility with `0.1.17` and below users
leveraging only `SSL_CERT_FILE`.

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

## Test Plan

<!-- How was it tested? -->
Assuming `SSL_CERT_FILE` is already working via `--native-tls`, this is
simply a shortcut to enable `--native-tls` functionality implicitly
while still being able to let `rustls-native-certs` handle the loading
of `SSL_CERT_FILE` instead of ourselves.

Edit: Manually tested by setting up own self-signed CA certificate
bundle and set `SSL_CERT_FILE` to this and confirmed the loading happens
without having to specify `--native-tls`.
2024-03-13 04:33:10 +00:00
Robert Resch 7cb01688aa
Fix left over after renaming UV_SYSTEM to UV_SYSTEM_PYTHON (#2379)
<!--
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? -->
Fix left over after renaming UV_SYSTEM to UV_SYSTEM_PYTHON in
https://github.com/astral-sh/uv/pull/2354
CC @charliermarsh 

## Test Plan

<!-- How was it tested? -->
2024-03-12 10:10:01 +01:00
Charlie Marsh e9c16e9aa2
Enable TLS native root toggling at runtime (#2362)
## Summary

It turns out that on macOS, reading the native certificates can add
hundreds of milliseconds to client initialization. This PR makes
`--native-tls` a command-line flag, to toggle (at runtime) the choice of
the `webpki` roots or the native system roots.

You can't accomplish this kind of configuration with the `reqwest`
builder API, so instead, I pulled out the heart of that logic from the
crate
(e319263851/src/async_impl/client.rs (L498)),
and modified it to allow toggling a choice of root.

Note that there's an open PR for this in reqwest
(https://github.com/seanmonstar/reqwest/pull/1848), along with an issue
(https://github.com/seanmonstar/reqwest/issues/1843), which I may ping,
but it's been around for a while and I believe reqwest is focused on its
next major release.

Closes https://github.com/astral-sh/uv/issues/2346.
2024-03-12 04:05:49 +00:00
Robert Resch 85483e88a4
Add env UV_SYSTEM as alias to --system (#2354)
## Summary

Add a new env variable `UV_SYSTEM` as alias for the cli argument
`--system`.
Use cases:
- No need to specify on each uv call inside the docker container the
`--system` flag
- It allows installing and configuring uv in a base container and in the
child containers nobody needs to know if you need the `--system` cli
flag
- The Home Assistant development env can be set up via devcontainer or a
venv. Both use some common scripts. Instead of adding duplicate or
special code to identify the dev container to set the `--system` flag,
it would be nicer to set it via an env variable.

I'm unfamiliar with Rust and tried to add the support by looking at the
code.

## Test Plan

I did test it manually
`UV_SYSTEM_PYTHON=true uv pip install requests`
2024-03-11 20:56:45 +00:00
Charlie Marsh a9a211a407
Document the environment variables that uv respects (#2318)
Closes https://github.com/astral-sh/uv/issues/2303.
2024-03-10 00:47:46 +00:00
Charlie Marsh 791207c14f
Add `PIP_COMPATIBILITY.md` to document known deviations from `pip` (#2244)
## Summary

Closes https://github.com/astral-sh/uv/issues/2023.
2024-03-06 21:33:27 +00:00
Zanie Blue ffb69e3f48
Expose the `--exclude-newer` flag (#2166)
Closes https://github.com/astral-sh/uv/issues/2088
2024-03-04 17:51:19 +00:00
Charlie Marsh 782a862e92
Add caveats on `--system` support to the README (#2131)
## Summary

Covering some of the limitations from
https://github.com/astral-sh/uv/issues/2113.
2024-03-02 10:07:57 -05:00
samypr100 5083f51d68
docs: add note about ssl_cert_file env var (#2124) 2024-03-02 01:37:27 +00:00
Charlie Marsh b983ff4fa7
Prioritize `PATH` over `py --list-paths` in Windows selection (#2057)
`uv --system` is failing in GitHub Actions, because `py --list-paths`
returns all the pre-cached Pythons:

```
-V:3.12 *        C:\hostedtoolcache\windows\Python\3.12.2\x64\python.exe
-V:3.12-32       C:\hostedtoolcache\windows\Python\3.12.2\x86\python.exe
-V:3.11          C:\hostedtoolcache\windows\Python\3.11.8\x64\python.exe
-V:3.11-32       C:\hostedtoolcache\windows\Python\3.11.8\x86\python.exe
-V:3.10          C:\hostedtoolcache\windows\Python\3.10.11\x64\python.exe
-V:3.10-32       C:\hostedtoolcache\windows\Python\3.10.11\x86\python.exe
-V:3.9           C:\hostedtoolcache\windows\Python\3.9.13\x64\python.exe
-V:3.9-32        C:\hostedtoolcache\windows\Python\3.9.13\x86\python.exe
-V:3.8           C:\hostedtoolcache\windows\Python\3.8.10\x64\python.exe
-V:3.8-32        C:\hostedtoolcache\windows\Python\3.8.10\x86\python.exe
-V:3.7           C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe
-V:3.7-32        C:\hostedtoolcache\windows\Python\3.7.9\x86\python.exe
```

So, our default selector returns the first entry here. But none of these
are actually in `PATH` except the one that the user installed via
`actions/setup-python@v5` -- that's the point of the action, that it
puts the correct versions in `PATH`.

It seems to me like we should prioritize `PATH` over `py --list-paths`.
Is there a good reason not to do this?

Closes: https://github.com/astral-sh/uv/issues/2056
2024-02-29 15:06:29 +00:00
Charlie Marsh f68b2d1d5e
Bump version to v0.1.12 (#2051) 2024-02-28 15:36:22 -05:00
Charlie Marsh 3116c371a7
Add `uv pip install --python` to README (#2030) 2024-02-27 21:54:33 -05:00
samypr100 53a250714c
docs: clarify lowest vs lowest-direct resolutions (#1954)
## Summary

Closes #1915

Small change to clarify lowest vs lowest-direct.
2024-02-24 22:15:01 +00:00
konsti af06a6fe0a
Use more universal windows install instructions (#1811)
Recommend installing uv on windows with

```
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```

instead of

```
irm https://astral.sh/uv/install.ps1 | iex
```

to support installing on cmd.exe, the classic non-powershell windows
command prompt.

See https://github.com/axodotdev/cargo-dist/issues/458 for background.
This will also be included in the next cargo-dist release.

I have confirmed this passes on
 * Command Prompt
 * Windows PowerShell
 * PowerShell
 * git bash

Closes #1750

CC @12932 this fixes the uv command prompt installation.
2024-02-22 09:25:33 +00:00
Zanie Blue d80eee1f8c
Add docs for git authentication (#1844)
[Rendered](https://github.com/astral-sh/uv/blob/zb/auth-docs/README.md#git-authentication)

Adds docs for
- #1781 
- #1717
2024-02-21 21:30:11 -05:00
samypr100 b3be53bb46
[docs] Update README.md to include extras example (#1806)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
There was no example of to hint support for extras in the README.md.

I added one example in the install section that is used in the uv tests.
2024-02-21 20:13:07 -06:00
samypr100 f441f8fa9b
docs: update venv activation for windows (#1836)
## Summary

Follow on to PR https://github.com/astral-sh/uv/pull/1811 as part of
issue https://github.com/astral-sh/uv/issues/1750. This change updates
the windows venv activation to work for both Powershell and Command
Prompt instead of just Powershell. This also aligns with what `uv venv`
displays.
2024-02-21 22:16:40 +00:00
Orhun Parmaksız 25f0157f0a
docs(readme): add instructions for installing on Arch Linux (#1765)
## Summary

I packaged `uv` in the official repositories:
https://archlinux.org/packages/extra/x86_64/uv/

This PR simply updates README.md to add the instructions to install the
package.

## Test Plan

None.
2024-02-20 11:33:56 -05:00
12932 f668fd8d59
Clarify Windows install command in README.md (#1751)
Specify that the command to run for Windows is for powershell

## Summary

Clarifies the usage of the command to run to install uv on Windows
(powershell only)

## Test Plan

It wasn't 😈

---------

Co-authored-by: konsti <konstin@mailbox.org>
2024-02-20 12:54:35 +00:00
Charlie Marsh bb876d95ed
Move `uv clean` to `uv cache clean` (#1733)
## Summary

This opens up space to add other cache-related commands. (`uv clean`
continues to work for backwards compatibility but is hidden from the
CLI.)
2024-02-20 04:14:05 +00:00
Henry Schreiner c6fd3d97fb
fix: remove uv version from uv pip compile header (#1716)
## Summary

This fixes https://github.com/astral-sh/uv/issues/1704 by removing the
version from the produced header.

## Test Plan

Checked with clippy, and tests are updated too.
2024-02-19 20:26:53 +00:00
kopp 4b92a51218
fix: use --override rather than -o to specify overrides in README.md (#1668)
## Summary

Fix documentation (Readme.md):
`-o` is the short for `--output-file`, so using `-o overrides.txt` would
store the output in `overrides.txt` rather than using that as overrides.

## Test Plan

no tests for docs (yet?)
2024-02-18 17:55:27 -06:00
Zanie Blue fd1af476b2
Add brew to readme (#1629)
Closes https://github.com/astral-sh/uv/issues/1627
2024-02-18 07:49:50 +00:00
Charlie Marsh 1110489c29
Bump version to v0.1.3 (#1557) 2024-02-16 19:45:29 -05:00
Dylan Storey 63987e4f8f
Provide example of file based package install. (#1424)
Added example to install packages from a file w/o editable mode.

I use `pip install .` in a number of CI/CD and build scripts - it wasn't
obvious to me how to achieve this with uv as `uv pip install .` throws
an error about package names being expected to start with an
alphanumeric character.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-02-16 14:34:04 +00:00
Charlie Marsh 659327f24a
Bump version to v0.1.2 (#1439) 2024-02-16 01:17:19 -05:00
Jacob Coffee 33dd5f0f90
chore(docs): update wording and add `alt` tag (#1423)
Small grammar updates for word flow

I believe the "Support for a wide range of advanced..." section could
also be changed to a sub-bullet list if this is more preferred?

Feel free to close :)

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-02-16 05:22:44 +00:00
CJ 8ef396e849
Update README.md to include venv activate (#1411)
This is just a small readme change to include venv activation.
In case someone just follows the docs as-is, they will end up installing
packages outside of the desired virtual env.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-02-15 20:20:25 -06:00
Brett Cannon 515a494f05
Tweak some grammar in the README (#1387) 2024-02-16 00:10:07 +00:00
Charlie Marsh 3559f0e6ab
Re-add license badge to the README (#1333) 2024-02-15 17:22:08 -05:00
Zanie Blue c43a5ba3aa
Replace "novel" in README (#1365)
Per some prior discussion, "novel" can be confusing in this context as
it's not clear what we're referring to.

PDM supports overrides — so I'll just drop this.

If anyone knows of other tools that support overrides and alternative
resolution strategies please let me know I'd love to look at how they've
implemented it :)
2024-02-15 22:09:27 +00:00
Jared Forsyth 12caff3850
grammar nit (#1345) 2024-02-15 21:22:29 +00:00
Zanie Blue 12c19ce506
Drop license badge for now; cached as UNKNOWN on CDNs (#1328)
We don't want to confuse people.

It's MIT / Apache dual licensed.

We'll restore this later once the cache is refreshed.
2024-02-15 13:57:59 -06:00
Zanie Blue 2586f655bb
Rename to `uv` (#1302)
First, replace all usages in files in-place. I used my editor for this.
If someone wants to add a one-liner that'd be fun.

Then, update directory and file names:

```
# Run twice for nested directories
find . -type d -print0 | xargs -0 rename s/puffin/uv/g
find . -type d -print0 | xargs -0 rename s/puffin/uv/g

# Update files
find . -type f -print0 | xargs -0 rename s/puffin/uv/g
```

Then add all the files again

```
# Add all the files again
git add crates
git add python/uv

# This one needs a force-add
git add -f crates/uv-trampoline
```
2024-02-15 11:19:46 -06:00
Charlie Marsh 328b116d5d
Fix README (#1315)
Oversight and typo.
2024-02-15 17:01:54 +00:00
Charlie Marsh 8bc81aaf70
Update README (#1307) 2024-02-15 09:54:29 -05:00
Charlie Marsh ea13d94c57
Fix dependency overrides link in README (#1297) 2024-02-13 17:09:18 +00:00
Zanie Blue 942e353f65
Change ordering of highlights in readme (#1289)
Also, shorten some more items
2024-02-12 18:45:26 -06:00
Zanie Blue 2a3e817d53
Shorten the novel features highlight in README (#1265) 2024-02-12 20:04:50 +00:00
Charlie Marsh 929715f4e2
Swap out Discord icon (#1287) 2024-02-12 19:29:22 +00:00
Zanie Blue ffb19b9a52
Add a error messages highlight to the README (#1264) 2024-02-08 23:12:22 +00:00
Charlie Marsh 0e35041ccd
Add Python version support (#1239)
Closes https://github.com/astral-sh/puffin/issues/1221.
2024-02-04 21:56:00 +00:00
Charlie Marsh fcf848877c
Change 'duplication' to 'deduplication' (#1223) 2024-02-01 14:13:45 +00:00
Charlie Marsh ec816a3322
Update Python discovery documentation (#1194)
Closes https://github.com/astral-sh/puffin/issues/1109.
2024-01-31 15:42:32 +00:00
Charlie Marsh 7ae9d3c631
Remove Windows limitation from README (#1195) 2024-01-30 21:39:15 +00:00
Charlie Marsh d94cf0e763
Remove specific MUSL mention from README (#1171)
See:
https://github.com/astral-sh/puffin/pull/1158#discussion_r1469603073.
2024-01-29 13:50:23 +00:00
Charlie Marsh fe03e74669
Add platform support to the README (#1158)
Closes https://github.com/astral-sh/puffin/issues/1149.
2024-01-28 22:52:25 -05:00
konsti 39021263dd
Windows launchers using posy trampolines (#1092)
## Background

In virtual environments, we want to install python programs as console
commands, e.g. `black .` over `python -m black .`. They may be called
[entrypoints](https://packaging.python.org/en/latest/specifications/entry-points/)
or scripts. For entrypoints, we're given a module name and function to
call in that module.

On Unix, we generate a minimal python script launcher. Text files are
runnable on unix by adding a shebang at their top, e.g.

```python
#!/usr/bin/env python
```

will make the operating system run the file with the current python
interpreter. A venv launcher for black in `/home/ferris/colorize/.venv`
(module name: `black`, function to call: `patched_main`) would look like
this:

```python
#!/home/ferris/colorize/.venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from black import patched_main
if __name__ == "__main__":
    sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
    sys.exit(patched_main())
```

On windows, this doesn't work, we can only rely on launching `.exe`
files.

## Summary

We use posy's rust implementation of a trampoline, which is based on
distlib's c++ implementation. We pre-build a minimal exe and append the
launcher script as stored zip archive behind it. The exe will look for
the venv python interpreter next to it and use it to execute the
appended script.

The changes in this PR make the `black` entrypoint work:

```powershell
cargo run -- venv .venv
cargo run -q -- pip install black
.\.venv\Scripts\black --version
```

Integration with our existing tests will be done in follow-up PRs.

## Implementation and Details

I've vendored the posy trampoline crate. It is a formatted, renamed and
slightly changed for embedding version of
https://github.com/njsmith/posy/pull/28.

The posy launchers are smaller than the distlib launchers, 16K vs 106K
for black. Currently only `x86_64-pc-windows-msvc` is supported. The
crate requires a nightly compiler for its no-std binary size tricks.

On windows, an application can be launched with a console or without (to
create windows instead), which needs two different launchers. The gui
launcher will subsequently use `pythonw.exe` while the console launcher
uses `python.exe`.
2024-01-26 13:54:11 +00:00
Zanie Blue 73fccdd5c6
Add new features to the highlights in README (#939) 2024-01-16 14:03:44 -05:00
Charlie Marsh 249ca10765
Move Puffin subcommands to a pip namespace (#921)
## Summary

This makes the separation clearer between the legacy `pip` API and the
API we'll add in the future for the package manager itself. It also
enables seamless `puffin pip` aliasing for those that want it.

Closes #918.
2024-01-15 16:36:45 +00:00