mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 05:15:00 +00:00
Update README
This commit is contained in:
parent
28721cf5fc
commit
f395c9c98c
5 changed files with 36 additions and 1 deletions
26
README.md
26
README.md
|
@ -4,10 +4,36 @@ An experimental Python package manager.
|
|||
|
||||
## Usage
|
||||
|
||||
To resolve a `requirements.in` file:
|
||||
|
||||
```shell
|
||||
cargo run -p puffin-cli -- compile requirements.in
|
||||
```
|
||||
|
||||
To install from a resolved `requirements.txt` file:
|
||||
|
||||
```shell
|
||||
cargo run -p puffin-cli -- install requirements.txt
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
To compare a warm run of `puffin` to `pip`:
|
||||
|
||||
```shell
|
||||
hyperfine --runs 10 --warmup 3 \
|
||||
"./target/release/puffin-cli install requirements.txt" \
|
||||
"pip install -r requirements.txt"
|
||||
```
|
||||
|
||||
To compare a cold run of `puffin` to `pip`:
|
||||
|
||||
```shell
|
||||
hyperfine --runs 10 --warmup 3 \
|
||||
"./target/release/puffin-cli install requirements.txt --no-cache" \
|
||||
"pip install -r requirements.txt --ignore-installed --no-cache-dir"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Puffin is licensed under either of
|
||||
|
|
|
@ -12,6 +12,7 @@ use puffin_resolve::resolve;
|
|||
|
||||
use crate::commands::ExitStatus;
|
||||
|
||||
/// Resolve a set of requirements into a set of pinned versions.
|
||||
pub(crate) async fn compile(src: &Path, cache: Option<&Path>) -> Result<ExitStatus> {
|
||||
// Read the `requirements.txt` from disk.
|
||||
let requirements_txt = std::fs::read_to_string(src)?;
|
||||
|
|
|
@ -15,6 +15,7 @@ use puffin_resolve::resolve;
|
|||
|
||||
use crate::commands::ExitStatus;
|
||||
|
||||
/// Install a set of requirements into the current Python environment.
|
||||
pub(crate) async fn install(src: &Path, cache: Option<&Path>) -> Result<ExitStatus> {
|
||||
// Read the `requirements.txt` from disk.
|
||||
let requirements_txt = std::fs::read_to_string(src)?;
|
||||
|
@ -46,6 +47,7 @@ pub(crate) async fn install(src: &Path, cache: Option<&Path>) -> Result<ExitStat
|
|||
};
|
||||
|
||||
// Resolve the dependencies.
|
||||
// TODO(charlie): When installing, assume `--no-deps`.
|
||||
let resolution = resolve(&requirements, markers, &tags, &client).await?;
|
||||
|
||||
// Create a temporary directory, in which we'll store the wheels.
|
||||
|
|
1
requirements.in
Normal file
1
requirements.in
Normal file
|
@ -0,0 +1 @@
|
|||
black
|
|
@ -1 +1,6 @@
|
|||
black
|
||||
click==8.1.7
|
||||
pathspec==0.11.2
|
||||
packaging==23.2
|
||||
platformdirs==3.11.0
|
||||
black==23.9.1
|
||||
mypy-extensions==1.0.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue