diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 6bda3cc0a39c..e1eed8993d02 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -1,4 +1,4 @@ -# Build Puffin on all platforms. +# Build uv on all platforms. # # Generates both wheels (for PyPI) and archived binaries (for GitHub releases). # @@ -24,8 +24,8 @@ concurrency: cancel-in-progress: true env: - PACKAGE_NAME: puffin_alpha - MODULE_NAME: puffin + PACKAGE_NAME: uv + MODULE_NAME: uv PYTHON_VERSION: "3.11" CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 @@ -43,7 +43,7 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build sdist" uses: PyO3/maturin-action@v1 with: @@ -71,7 +71,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels - x86_64" uses: PyO3/maturin-action@v1 with: @@ -85,11 +85,11 @@ jobs: - name: "Archive binary" run: | TARGET=x86_64-apple-darwin - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -111,7 +111,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels - universal2" uses: PyO3/maturin-action@v1 with: @@ -129,11 +129,11 @@ jobs: - name: "Archive binary" run: | TARGET=aarch64-apple-darwin - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -162,7 +162,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} architecture: ${{ matrix.platform.arch }} - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -183,8 +183,8 @@ jobs: - name: "Archive binary" shell: bash run: | - ARCHIVE_FILE=puffin-${{ matrix.platform.target }}.zip - 7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/puffin.exe + ARCHIVE_FILE=uv-${{ matrix.platform.target }}.zip + 7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/uv.exe sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" uses: actions/upload-artifact@v3 @@ -210,7 +210,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -249,11 +249,11 @@ jobs: set -euo pipefail TARGET=${{ matrix.target }} - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -285,7 +285,7 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -318,11 +318,11 @@ jobs: set -euo pipefail TARGET=${{ matrix.platform.target }} - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -334,7 +334,7 @@ jobs: *.sha256 # Like `linux-arm`, but use `--no-default-features --features flate2/rust_backend` when - # building Puffin. + # building uv. linux-s390x: runs-on: ubuntu-latest strategy: @@ -351,7 +351,7 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -384,11 +384,11 @@ jobs: set -euo pipefail TARGET=${{ matrix.platform.target }} - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -399,9 +399,8 @@ jobs: *.tar.gz *.sha256 - # Like `linux-arm`, but use `--no-default-features --features flate2/rust_backend` when - # building Puffin, and install the `gcc-powerpc64-linux-gnu` package. + # building uv, and install the `gcc-powerpc64-linux-gnu` package. linux-powerpc: runs-on: ubuntu-latest strategy: @@ -420,7 +419,7 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -460,11 +459,11 @@ jobs: set -euo pipefail TARGET=${{ matrix.platform.target }} - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -491,7 +490,7 @@ jobs: python-version: ${{ env.PYTHON_VERSION }} architecture: x64 - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -520,11 +519,11 @@ jobs: set -euo pipefail TARGET=${{ matrix.target }} - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" @@ -554,7 +553,7 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} - name: "Prep README.md" - run: echo "# Puffin" > README.md + run: echo "# uv" > README.md - name: "Build wheels" uses: PyO3/maturin-action@v1 with: @@ -585,11 +584,11 @@ jobs: set -euo pipefail TARGET=${{ matrix.platform.target }} - ARCHIVE_NAME=puffin-$TARGET + ARCHIVE_NAME=uv-$TARGET ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz mkdir -p $ARCHIVE_NAME - cp target/$TARGET/release/puffin $ARCHIVE_NAME/puffin + cp target/$TARGET/release/uv $ARCHIVE_NAME/uv tar czvf $ARCHIVE_FILE $ARCHIVE_NAME shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256 - name: "Upload binary" diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 66d68307452d..5a750d0daae1 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -19,7 +19,7 @@ on: jobs: docker-publish: - name: Build Docker image (ghcr.io/astral-sh/puffin) + name: Build Docker image (ghcr.io/astral-sh/uv) runs-on: ubuntu-latest environment: name: release @@ -40,7 +40,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/astral-sh/puffin + images: ghcr.io/astral-sh/uv - name: Check tag consistency if: ${{ inputs.plan != '' && !fromJson(inputs.plan).announcement_tag_is_implicit }} @@ -64,5 +64,5 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max push: ${{ inputs.plan != '' && !fromJson(inputs.plan).announcement_tag_is_implicit }} - tags: ghcr.io/astral-sh/puffin:latest,ghcr.io/astral-sh/puffin:${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || 'dry-run' }} + tags: ghcr.io/astral-sh/uv:latest,ghcr.io/astral-sh/uv:${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || 'dry-run' }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e5e43fd5807..894774b06120 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,17 +90,17 @@ jobs: steps: - uses: actions/checkout@v4 - name: "Install Rust toolchain" - working-directory: crates/puffin-trampoline + working-directory: crates/uv-trampoline run: | rustup target add x86_64-pc-windows-msvc rustup component add clippy rust-src --toolchain nightly-2024-01-23-x86_64-pc-windows-msvc - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 with: - workspaces: "crates/puffin-trampoline" + workspaces: "crates/uv-trampoline" - name: "Clippy" - working-directory: crates/puffin-trampoline + working-directory: crates/uv-trampoline run: cargo clippy --all-features --locked -- -D warnings - name: "Build" - working-directory: crates/puffin-trampoline + working-directory: crates/uv-trampoline run: cargo build --release -Z build-std=core,panic_abort,alloc -Z build-std-features=compiler-builtins-mem --target x86_64-pc-windows-msvc diff --git a/BENCHMARKS.md b/BENCHMARKS.md index a6bb895c863b..1a00f543f011 100644 --- a/BENCHMARKS.md +++ b/BENCHMARKS.md @@ -1,18 +1,18 @@ # Benchmarks -All benchmarks were computed on macOS using Python 3.12.0 (for non-Puffin tools), and come with a few +All benchmarks were computed on macOS using Python 3.12.0 (for non-uv tools), and come with a few important caveats: - Benchmark performance may vary dramatically across different operating systems and filesystems. - In particular, Puffin uses different installation strategies based on the underlying filesystem's - capabilities. (For example, Puffin uses reflinking on macOS, and hardlinking on Linux.) + In particular, uv uses different installation strategies based on the underlying filesystem's + capabilities. (For example, uv uses reflinking on macOS, and hardlinking on Linux.) - Benchmark performance may vary dramatically depending on the set of packages being installed. For example, a resolution that requires building a single intensive source distribution may appear very similar across tools, since the bottleneck is tool-agnostic. -- Unlike Poetry, both Puffin and pip-tools do _not_ generate multi-platform lockfiles. As such, +- Unlike Poetry, both uv and pip-tools do _not_ generate multi-platform lockfiles. As such, Poetry is (by design) doing significantly more work than other tools in the resolution benchmarks. Poetry is included for completeness, as many projects may not _need_ a multi-platform lockfile. - However, it's critical to understand that benchmarking Puffin's resolution time against Poetry is + However, it's critical to understand that benchmarking uv's resolution time against Poetry is an unfair comparison. (Benchmarking installation, however, _is_ a fair comparison.) This document benchmarks against Trio's `docs-requirements.in`, as a representative example of a @@ -22,7 +22,7 @@ In each case, a smaller bar (i.e., lower) is better. ## Warm Installation -Benchmarking package installation (e.g., `puffin pip sync`) with a warm cache. This is equivalent +Benchmarking package installation (e.g., `uv pip sync`) with a warm cache. This is equivalent to removing and recreating a virtual environment, and then populating it with dependencies that you've installed previously on the same machine. @@ -30,15 +30,15 @@ you've installed previously on the same machine. ## Cold Installation -Benchmarking package installation (e.g., `puffin pip sync`) with a cold cache. This is equivalent -to running `puffin pip sync` on a new machine or in CI (assuming that the package manager cache is +Benchmarking package installation (e.g., `uv pip sync`) with a cold cache. This is equivalent +to running `uv pip sync` on a new machine or in CI (assuming that the package manager cache is not shared across runs). ![install-cold](https://github.com/astral-sh/ruff/assets/1309177/ed86c193-582f-4163-b369-f12ec3905c3c) ## Warm Resolution -Benchmarking dependency resolution (e.g., `puffin pip compile`) with a warm cache, but no existing +Benchmarking dependency resolution (e.g., `uv pip compile`) with a warm cache, but no existing lockfile. This is equivalent to blowing away an existing `requirements.txt` file to regenerate it from a `requirements.in` file. @@ -46,8 +46,8 @@ from a `requirements.in` file. ## Cold Resolution -Benchmarking dependency resolution (e.g., `puffin pip compile`) with a cold cache. This is -equivalent to running `puffin pip compile` on a new machine or in CI (assuming that the package +Benchmarking dependency resolution (e.g., `uv pip compile`) with a cold cache. This is +equivalent to running `uv pip compile` on a new machine or in CI (assuming that the package manager cache is not shared across runs). ![resolve-cold](https://github.com/astral-sh/ruff/assets/1309177/556ac7aa-0a6a-4f94-b0d9-90b25461de7b) @@ -55,20 +55,20 @@ manager cache is not shared across runs). ## Reproduction All benchmarks were generated using the `scripts/bench/__main__.py` script, which wraps -[`hyperfine`](https://github.com/sharkdp/hyperfine) to facilitate benchmarking Puffin +[`hyperfine`](https://github.com/sharkdp/hyperfine) to facilitate benchmarking uv against a variety of other tools. The benchmark script itself has a several requirements: -- A local Puffin release build (`cargo build --release`). -- A virtual environment with the script's own dependencies installed (`puffin venv && puffin pip sync scripts/bench/requirements.txt`). +- A local uv release build (`cargo build --release`). +- A virtual environment with the script's own dependencies installed (`uv venv && uv pip sync scripts/bench/requirements.txt`). - The [`hyperfine`](https://github.com/sharkdp/hyperfine) command-line tool installed on your system. -To benchmark Puffin's resolution against pip-compile and Poetry: +To benchmark uv's resolution against pip-compile and Poetry: ```shell python -m scripts.bench \ - --puffin \ + --uv \ --poetry \ --pip-compile \ --benchmark resolve-warm \ @@ -76,11 +76,11 @@ python -m scripts.bench \ --json ``` -To benchmark Puffin's installation against pip-sync and Poetry: +To benchmark uv's installation against pip-sync and Poetry: ```shell python -m scripts.bench \ - --puffin \ + --uv \ --poetry \ --pip-sync \ --benchmark install-warm \ @@ -91,10 +91,10 @@ python -m scripts.bench \ After running the benchmark script, you can generate the corresponding graph via: ```shell -cargo run -p puffin-dev render-benchmarks resolve-warm.json --title "Warm Resolution" -cargo run -p puffin-dev render-benchmarks resolve-cold.json --title "Cold Resolution" -cargo run -p puffin-dev render-benchmarks install-warm.json --title "Warm Installation" -cargo run -p puffin-dev render-benchmarks install-cold.json --title "Cold Installation" +cargo run -p uv-dev render-benchmarks resolve-warm.json --title "Warm Resolution" +cargo run -p uv-dev render-benchmarks resolve-cold.json --title "Cold Resolution" +cargo run -p uv-dev render-benchmarks install-warm.json --title "Warm Installation" +cargo run -p uv-dev render-benchmarks install-cold.json --title "Cold Installation" ``` You need to install the [Roboto Font](https://fonts.google.com/specimen/Roboto) if the labels are missing in the generated graph. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14b771774936..9870d7013128 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Setup -[Rust](https://rustup.rs/), a C compiler, and CMake are required to build Puffin. +[Rust](https://rustup.rs/), a C compiler, and CMake are required to build uv. ### Linux @@ -35,7 +35,7 @@ You can install CMake from the [installers](https://cmake.org/download/) or with ## Testing -Testing Puffin requires multiple specific Python versions. You can install them into +Testing uv requires multiple specific Python versions. You can install them into `/bin` via our bootstrapping script: ```shell @@ -55,10 +55,10 @@ For running tests, we recommend [nextest](https://nexte.st/). Source distributions can run arbitrary code on build and can make unwanted modifications to your system (https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html, https://pypi.org/project/nvidia-pyindex/), which can even occur when just resolving requirements. To prevent this, there's a Docker container you can run commands in: ```bash -docker buildx build -t puffin-builder -f builder.dockerfile --load . +docker buildx build -t uv-builder -f builder.dockerfile --load . # Build for musl to avoid glibc errors, might not be required with your OS version cargo build --target x86_64-unknown-linux-musl --profile profiling --features vendored-openssl -docker run --rm -it -v $(pwd):/app puffin-builder /app/target/x86_64-unknown-linux-musl/profiling/puffin-dev resolve-many --cache-dir /app/cache-docker /app/scripts/popular_packages/pypi_10k_most_dependents.txt +docker run --rm -it -v $(pwd):/app uv-builder /app/target/x86_64-unknown-linux-musl/profiling/uv-dev resolve-many --cache-dir /app/cache-docker /app/scripts/popular_packages/pypi_10k_most_dependents.txt ``` We recommend using this container if you don't trust the dependency tree of the package(s) you are trying to resolve or install. @@ -66,16 +66,16 @@ We recommend using this container if you don't trust the dependency tree of the ## Profiling -Please refer to Ruff's [Profiling Guide](https://github.com/astral-sh/ruff/blob/main/CONTRIBUTING.md#profiling-projects), it applies to Puffin, too. +Please refer to Ruff's [Profiling Guide](https://github.com/astral-sh/ruff/blob/main/CONTRIBUTING.md#profiling-projects), it applies to uv, too. ### Analysing concurrency -You can use [tracing-durations-export](https://github.com/konstin/tracing-durations-export) to visualize parallel requests and find any spots where Puffin is CPU-bound. Example usage, with `puffin` and `puffin-dev` respectively: +You can use [tracing-durations-export](https://github.com/konstin/tracing-durations-export) to visualize parallel requests and find any spots where uv is CPU-bound. Example usage, with `uv` and `uv-dev` respectively: ```bash -RUST_LOG=puffin=info TRACING_DURATIONS_FILE=target/traces/jupyter.ndjson cargo run --features tracing-durations-export --profile profiling -- pip compile scripts/requirements/jupyter.in +RUST_LOG=uv=info TRACING_DURATIONS_FILE=target/traces/jupyter.ndjson cargo run --features tracing-durations-export --profile profiling -- pip compile scripts/requirements/jupyter.in ``` ```bash -RUST_LOG=puffin=info TRACING_DURATIONS_FILE=target/traces/jupyter.ndjson cargo run --features tracing-durations-export --bin puffin-dev --profile profiling -- resolve jupyter +RUST_LOG=uv=info TRACING_DURATIONS_FILE=target/traces/jupyter.ndjson cargo run --features tracing-durations-export --bin uv-dev --profile profiling -- resolve jupyter ``` diff --git a/Cargo.lock b/Cargo.lock index 98bd24da7ff4..af34f6bc0295 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -836,11 +836,11 @@ dependencies = [ "insta", "pep440_rs 0.4.0", "platform-tags", - "puffin-normalize", "rkyv", "serde", "thiserror", "url", + "uv-normalize", ] [[package]] @@ -856,9 +856,6 @@ dependencies = [ "pep440_rs 0.4.0", "pep508_rs", "platform-tags", - "puffin-fs", - "puffin-git", - "puffin-normalize", "pypi-types", "rkyv", "rustc-hash", @@ -867,6 +864,9 @@ dependencies = [ "sha2", "thiserror", "url", + "uv-fs", + "uv-git", + "uv-normalize", ] [[package]] @@ -1240,14 +1240,14 @@ dependencies = [ "directories", "fs-err", "platform-host", - "puffin-cache", - "puffin-interpreter", "serde", "serde_json", "tempfile", "thiserror", "tracing", "tracing-subscriber", + "uv-cache", + "uv-interpreter", "which", ] @@ -1303,9 +1303,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -1547,8 +1547,6 @@ dependencies = [ "platform-host", "platform-info", "plist", - "puffin-fs", - "puffin-normalize", "pyo3", "pypi-types", "rayon", @@ -1564,6 +1562,8 @@ dependencies = [ "tracing", "tracing-subscriber", "url", + "uv-fs", + "uv-normalize", "walkdir", "zip", ] @@ -2190,8 +2190,6 @@ dependencies = [ "log", "once_cell", "pep440_rs 0.4.0", - "puffin-fs", - "puffin-normalize", "pyo3", "pyo3-log", "regex", @@ -2203,6 +2201,8 @@ dependencies = [ "tracing", "unicode-width", "url", + "uv-fs", + "uv-normalize", ] [[package]] @@ -2261,9 +2261,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain" @@ -2442,747 +2442,267 @@ dependencies = [ ] [[package]] -name = "puffin" -version = "0.0.4" +name = "pyo3" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ - "anstream", - "anyhow", - "assert_cmd", - "assert_fs", - "chrono", - "clap", - "console", - "ctrlc", - "distribution-filename", - "distribution-types", - "dunce", - "filetime", - "flate2", - "fs-err", - "futures", - "gourgeist", - "indicatif", + "cfg-if", "indoc", - "insta", - "install-wheel-rs", - "itertools 0.12.1", - "miette", - "mimalloc", - "owo-colors 4.0.0", - "pep440_rs 0.4.0", - "pep508_rs", - "platform-host", - "platform-tags", - "predicates", - "pubgrub", - "puffin-build", - "puffin-cache", - "puffin-client", - "puffin-dispatch", - "puffin-distribution", - "puffin-fs", - "puffin-installer", - "puffin-interpreter", - "puffin-normalize", - "puffin-resolver", - "puffin-traits", - "puffin-warnings", - "pypi-types", - "pyproject-toml", - "regex", - "requirements-txt", - "reqwest", - "rustc-hash", - "tempfile", - "textwrap", - "thiserror", - "tikv-jemallocator", - "tokio", - "toml", - "tracing", - "tracing-durations-export", - "tracing-subscriber", - "tracing-tree", - "url", - "which", + "libc", + "memoffset", + "parking_lot 0.12.1", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", ] [[package]] -name = "puffin-build" -version = "0.0.1" +name = "pyo3-build-config" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be" dependencies = [ - "anyhow", - "distribution-types", - "fs-err", - "gourgeist", - "indoc", - "insta", - "itertools 0.12.1", "once_cell", - "pep508_rs", - "platform-host", - "puffin-extract", - "puffin-fs", - "puffin-interpreter", - "puffin-traits", - "pypi-types", - "pyproject-toml", - "regex", - "serde", - "serde_json", - "tempfile", - "thiserror", - "tokio", - "toml", - "tracing", + "target-lexicon", ] [[package]] -name = "puffin-cache" -version = "0.0.1" +name = "pyo3-ffi" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1" dependencies = [ - "cache-key", - "cachedir", - "clap", - "directories", - "distribution-types", - "fs-err", - "nanoid", - "puffin-fs", - "puffin-normalize", - "pypi-types", - "serde", - "tempfile", - "tracing", - "url", - "walkdir", + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-log" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c10808ee7250403bedb24bc30c32493e93875fef7ba3e4292226fe924f398bd" +dependencies = [ + "arc-swap", + "log", + "pyo3", +] + +[[package]] +name = "pyo3-macros" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f738b4e40d50b5711957f142878cfa0f28e054aa0ebdfc3fd137a843f74ed3" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc910d4851847827daf9d6cdd4a823fbdaab5b8818325c5e97a86da79e8881f" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] -name = "puffin-client" +name = "pypi-types" version = "0.0.1" dependencies = [ - "anyhow", - "async-trait", - "async_http_range_reader", - "async_zip", - "cache-key", "chrono", - "distribution-filename", - "distribution-types", - "fs-err", - "futures", - "html-escape", - "http", + "indoc", "insta", - "install-wheel-rs", + "mailparse", + "once_cell", "pep440_rs 0.4.0", "pep508_rs", - "platform-tags", - "puffin-cache", - "puffin-fs", - "puffin-normalize", - "pypi-types", - "reqwest", - "reqwest-middleware", - "reqwest-retry", + "regex", "rkyv", - "rmp-serde", - "rustc-hash", "serde", "serde_json", - "sha2", - "task-local-extensions", "tempfile", + "test-case", "thiserror", - "tl", - "tokio", - "tokio-util", "tracing", "url", + "uv-normalize", ] [[package]] -name = "puffin-dev" -version = "0.0.1" +name = "pyproject-toml" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46d4a5e69187f23a29f8aa0ea57491d104ba541bc55f76552c2a74962aa20e04" dependencies = [ - "anstream", - "anyhow", - "chrono", - "clap", - "distribution-filename", - "distribution-types", - "fs-err", - "futures", - "gourgeist", - "indicatif", - "install-wheel-rs", - "itertools 0.12.1", - "mimalloc", - "owo-colors 4.0.0", - "pep440_rs 0.4.0", + "indexmap 2.2.3", + "pep440_rs 0.3.12", "pep508_rs", - "petgraph", - "platform-host", - "platform-tags", - "poloto", - "puffin-build", - "puffin-cache", - "puffin-client", - "puffin-dispatch", - "puffin-distribution", - "puffin-installer", - "puffin-interpreter", - "puffin-normalize", - "puffin-resolver", - "puffin-traits", - "pypi-types", - "resvg", - "rustc-hash", "serde", - "serde_json", - "tagu", - "tempfile", - "tikv-jemallocator", - "tokio", - "tracing", - "tracing-durations-export", - "tracing-indicatif", - "tracing-subscriber", - "url", - "which", + "toml", ] [[package]] -name = "puffin-dispatch" -version = "0.0.1" +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ - "anyhow", - "distribution-types", - "fs-err", - "futures", - "gourgeist", - "itertools 0.12.1", - "pep508_rs", - "platform-host", - "platform-tags", - "puffin-build", - "puffin-cache", - "puffin-client", - "puffin-distribution", - "puffin-installer", - "puffin-interpreter", - "puffin-resolver", - "puffin-traits", - "pypi-types", - "tempfile", - "tokio", - "tracing", + "memchr", ] [[package]] -name = "puffin-distribution" -version = "0.0.1" +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "anyhow", - "cache-key", - "distribution-filename", - "distribution-types", - "fs-err", - "futures", - "install-wheel-rs", - "nanoid", - "pep440_rs 0.4.0", - "pep508_rs", - "platform-tags", - "puffin-cache", - "puffin-client", - "puffin-extract", - "puffin-fs", - "puffin-git", - "puffin-normalize", - "puffin-traits", - "pypi-types", - "reqwest", - "rmp-serde", - "rustc-hash", - "serde", - "tempfile", - "thiserror", - "tokio", - "tokio-util", - "tracing", - "url", - "zip", + "proc-macro2", ] [[package]] -name = "puffin-extract" -version = "0.0.1" -dependencies = [ - "async-compression", - "async_zip", - "flate2", - "fs-err", - "futures", - "rayon", - "rustc-hash", - "tar", - "thiserror", - "tokio", - "tokio-tar", - "tokio-util", - "zip", -] +name = "quoted_printable" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79ec282e887b434b68c18fe5c121d38e72a5cf35119b59e54ec5b992ea9c8eb0" [[package]] -name = "puffin-fs" -version = "0.0.1" +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "dunce", - "fs-err", - "fs2", - "junction", - "puffin-warnings", - "tempfile", - "tracing", + "libc", + "rand_chacha", + "rand_core", ] [[package]] -name = "puffin-git" -version = "0.0.1" +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "anyhow", - "base64 0.21.7", - "cache-key", - "cargo-util", - "git2", - "glob", - "hex", - "hmac", - "home", - "once_cell", - "puffin-fs", - "rand", - "reqwest", - "serde", - "sha1", - "tokio", - "tracing", - "url", + "ppv-lite86", + "rand_core", ] [[package]] -name = "puffin-installer" -version = "0.0.1" +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "anyhow", - "distribution-filename", - "distribution-types", - "fs-err", - "futures", - "install-wheel-rs", - "once-map", - "pep440_rs 0.4.0", - "pep508_rs", - "platform-tags", - "puffin-cache", - "puffin-client", - "puffin-distribution", - "puffin-extract", - "puffin-fs", - "puffin-git", - "puffin-interpreter", - "puffin-normalize", - "puffin-traits", - "pypi-types", - "rayon", - "requirements-txt", - "rustc-hash", - "tempfile", - "thiserror", - "tokio", - "tracing", - "url", + "getrandom", ] [[package]] -name = "puffin-interpreter" -version = "0.0.1" +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ - "anyhow", - "cache-key", - "fs-err", - "indoc", - "insta", - "itertools 0.12.1", - "once_cell", - "pep440_rs 0.4.0", - "pep508_rs", - "platform-host", - "platform-tags", - "puffin-cache", - "puffin-fs", - "regex", - "rmp-serde", - "same-file", - "serde", - "serde_json", - "tempfile", - "thiserror", - "tokio", - "tracing", - "which", + "either", + "rayon-core", ] [[package]] -name = "puffin-normalize" -version = "0.0.1" +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rkyv", - "serde", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "puffin-resolver" -version = "0.0.1" +name = "rctree" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "anstream", - "anyhow", - "cache-key", - "chrono", - "clap", - "dashmap", - "derivative", - "distribution-filename", - "distribution-types", - "either", - "fs-err", - "futures", - "gourgeist", - "indexmap 2.2.3", - "insta", - "install-wheel-rs", - "itertools 0.12.1", - "once-map", - "once_cell", - "owo-colors 4.0.0", - "pep440_rs 0.4.0", - "pep508_rs", - "petgraph", - "platform-host", - "platform-tags", - "pubgrub", - "puffin-cache", - "puffin-client", - "puffin-distribution", - "puffin-git", - "puffin-interpreter", - "puffin-normalize", - "puffin-traits", - "puffin-warnings", - "pypi-types", - "reqwest", - "rkyv", - "rustc-hash", - "serde_json", - "sha2", - "tempfile", - "thiserror", - "tokio", - "tokio-stream", - "tokio-util", - "tracing", - "url", - "zip", + "bitflags 1.3.2", ] [[package]] -name = "puffin-traits" -version = "0.0.1" +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "anyhow", - "distribution-types", - "once-map", - "pep508_rs", - "puffin-cache", - "puffin-interpreter", - "puffin-normalize", - "tokio", + "bitflags 1.3.2", ] [[package]] -name = "puffin-warnings" -version = "0.0.1" +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "anstream", - "once_cell", - "owo-colors 4.0.0", - "rustc-hash", + "bitflags 1.3.2", ] [[package]] -name = "pyo3" -version = "0.20.2" +name = "redox_users" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "cfg-if", - "indoc", - "libc", - "memoffset", - "parking_lot 0.12.1", - "pyo3-build-config", - "pyo3-ffi", - "pyo3-macros", - "unindent", + "getrandom", + "libredox", + "thiserror", ] [[package]] -name = "pyo3-build-config" -version = "0.20.2" +name = "reflink-copy" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be" +checksum = "767be24c0da52e7448d495b8d162506a9aa125426651d547d545d6c2b4b65b62" dependencies = [ - "once_cell", - "target-lexicon", + "cfg-if", + "rustix", + "windows", ] [[package]] -name = "pyo3-ffi" -version = "0.20.2" +name = "regex" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ - "libc", - "pyo3-build-config", + "aho-corasick", + "memchr", + "regex-automata 0.4.5", + "regex-syntax 0.8.2", ] [[package]] -name = "pyo3-log" -version = "0.9.0" +name = "regex-automata" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c10808ee7250403bedb24bc30c32493e93875fef7ba3e4292226fe924f398bd" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "arc-swap", - "log", - "pyo3", -] - -[[package]] -name = "pyo3-macros" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f738b4e40d50b5711957f142878cfa0f28e054aa0ebdfc3fd137a843f74ed3" -dependencies = [ - "proc-macro2", - "pyo3-macros-backend", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "pyo3-macros-backend" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc910d4851847827daf9d6cdd4a823fbdaab5b8818325c5e97a86da79e8881f" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "pypi-types" -version = "0.0.1" -dependencies = [ - "chrono", - "indoc", - "insta", - "mailparse", - "once_cell", - "pep440_rs 0.4.0", - "pep508_rs", - "puffin-normalize", - "regex", - "rkyv", - "serde", - "serde_json", - "tempfile", - "test-case", - "thiserror", - "tracing", - "url", -] - -[[package]] -name = "pyproject-toml" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d4a5e69187f23a29f8aa0ea57491d104ba541bc55f76552c2a74962aa20e04" -dependencies = [ - "indexmap 2.2.3", - "pep440_rs 0.3.12", - "pep508_rs", - "serde", - "toml", -] - -[[package]] -name = "quick-xml" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "quoted_printable" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ec282e887b434b68c18fe5c121d38e72a5cf35119b59e54ec5b992ea9c8eb0" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rayon" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rctree" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] -name = "reflink-copy" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767be24c0da52e7448d495b8d162506a9aa125426651d547d545d6c2b4b65b62" -dependencies = [ - "cfg-if", - "rustix", - "windows", -] - -[[package]] -name = "regex" -version = "1.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-syntax 0.6.29", ] [[package]] @@ -3230,8 +2750,6 @@ dependencies = [ "once_cell", "pep440_rs 0.4.0", "pep508_rs", - "puffin-fs", - "puffin-normalize", "regex", "serde", "serde_json", @@ -3241,6 +2759,8 @@ dependencies = [ "tracing", "unscanny", "url", + "uv-fs", + "uv-normalize", ] [[package]] @@ -4248,9 +3768,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "99e68c159e8f5ba8a28c4eb7b0c0c190d77bb479047ca713270048145a9ad28a" dependencies = [ "indexmap 2.2.3", "serde", @@ -4540,6 +4060,486 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +[[package]] +name = "uv" +version = "0.0.4" +dependencies = [ + "anstream", + "anyhow", + "assert_cmd", + "assert_fs", + "chrono", + "clap", + "console", + "ctrlc", + "distribution-filename", + "distribution-types", + "dunce", + "filetime", + "flate2", + "fs-err", + "futures", + "gourgeist", + "indicatif", + "indoc", + "insta", + "install-wheel-rs", + "itertools 0.12.1", + "miette", + "mimalloc", + "owo-colors 4.0.0", + "pep440_rs 0.4.0", + "pep508_rs", + "platform-host", + "platform-tags", + "predicates", + "pubgrub", + "pypi-types", + "pyproject-toml", + "regex", + "requirements-txt", + "reqwest", + "rustc-hash", + "tempfile", + "textwrap", + "thiserror", + "tikv-jemallocator", + "tokio", + "toml", + "tracing", + "tracing-durations-export", + "tracing-subscriber", + "tracing-tree", + "url", + "uv-build", + "uv-cache", + "uv-client", + "uv-dispatch", + "uv-distribution", + "uv-fs", + "uv-installer", + "uv-interpreter", + "uv-normalize", + "uv-resolver", + "uv-traits", + "uv-warnings", + "which", +] + +[[package]] +name = "uv-build" +version = "0.0.1" +dependencies = [ + "anyhow", + "distribution-types", + "fs-err", + "gourgeist", + "indoc", + "insta", + "itertools 0.12.1", + "once_cell", + "pep508_rs", + "platform-host", + "pypi-types", + "pyproject-toml", + "regex", + "serde", + "serde_json", + "tempfile", + "thiserror", + "tokio", + "toml", + "tracing", + "uv-extract", + "uv-fs", + "uv-interpreter", + "uv-traits", +] + +[[package]] +name = "uv-cache" +version = "0.0.1" +dependencies = [ + "cache-key", + "cachedir", + "clap", + "directories", + "distribution-types", + "fs-err", + "nanoid", + "pypi-types", + "serde", + "tempfile", + "tracing", + "url", + "uv-fs", + "uv-normalize", + "walkdir", +] + +[[package]] +name = "uv-client" +version = "0.0.1" +dependencies = [ + "anyhow", + "async-trait", + "async_http_range_reader", + "async_zip", + "cache-key", + "chrono", + "distribution-filename", + "distribution-types", + "fs-err", + "futures", + "html-escape", + "http", + "insta", + "install-wheel-rs", + "pep440_rs 0.4.0", + "pep508_rs", + "platform-tags", + "pypi-types", + "reqwest", + "reqwest-middleware", + "reqwest-retry", + "rkyv", + "rmp-serde", + "rustc-hash", + "serde", + "serde_json", + "sha2", + "task-local-extensions", + "tempfile", + "thiserror", + "tl", + "tokio", + "tokio-util", + "tracing", + "url", + "uv-cache", + "uv-fs", + "uv-normalize", +] + +[[package]] +name = "uv-dev" +version = "0.0.1" +dependencies = [ + "anstream", + "anyhow", + "chrono", + "clap", + "distribution-filename", + "distribution-types", + "fs-err", + "futures", + "gourgeist", + "indicatif", + "install-wheel-rs", + "itertools 0.12.1", + "mimalloc", + "owo-colors 4.0.0", + "pep440_rs 0.4.0", + "pep508_rs", + "petgraph", + "platform-host", + "platform-tags", + "poloto", + "pypi-types", + "resvg", + "rustc-hash", + "serde", + "serde_json", + "tagu", + "tempfile", + "tikv-jemallocator", + "tokio", + "tracing", + "tracing-durations-export", + "tracing-indicatif", + "tracing-subscriber", + "url", + "uv-build", + "uv-cache", + "uv-client", + "uv-dispatch", + "uv-distribution", + "uv-installer", + "uv-interpreter", + "uv-normalize", + "uv-resolver", + "uv-traits", + "which", +] + +[[package]] +name = "uv-dispatch" +version = "0.0.1" +dependencies = [ + "anyhow", + "distribution-types", + "fs-err", + "futures", + "gourgeist", + "itertools 0.12.1", + "pep508_rs", + "platform-host", + "platform-tags", + "pypi-types", + "tempfile", + "tokio", + "tracing", + "uv-build", + "uv-cache", + "uv-client", + "uv-distribution", + "uv-installer", + "uv-interpreter", + "uv-resolver", + "uv-traits", +] + +[[package]] +name = "uv-distribution" +version = "0.0.1" +dependencies = [ + "anyhow", + "cache-key", + "distribution-filename", + "distribution-types", + "fs-err", + "futures", + "install-wheel-rs", + "nanoid", + "pep440_rs 0.4.0", + "pep508_rs", + "platform-tags", + "pypi-types", + "reqwest", + "rmp-serde", + "rustc-hash", + "serde", + "tempfile", + "thiserror", + "tokio", + "tokio-util", + "tracing", + "url", + "uv-cache", + "uv-client", + "uv-extract", + "uv-fs", + "uv-git", + "uv-normalize", + "uv-traits", + "zip", +] + +[[package]] +name = "uv-extract" +version = "0.0.1" +dependencies = [ + "async-compression", + "async_zip", + "flate2", + "fs-err", + "futures", + "rayon", + "rustc-hash", + "tar", + "thiserror", + "tokio", + "tokio-tar", + "tokio-util", + "zip", +] + +[[package]] +name = "uv-fs" +version = "0.0.1" +dependencies = [ + "dunce", + "fs-err", + "fs2", + "junction", + "tempfile", + "tracing", + "uv-warnings", +] + +[[package]] +name = "uv-git" +version = "0.0.1" +dependencies = [ + "anyhow", + "base64 0.21.7", + "cache-key", + "cargo-util", + "git2", + "glob", + "hex", + "hmac", + "home", + "once_cell", + "rand", + "reqwest", + "serde", + "sha1", + "tokio", + "tracing", + "url", + "uv-fs", +] + +[[package]] +name = "uv-installer" +version = "0.0.1" +dependencies = [ + "anyhow", + "distribution-filename", + "distribution-types", + "fs-err", + "futures", + "install-wheel-rs", + "once-map", + "pep440_rs 0.4.0", + "pep508_rs", + "platform-tags", + "pypi-types", + "rayon", + "requirements-txt", + "rustc-hash", + "tempfile", + "thiserror", + "tokio", + "tracing", + "url", + "uv-cache", + "uv-client", + "uv-distribution", + "uv-extract", + "uv-fs", + "uv-git", + "uv-interpreter", + "uv-normalize", + "uv-traits", +] + +[[package]] +name = "uv-interpreter" +version = "0.0.1" +dependencies = [ + "anyhow", + "cache-key", + "fs-err", + "indoc", + "insta", + "itertools 0.12.1", + "once_cell", + "pep440_rs 0.4.0", + "pep508_rs", + "platform-host", + "platform-tags", + "regex", + "rmp-serde", + "same-file", + "serde", + "serde_json", + "tempfile", + "thiserror", + "tokio", + "tracing", + "uv-cache", + "uv-fs", + "which", +] + +[[package]] +name = "uv-normalize" +version = "0.0.1" +dependencies = [ + "rkyv", + "serde", +] + +[[package]] +name = "uv-resolver" +version = "0.0.1" +dependencies = [ + "anstream", + "anyhow", + "cache-key", + "chrono", + "clap", + "dashmap", + "derivative", + "distribution-filename", + "distribution-types", + "either", + "fs-err", + "futures", + "gourgeist", + "indexmap 2.2.3", + "insta", + "install-wheel-rs", + "itertools 0.12.1", + "once-map", + "once_cell", + "owo-colors 4.0.0", + "pep440_rs 0.4.0", + "pep508_rs", + "petgraph", + "platform-host", + "platform-tags", + "pubgrub", + "pypi-types", + "reqwest", + "rkyv", + "rustc-hash", + "serde_json", + "sha2", + "tempfile", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", + "url", + "uv-cache", + "uv-client", + "uv-distribution", + "uv-git", + "uv-interpreter", + "uv-normalize", + "uv-traits", + "uv-warnings", + "zip", +] + +[[package]] +name = "uv-traits" +version = "0.0.1" +dependencies = [ + "anyhow", + "distribution-types", + "once-map", + "pep508_rs", + "tokio", + "uv-cache", + "uv-interpreter", + "uv-normalize", +] + +[[package]] +name = "uv-warnings" +version = "0.0.1" +dependencies = [ + "anstream", + "once_cell", + "owo-colors 4.0.0", + "rustc-hash", +] + [[package]] name = "valuable" version = "0.1.0" @@ -4938,9 +4938,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 60867d98c99f..527346000a7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,17 +3,17 @@ members = ["crates/*"] exclude = [ "scripts", # Needs nightly - "crates/puffin-trampoline" + "crates/uv-trampoline" ] resolver = "2" [workspace.package] edition = "2021" rust-version = "1.74" -homepage = "https://pypi.org/project/puffin-alpha/" -documentation = "https://pypi.org/project/puffin-alpha/" -repository = "https://github.com/astral-sh/puffin" -authors = ["Puffin"] +homepage = "https://pypi.org/project/uv/" +documentation = "https://pypi.org/project/uv/" +repository = "https://github.com/astral-sh/uv" +authors = ["uv"] license = "MIT OR Apache-2.0" [workspace.dependencies] diff --git a/Dockerfile b/Dockerfile index 16be9504357a..b00ead2f4e75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,13 @@ ENV HOME="/root" WORKDIR $HOME RUN apt update \ - && apt install -y --no-install-recommends \ - build-essential \ - curl \ - python3-venv \ - cmake \ - && apt clean \ - && rm -rf /var/lib/apt/lists/* + && apt install -y --no-install-recommends \ + build-essential \ + curl \ + python3-venv \ + cmake \ + && apt clean \ + && rm -rf /var/lib/apt/lists/* # Setup zig as cross compiling linker RUN python3 -m venv $HOME/.venv @@ -19,10 +19,10 @@ ENV PATH="$HOME/.venv/bin:$PATH" # Install rust ARG TARGETPLATFORM RUN case "$TARGETPLATFORM" in \ - "linux/arm64") echo "aarch64-unknown-linux-musl" > rust_target.txt ;; \ - "linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \ - *) exit 1 ;; \ - esac + "linux/arm64") echo "aarch64-unknown-linux-musl" > rust_target.txt ;; \ + "linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \ + *) exit 1 ;; \ + esac # Update rustup whenever we bump the rust version COPY rust-toolchain.toml rust-toolchain.toml RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target $(cat rust_target.txt) --profile minimal --default-toolchain none @@ -34,12 +34,12 @@ RUN rustup target add $(cat rust_target.txt) COPY crates crates COPY ./Cargo.toml Cargo.toml COPY ./Cargo.lock Cargo.lock -RUN cargo zigbuild --bin puffin --target $(cat rust_target.txt) --release -RUN cp target/$(cat rust_target.txt)/release/puffin /puffin +RUN cargo zigbuild --bin uv --target $(cat rust_target.txt) --release +RUN cp target/$(cat rust_target.txt)/release/uv /uv # TODO(konsti): Optimize binary size, with a version that also works when cross compiling -# RUN strip --strip-all /puffin +# RUN strip --strip-all /uv FROM scratch -COPY --from=build /puffin /puffin +COPY --from=build /uv /uv WORKDIR /io -ENTRYPOINT ["/puffin"] +ENTRYPOINT ["/uv"] diff --git a/README.md b/README.md index 0aba56a089fa..8c0111c23e08 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ -# Puffin +# uv -[![Puffin](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/puffin/main/assets/badge/v0.json)](https://github.com/astral-sh/puffin) -[![image](https://img.shields.io/pypi/v/puffin-alpha.svg)](https://pypi.python.org/pypi/puffin-alpha) -[![image](https://img.shields.io/pypi/l/puffin-alpha.svg)](https://pypi.python.org/pypi/puffin-alpha) -[![image](https://img.shields.io/pypi/pyversions/puffin-alpha.svg)](https://pypi.python.org/pypi/puffin-alpha) -[![Actions status](https://github.com/astral-sh/puffin/workflows/CI/badge.svg)](https://github.com/astral-sh/puffin/actions) +[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv) +[![image](https://img.shields.io/pypi/v/uv.svg)](https://pypi.python.org/pypi/uv) +[![image](https://img.shields.io/pypi/l/uv.svg)](https://pypi.python.org/pypi/uv) +[![image](https://img.shields.io/pypi/pyversions/uv.svg)](https://pypi.python.org/pypi/uv) +[![Actions status](https://github.com/astral-sh/uv/workflows/CI/badge.svg)](https://github.com/astral-sh/uv/actions) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.gg/astral-sh) An extremely fast Python package installer and resolver, written in Rust. Designed as a drop-in replacement for `pip` and `pip-compile`. -Puffin is backed by [Astral](https://astral.sh), the creators of [Ruff](https://github.com/astral-sh/ruff). +uv is backed by [Astral](https://astral.sh), the creators of [Ruff](https://github.com/astral-sh/ruff). ## Highlights - ⚖️ Drop-in replacement for common `pip`, `pip-tools`, and `virtualenv` commands. -- ⚡️ [10-100x faster](https://github.com/astral-sh/puffin/blob/main/BENCHMARKS.md) than `pip` +- ⚡️ [10-100x faster](https://github.com/astral-sh/uv/blob/main/BENCHMARKS.md) than `pip` and `pip-tools` (`pip-compile` and `pip-sync`). - 💾 Disk-space efficient, with a global cache for dependency deduplication. -- 🐍 Installable via `curl`, `pip`, `pipx`, etc. Puffin is a static binary that can be installed +- 🐍 Installable via `curl`, `pip`, `pipx`, etc. uv is a static binary that can be installed without Rust or Python. - 🧪 Tested at-scale against the top 10,000 PyPI packages. - 🖥️ Support for macOS, Linux, and Windows. @@ -31,85 +31,85 @@ Puffin is backed by [Astral](https://astral.sh), the creators of [Ruff](https:// ## Getting Started -Install Puffin with our standalone installers, or from [PyPI](https://pypi.org/project/puffin/): +Install uv with our standalone installers, or from [PyPI](https://pypi.org/project/uv/): ```shell # On macOS and Linux. -curl -LsSf https://astral.sh/puffin/install.sh | sh +curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows. -irm https://astral.sh/puffin/install.ps1 | iex +irm https://astral.sh/uv/install.ps1 | iex # With pip. -pip install puffin +pip install uv # With pipx. -pipx install puffin +pipx install uv ``` To create a virtual environment: ```shell -puffin venv # Create a virtual environment at .venv. +uv venv # Create a virtual environment at .venv. ``` To install a package into the virtual environment: ```shell -puffin pip install flask # Install Flask. -puffin pip install -r requirements.txt # Install from a requirements.txt file. -puffin pip install -e . # Install the current project in editable mode. +uv pip install flask # Install Flask. +uv pip install -r requirements.txt # Install from a requirements.txt file. +uv pip install -e . # Install the current project in editable mode. ``` To generate a set of locked dependencies from an input file: ```shell -puffin pip compile pyproject.toml -o requirements.txt # Read a pyproject.toml file. -puffin pip compile requirements.in -o requirements.txt # Read a requirements.in file. +uv pip compile pyproject.toml -o requirements.txt # Read a pyproject.toml file. +uv pip compile requirements.in -o requirements.txt # Read a requirements.in file. ``` To sync a set of locked dependencies with the virtual environment: ```shell -puffin pip sync requirements.txt # Install from a requirements.txt file. +uv pip sync requirements.txt # Install from a requirements.txt file. ``` -Puffin's `pip-install` and `pip-compile` commands supports many of the same command-line arguments +uv's `pip-install` and `pip-compile` commands supports many of the same command-line arguments as existing tools, including `-r requirements.txt`, `-c constraints.txt`, `-e .` (for editable installs), `--index-url`, and more. ## Limitations -Puffin does not support the entire `pip` feature set. Namely, Puffin does not (and does not plan to) +uv does not support the entire `pip` feature set. Namely, uv does not (and does not plan to) support the following `pip` features: - `.egg` dependencies - Editable installs for Git and direct URL dependencies (editable installs _are_ supported for local dependencies) -On the other hand, Puffin plans to (but does not currently) support: +On the other hand, uv plans to (but does not currently) support: -- [Hash-checking mode](https://github.com/astral-sh/puffin/issues/474) -- [URL requirements without package names](https://github.com/astral-sh/puffin/issues/313) +- [Hash-checking mode](https://github.com/astral-sh/uv/issues/474) +- [URL requirements without package names](https://github.com/astral-sh/uv/issues/313) (e.g., `https://...` instead of `package @ https://...`) -Like `pip-compile`, Puffin generates a platform-specific `requirements.txt` file (unlike, e.g., +Like `pip-compile`, uv generates a platform-specific `requirements.txt` file (unlike, e.g., `poetry` and `pdm`, which generate platform-agnostic `poetry.lock` and `pdm.lock` files). As such, -Puffin's `requirements.txt` files may not be portable across platforms and Python versions. +uv's `requirements.txt` files may not be portable across platforms and Python versions. ## Roadmap -Puffin is an extremely fast Python package resolver and installer, designed as a drop-in +uv is an extremely fast Python package resolver and installer, designed as a drop-in replacement for `pip`, `pip-tools` (`pip-compile` and `pip-sync`), and `virtualenv`. -Puffin represents an intermediary goal in our pursuit of a ["Cargo for Python"](https://blog.rust-lang.org/2016/05/05/cargo-pillars.html#pillars-of-cargo): +uv represents an intermediary goal in our pursuit of a ["Cargo for Python"](https://blog.rust-lang.org/2016/05/05/cargo-pillars.html#pillars-of-cargo): a comprehensive project and package manager that is extremely fast, reliable, and easy to use. Think: a single binary that bootstraps your Python installation and gives you everything you need to be productive with Python, bundling not only `pip`, `pip-tools`, and `virtualenv`, but also `pipx`, `tox`, `poetry`, `pyenv`, `ruff`, and more. -Our goal is to evolve Puffin into such a tool. +Our goal is to evolve uv into such a tool. In the meantime, though, the narrower `pip-tools` scope allows us to solve the low-level problems involved in building such a tool (like package installation) while shipping something immediately @@ -119,20 +119,20 @@ useful with minimal barrier to adoption. ### Python discovery -Puffin itself does not depend on Python, but it does need to locate a Python environment to (1) +uv itself does not depend on Python, but it does need to locate a Python environment to (1) install dependencies into the environment and (2) build source distributions. -When running `pip sync` or `pip install`, Puffin will search for a virtual environment in the +When running `pip sync` or `pip install`, uv will search for a virtual environment in the following order: - An activated virtual environment based on the `VIRTUAL_ENV` environment variable. - An activated Conda environment based on the `CONDA_PREFIX` environment variable. - A virtual environment at `.venv` in the current directory, or in the nearest parent directory. -If no virtual environment is found, Puffin will prompt the user to create one in the current -directory via `puffin venv`. +If no virtual environment is found, uv will prompt the user to create one in the current +directory via `uv venv`. -When running `pip compile`, Puffin does not _require_ a virtual environment and will search for a +When running `pip compile`, uv does not _require_ a virtual environment and will search for a Python interpreter in the following order: - An activated virtual environment based on the `VIRTUAL_ENV` environment variable. @@ -140,51 +140,51 @@ Python interpreter in the following order: - A virtual environment at `.venv` in the current directory, or in the nearest parent directory. - The Python interpreter available as `python3` on macOS and Linux, or `python.exe` on Windows. -If a `--python-version` is provided to `pip compile` (e.g., `--python-version=3.7`), Puffin will +If a `--python-version` is provided to `pip compile` (e.g., `--python-version=3.7`), uv will search for a Python interpreter matching that version in the following order: - An activated virtual environment based on the `VIRTUAL_ENV` environment variable. - An activated Conda environment based on the `CONDA_PREFIX` environment variable. - A virtual environment at `.venv` in the current directory, or in the nearest parent directory. -- The Python interpreter available as, e.g., `python3.7` on macOS and Linux. On Windows, Puffin +- The Python interpreter available as, e.g., `python3.7` on macOS and Linux. On Windows, uv will use the same mechanism as `py --list-paths` to discover all available Python interpreters, and will select the first interpreter matching the requested version. - The Python interpreter available as `python3` on macOS and Linux, or `python.exe` on Windows. -Since Puffin has no dependency on Python, it can even install into virtual environments other than -its own. For example, setting `VIRTUAL_ENV=/path/to/venv` will cause Puffin to install into -`/path/to/venv`, no matter where Puffin is installed. +Since uv has no dependency on Python, it can even install into virtual environments other than +its own. For example, setting `VIRTUAL_ENV=/path/to/venv` will cause uv to install into +`/path/to/venv`, no matter where uv is installed. ### Dependency caching -Puffin uses aggressive caching to avoid re-downloading (and re-building dependencies) that have +uv uses aggressive caching to avoid re-downloading (and re-building dependencies) that have already been accessed in prior runs. -The specifics of Puffin's caching semantics vary based on the nature of the dependency: +The specifics of uv's caching semantics vary based on the nature of the dependency: -- **For registry dependencies** (like those downloaded from PyPI), Puffin respects HTTP caching headers. -- **For direct URL dependencies**, Puffin respects HTTP caching headers, and also caches based on +- **For registry dependencies** (like those downloaded from PyPI), uv respects HTTP caching headers. +- **For direct URL dependencies**, uv respects HTTP caching headers, and also caches based on the URL itself. -- **For Git dependencies**, Puffin caches based on the fully-resolved Git commit hash. As such, - `puffin pip compile` will pin Git dependencies to a specific commit hash when writing the resolved +- **For Git dependencies**, uv caches based on the fully-resolved Git commit hash. As such, + `uv pip compile` will pin Git dependencies to a specific commit hash when writing the resolved dependency set. -- **For local dependencies**, Puffin caches based on the last-modified time of the `setup.py` or +- **For local dependencies**, uv caches based on the last-modified time of the `setup.py` or `pyproject.toml` file. -If you're running into caching issues, Puffin includes a few escape hatches: +If you're running into caching issues, uv includes a few escape hatches: -- To force Puffin to revalidate cached data for all dependencies, run `puffin pip install --refresh ...`. -- To force Puffin to revalidate cached data for a specific dependency, run, e.g., `puffin pip install --refresh-package flask ...`. -- To force Puffin to ignore existing installed versions, run `puffin pip install --reinstall ...`. -- To clear the global cache entirely, run `puffin clean`. +- To force uv to revalidate cached data for all dependencies, run `uv pip install --refresh ...`. +- To force uv to revalidate cached data for a specific dependency, run, e.g., `uv pip install --refresh-package flask ...`. +- To force uv to ignore existing installed versions, run `uv pip install --reinstall ...`. +- To clear the global cache entirely, run `uv clean`. ### Resolution strategy -By default, Puffin follows the standard Python dependency resolution strategy of preferring the -latest compatible version of each package. For example, `puffin pip install flask>=2.0.0` will +By default, uv follows the standard Python dependency resolution strategy of preferring the +latest compatible version of each package. For example, `uv pip install flask>=2.0.0` will install the latest version of Flask (at time of writing: `3.0.0`). -However, Puffin's resolution strategy be configured to prefer the _lowest_ compatible version of +However, uv's resolution strategy be configured to prefer the _lowest_ compatible version of each package (`--resolution=lowest`), or even the lowest compatible version of any _direct_ dependencies (`--resolution=lowest-direct`), both of which can be useful for library authors looking to test their packages against the oldest supported versions of their dependencies. @@ -195,11 +195,11 @@ For example, given the following `requirements.in` file: flask>=2.0.0 ``` -Running `puffin pip compile requirements.in` would produce the following `requirements.txt` file: +Running `uv pip compile requirements.in` would produce the following `requirements.txt` file: ```text -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile requirements.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -217,11 +217,11 @@ werkzeug==3.0.1 # via flask ``` -However, `puffin pip compile --resolution=lowest requirements.in` would instead produce: +However, `uv pip compile --resolution=lowest requirements.in` would instead produce: ```text -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile requirements.in --resolution=lowest +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile requirements.in --resolution=lowest click==7.1.2 # via flask flask==2.0.0 @@ -237,13 +237,13 @@ werkzeug==2.0.0 ### Pre-release handling -By default, Puffin will accept pre-release versions during dependency resolution in two cases: +By default, uv will accept pre-release versions during dependency resolution in two cases: 1. If the package is a direct dependency, and its version markers include a pre-release specifier (e.g., `flask>=2.0.0rc1`). 1. If _all_ published versions of a package are pre-releases. -If dependency resolution fails due to a transitive pre-release, Puffin will prompt the user to +If dependency resolution fails due to a transitive pre-release, uv will prompt the user to re-run with `--prerelease=allow`, to allow pre-releases for all dependencies. Alternatively, you can add the transitive dependency to your `requirements.in` file with @@ -251,7 +251,7 @@ pre-release specifier (e.g., `flask>=2.0.0rc1`) to opt in to pre-release support dependency. Pre-releases are [notoriously difficult](https://pubgrub-rs-guide.netlify.app/limitations/prerelease_versions) -to model, and are a frequent source of bugs in other packaging tools. Puffin's pre-release handling +to model, and are a frequent source of bugs in other packaging tools. uv's pre-release handling is _intentionally_ limited and _intentionally_ requires user intervention to opt in to pre-releases to ensure correctness, though pre-release handling will be revisited in future releases. @@ -260,7 +260,7 @@ to ensure correctness, though pre-release handling will be revisited in future r Historically, `pip` has supported "constraints" (`-c constraints.txt`), which allows users to narrow the set of acceptable versions for a given package. -Puffin supports constraints, but also takes this concept further by allowing users to _override_ the +uv supports constraints, but also takes this concept further by allowing users to _override_ the acceptable versions of a package across the dependency tree via overrides (`-o overrides.txt`). In short, overrides allow the user to lie to the resolver by overriding the declared dependencies @@ -278,28 +278,28 @@ hatch for erroneous upper version bounds. ### Multi-version resolution -Puffin's `pip-compile` command produces a resolution that's known to be compatible with the -current platform and Python version. Unlike Poetry, PDM, and other package managers, Puffin does +uv's `pip-compile` command produces a resolution that's known to be compatible with the +current platform and Python version. Unlike Poetry, PDM, and other package managers, uv does not yet produce a machine-agnostic lockfile. -However, Puffin _does_ support resolving for alternate Python versions via the `--python-version` -command line argument. For example, if you're running Puffin on Python 3.9, but want to resolve for -Python 3.8, you can run `puffin pip compile --python-version=3.8 requirements.in` to produce a +However, uv _does_ support resolving for alternate Python versions via the `--python-version` +command line argument. For example, if you're running uv on Python 3.9, but want to resolve for +Python 3.8, you can run `uv pip compile --python-version=3.8 requirements.in` to produce a Python 3.8-compatible resolution. ## Platform support -Puffin has Tier 1 support for the following platforms: +uv has Tier 1 support for the following platforms: - macOS (Apple Silicon) - macOS (x86_64) - Linux (x86_64) - Windows (x86_64) -Puffin is continuously built, tested, and developed against its Tier 1 platforms. Inspired by the +uv is continuously built, tested, and developed against its Tier 1 platforms. Inspired by the Rust project, Tier 1 can be thought of as ["guaranteed to work"](https://doc.rust-lang.org/beta/rustc/platform-support.html). -Puffin has Tier 2 support (["guaranteed to build"](https://doc.rust-lang.org/beta/rustc/platform-support.html)) for the following platforms: +uv has Tier 2 support (["guaranteed to build"](https://doc.rust-lang.org/beta/rustc/platform-support.html)) for the following platforms: - Linux (PPC64) - Linux (PPC64LE) @@ -308,24 +308,24 @@ Puffin has Tier 2 support (["guaranteed to build"](https://doc.rust-lang.org/bet - Linux (i686) - Linux (s390x) -Puffin ships pre-built wheels to [PyPI](https://pypi.org/project/puffin-alpha/) for its Tier 1 and +uv ships pre-built wheels to [PyPI](https://pypi.org/project/uv/) for its Tier 1 and Tier 2 platforms. However, while Tier 2 platforms are continuously built, they are not continuously tested or developed against, and so stability may vary in practice. -Beyond the Tier 1 and Tier 2 platforms, Puffin is known to build on i686 Windows, and known _not_ +Beyond the Tier 1 and Tier 2 platforms, uv is known to build on i686 Windows, and known _not_ to build on aarch64 Windows, but does not consider either platform to be supported at this time. -Puffin supports and is tested against Python 3.8, 3.9, 3.10, 3.11, and 3.12. +uv supports and is tested against Python 3.8, 3.9, 3.10, 3.11, and 3.12. ## Acknowledgements -Puffin's dependency resolver uses [PubGrub](https://github.com/pubgrub-rs/pubgrub) under the hood. +uv's dependency resolver uses [PubGrub](https://github.com/pubgrub-rs/pubgrub) under the hood. We're grateful to the PubGrub maintainers, especially [Jacob Finkelman](https://github.com/Eh2406), for their support. -Puffin's Git implementation is based on [Cargo](https://github.com/rust-lang/cargo). +uv's Git implementation is based on [Cargo](https://github.com/rust-lang/cargo). -Some of Puffin's optimizations are inspired by the great work we've seen in +Some of uv's optimizations are inspired by the great work we've seen in [pnpm](https://pnpm.io/), [Orogene](https://github.com/orogene/orogene), and [Bun](https://github.com/oven-sh/bun). We've also learned a lot from Nathaniel J. Smith's [Posy](https://github.com/njsmith/posy) and adapted its [trampoline](https://github.com/njsmith/posy/tree/main/src/trampolines/windows-trampolines/posy-trampoline) @@ -333,7 +333,7 @@ for Windows support. ## License -Puffin is licensed under either of +uv is licensed under either of - Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) - MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) @@ -341,11 +341,11 @@ Puffin is licensed under either of at your option. Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Puffin by you, as defined in the Apache-2.0 license, shall be +for inclusion in uv by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.
- +
diff --git a/assets/badge/v0.json b/assets/badge/v0.json index 46a5e807bf5f..b7d812f3863d 100644 --- a/assets/badge/v0.json +++ b/assets/badge/v0.json @@ -1,6 +1,6 @@ { "label": "", - "message": "Puffin", + "message": "uv", "logoSvg": "", "logoWidth": 10, "labelColor": "grey", diff --git a/crates/README.md b/crates/README.md index 44738e8e4e10..462194d50b17 100644 --- a/crates/README.md +++ b/crates/README.md @@ -2,7 +2,7 @@ ## [bench](./bench) -Functionality for benchmarking Puffin. +Functionality for benchmarking uv. ## [cache-key](./cache-key) @@ -47,79 +47,79 @@ Functionality for detecting the current platform (operating system, architecture Functionality for parsing and inferring Python platform tags as per [PEP 425](https://peps.python.org/pep-0425/). -## [puffin](./puffin) +## [uv](./uv) -Command-line interface for the Puffin package manager. +Command-line interface for the uv package manager. -## [puffin-build](./puffin-build) +## [uv-build](./uv-build) -A [PEP 517](https://www.python.org/dev/peps/pep-0517/)-compatible build frontend for Puffin. +A [PEP 517](https://www.python.org/dev/peps/pep-0517/)-compatible build frontend for uv. -## [puffin-cache](./puffin-cache) +## [uv-cache](./uv-cache) Functionality for caching Python packages and associated metadata. -## [puffin-client](./puffin-client) +## [uv-client](./uv-client) Client for interacting with PyPI-compatible HTTP APIs. -## [puffin-dev](./puffin-dev) +## [uv-dev](./uv-dev) -Development utilities for Puffin. +Development utilities for uv. -## [puffin-dispatch](./puffin-dispatch) +## [uv-dispatch](./uv-dispatch) A centralized `struct` for resolving and building source distributions in isolated environments. -Implements the traits defined in `puffin-traits`. +Implements the traits defined in `uv-traits`. -## [puffin-distribution](./puffin-distribution) +## [uv-distribution](./uv-distribution) Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc. -## [puffin-extract](./puffin-extract) +## [uv-extract](./uv-extract) Utilities for extracting files from archives. -## [puffin-fs](./puffin-fs) +## [uv-fs](./uv-fs) Utilities for interacting with the filesystem. -## [puffin-git](./puffin-git) +## [uv-git](./uv-git) Functionality for interacting with Git repositories. -## [puffin-installer](./puffin-installer) +## [uv-installer](./uv-installer) Functionality for installing Python packages into a virtual environment. -## [puffin-interpreter](./puffin-interpreter) +## [uv-interpreter](./uv-interpreter) Functionality for detecting and leveraging the current Python interpreter. -## [puffin-normalize](./puffin-normalize) +## [uv-normalize](./uv-normalize) Normalize package and extra names as per Python specifications. -## [puffin-package](./puffin-package) +## [uv-package](./uv-package) Types and functionality for working with Python packages, e.g., parsing wheel files. -## [puffin-resolver](./puffin-resolver) +## [uv-resolver](./uv-resolver) Functionality for resolving Python packages and their dependencies. -## [puffin-traits](./puffin-traits) +## [uv-traits](./uv-traits) -Shared traits for Puffin, to avoid circular dependencies. +Shared traits for uv, to avoid circular dependencies. ## [pypi-types](./pypi-types) General-purpose type definitions for types used in PyPI-compatible APIs. -## [puffin-warnings](./puffin-warnings) +## [uv-warnings](./uv-warnings) -User-facing warnings for Puffin. +User-facing warnings for uv. ## [requirements-txt](./requirements-txt) diff --git a/crates/bench/Cargo.toml b/crates/bench/Cargo.toml index f0cb8364e21b..8cc144fd6b44 100644 --- a/crates/bench/Cargo.toml +++ b/crates/bench/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bench" version = "0.0.0" -description = "Puffin Micro-benchmarks" +description = "uv Micro-benchmarks" publish = false authors = { workspace = true } edition = { workspace = true } diff --git a/crates/distribution-filename/Cargo.toml b/crates/distribution-filename/Cargo.toml index 1788c4df4d3d..94e7f680bcac 100644 --- a/crates/distribution-filename/Cargo.toml +++ b/crates/distribution-filename/Cargo.toml @@ -18,7 +18,7 @@ rkyv = ["dep:rkyv", "pep440_rs/rkyv"] [dependencies] pep440_rs = { path = "../pep440-rs" } platform-tags = { path = "../platform-tags" } -puffin-normalize = { path = "../puffin-normalize" } +uv-normalize = { path = "../uv-normalize" } rkyv = { workspace = true, features = ["strict", "validation"], optional = true } serde = { workspace = true, optional = true } diff --git a/crates/distribution-filename/src/lib.rs b/crates/distribution-filename/src/lib.rs index 6a273394c817..36f7931bedec 100644 --- a/crates/distribution-filename/src/lib.rs +++ b/crates/distribution-filename/src/lib.rs @@ -1,7 +1,7 @@ use pep440_rs::Version; -use puffin_normalize::PackageName; use std::fmt::{Display, Formatter}; use std::str::FromStr; +use uv_normalize::PackageName; pub use source_dist::{SourceDistExtension, SourceDistFilename, SourceDistFilenameError}; pub use wheel::{WheelFilename, WheelFilenameError}; diff --git a/crates/distribution-filename/src/source_dist.rs b/crates/distribution-filename/src/source_dist.rs index da81941c79f6..b923cf1df716 100644 --- a/crates/distribution-filename/src/source_dist.rs +++ b/crates/distribution-filename/src/source_dist.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use pep440_rs::{Version, VersionParseError}; -use puffin_normalize::{InvalidNameError, PackageName}; +use uv_normalize::{InvalidNameError, PackageName}; #[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] @@ -196,7 +196,7 @@ enum SourceDistFilenameErrorKind { mod tests { use std::str::FromStr; - use puffin_normalize::PackageName; + use uv_normalize::PackageName; use crate::SourceDistFilename; diff --git a/crates/distribution-filename/src/wheel.rs b/crates/distribution-filename/src/wheel.rs index 403bba011cc6..97abe09457bb 100644 --- a/crates/distribution-filename/src/wheel.rs +++ b/crates/distribution-filename/src/wheel.rs @@ -8,7 +8,7 @@ use url::Url; use pep440_rs::{Version, VersionParseError}; use platform_tags::{TagCompatibility, Tags}; -use puffin_normalize::{InvalidNameError, PackageName}; +use uv_normalize::{InvalidNameError, PackageName}; #[derive(Debug, Clone, Eq, PartialEq, Hash)] #[cfg_attr( diff --git a/crates/distribution-types/Cargo.toml b/crates/distribution-types/Cargo.toml index 125d836c32ff..4f6bbf048b51 100644 --- a/crates/distribution-types/Cargo.toml +++ b/crates/distribution-types/Cargo.toml @@ -18,9 +18,9 @@ distribution-filename = { path = "../distribution-filename", features = ["serde" pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs" } platform-tags = { path = "../platform-tags" } -puffin-fs = { path = "../puffin-fs" } -puffin-git = { path = "../puffin-git", features = ["vendored-openssl"] } -puffin-normalize = { path = "../puffin-normalize" } +uv-fs = { path = "../uv-fs" } +uv-git = { path = "../uv-git", features = ["vendored-openssl"] } +uv-normalize = { path = "../uv-normalize" } pypi-types = { path = "../pypi-types" } anyhow = { workspace = true } diff --git a/crates/distribution-types/src/any.rs b/crates/distribution-types/src/any.rs index 425fc062ce54..c5657ca43742 100644 --- a/crates/distribution-types/src/any.rs +++ b/crates/distribution-types/src/any.rs @@ -1,4 +1,4 @@ -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::cached::CachedDist; use crate::installed::InstalledDist; diff --git a/crates/distribution-types/src/cached.rs b/crates/distribution-types/src/cached.rs index eddbd111472c..bf55bef95637 100644 --- a/crates/distribution-types/src/cached.rs +++ b/crates/distribution-types/src/cached.rs @@ -4,7 +4,7 @@ use anyhow::Result; use distribution_filename::WheelFilename; use pep508_rs::VerbatimUrl; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::direct_url::{DirectUrl, LocalFileUrl}; use crate::{ diff --git a/crates/distribution-types/src/direct_url.rs b/crates/distribution-types/src/direct_url.rs index c3e60c224a95..87bba177c2f3 100644 --- a/crates/distribution-types/src/direct_url.rs +++ b/crates/distribution-types/src/direct_url.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use anyhow::{Context, Error, Result}; use url::Url; -use puffin_git::{GitSha, GitUrl}; +use uv_git::{GitSha, GitUrl}; #[derive(Debug)] pub enum DirectUrl { diff --git a/crates/distribution-types/src/editable.rs b/crates/distribution-types/src/editable.rs index 951f193ffea5..6b5c397df0bb 100644 --- a/crates/distribution-types/src/editable.rs +++ b/crates/distribution-types/src/editable.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use url::Url; use pep508_rs::VerbatimUrl; -use puffin_normalize::ExtraName; +use uv_normalize::ExtraName; use crate::Verbatim; diff --git a/crates/distribution-types/src/index_url.rs b/crates/distribution-types/src/index_url.rs index a7d888b56239..f82f90f7bb29 100644 --- a/crates/distribution-types/src/index_url.rs +++ b/crates/distribution-types/src/index_url.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use url::Url; use pep508_rs::split_scheme; -use puffin_fs::normalize_url_path; +use uv_fs::normalize_url_path; static PYPI_URL: Lazy = Lazy::new(|| Url::parse("https://pypi.org/simple").unwrap()); diff --git a/crates/distribution-types/src/installed.rs b/crates/distribution-types/src/installed.rs index 02243534b186..9179fc28a886 100644 --- a/crates/distribution-types/src/installed.rs +++ b/crates/distribution-types/src/installed.rs @@ -6,8 +6,8 @@ use fs_err as fs; use url::Url; use pep440_rs::Version; -use puffin_fs::Normalized; -use puffin_normalize::PackageName; +use uv_fs::Normalized; +use uv_normalize::PackageName; use crate::{InstalledMetadata, InstalledVersion, Name}; diff --git a/crates/distribution-types/src/lib.rs b/crates/distribution-types/src/lib.rs index dce614487636..fec8ad5e8a96 100644 --- a/crates/distribution-types/src/lib.rs +++ b/crates/distribution-types/src/lib.rs @@ -42,7 +42,7 @@ use url::Url; use distribution_filename::{DistFilename, SourceDistFilename, WheelFilename}; use pep440_rs::Version; use pep508_rs::VerbatimUrl; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; pub use crate::any::*; pub use crate::cached::*; diff --git a/crates/distribution-types/src/resolution.rs b/crates/distribution-types/src/resolution.rs index 590ecd01f7f7..b9ed2baed67d 100644 --- a/crates/distribution-types/src/resolution.rs +++ b/crates/distribution-types/src/resolution.rs @@ -1,7 +1,7 @@ use rustc_hash::FxHashMap; use pep508_rs::Requirement; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::{BuiltDist, Dist, PathSourceDist, SourceDist}; diff --git a/crates/distribution-types/src/traits.rs b/crates/distribution-types/src/traits.rs index 66100b0e31d4..9f963a1dd4e1 100644 --- a/crates/distribution-types/src/traits.rs +++ b/crates/distribution-types/src/traits.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; use anyhow::Result; use pep508_rs::VerbatimUrl; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::error::Error; use crate::{ diff --git a/crates/gourgeist/Cargo.toml b/crates/gourgeist/Cargo.toml index c76ab04580af..a0d7a97eccca 100644 --- a/crates/gourgeist/Cargo.toml +++ b/crates/gourgeist/Cargo.toml @@ -22,8 +22,8 @@ workspace = true [dependencies] platform-host = { path = "../platform-host" } -puffin-cache = { path = "../puffin-cache" } -puffin-interpreter = { path = "../puffin-interpreter" } +uv-cache = { path = "../uv-cache" } +uv-interpreter = { path = "../uv-interpreter" } anstream = { workspace = true } camino = { workspace = true } diff --git a/crates/gourgeist/src/bare.rs b/crates/gourgeist/src/bare.rs index f3bcc41a7046..4c7808d3a461 100644 --- a/crates/gourgeist/src/bare.rs +++ b/crates/gourgeist/src/bare.rs @@ -9,7 +9,7 @@ use fs_err as fs; use fs_err::File; use tracing::info; -use puffin_interpreter::Interpreter; +use uv_interpreter::Interpreter; /// The bash activate scripts with the venv dependent paths patches out const ACTIVATE_TEMPLATES: &[(&str, &str)] = &[ diff --git a/crates/gourgeist/src/lib.rs b/crates/gourgeist/src/lib.rs index 91373cc54ddb..3a41c86861ee 100644 --- a/crates/gourgeist/src/lib.rs +++ b/crates/gourgeist/src/lib.rs @@ -6,7 +6,7 @@ use thiserror::Error; pub use interpreter::parse_python_cli; use platform_host::PlatformError; -use puffin_interpreter::{Interpreter, Virtualenv}; +use uv_interpreter::{Interpreter, Virtualenv}; pub use crate::bare::create_bare_venv; diff --git a/crates/gourgeist/src/main.rs b/crates/gourgeist/src/main.rs index edc93fa2f9a7..cb1e90b06824 100644 --- a/crates/gourgeist/src/main.rs +++ b/crates/gourgeist/src/main.rs @@ -13,8 +13,8 @@ use tracing_subscriber::{fmt, EnvFilter}; use gourgeist::{create_bare_venv, parse_python_cli}; use platform_host::Platform; -use puffin_cache::Cache; -use puffin_interpreter::Interpreter; +use uv_cache::Cache; +use uv_interpreter::Interpreter; #[derive(Parser, Debug)] struct Cli { diff --git a/crates/install-wheel-rs/Cargo.toml b/crates/install-wheel-rs/Cargo.toml index 8a909a763696..6aaa0d05f052 100644 --- a/crates/install-wheel-rs/Cargo.toml +++ b/crates/install-wheel-rs/Cargo.toml @@ -23,8 +23,8 @@ name = "install_wheel_rs" distribution-filename = { path = "../distribution-filename" } pep440_rs = { path = "../pep440-rs" } platform-host = { path = "../platform-host" } -puffin-normalize = { path = "../puffin-normalize" } -puffin-fs = { path = "../puffin-fs" } +uv-normalize = { path = "../uv-normalize" } +uv-fs = { path = "../uv-fs" } pypi-types = { path = "../pypi-types" } clap = { workspace = true, optional = true, features = ["derive", "env"] } diff --git a/crates/install-wheel-rs/src/install_location.rs b/crates/install-wheel-rs/src/install_location.rs index 129754604c96..4a7dd676a7b3 100644 --- a/crates/install-wheel-rs/src/install_location.rs +++ b/crates/install-wheel-rs/src/install_location.rs @@ -5,7 +5,7 @@ use fs2::FileExt; use fs_err::File; use tracing::{error, warn}; -use puffin_fs::Normalized; +use uv_fs::Normalized; const INSTALL_LOCKFILE: &str = "install-wheel-rs.lock"; diff --git a/crates/install-wheel-rs/src/lib.rs b/crates/install-wheel-rs/src/lib.rs index d46dd25aa133..95fc5ebb2039 100644 --- a/crates/install-wheel-rs/src/lib.rs +++ b/crates/install-wheel-rs/src/lib.rs @@ -14,11 +14,11 @@ use distribution_filename::WheelFilename; pub use install_location::{normalize_name, InstallLocation, LockedDir}; use pep440_rs::Version; use platform_host::{Arch, Os}; -use puffin_fs::Normalized; -use puffin_normalize::PackageName; pub use record::RecordEntry; pub use script::Script; pub use uninstall::{uninstall_wheel, Uninstall}; +use uv_fs::Normalized; +use uv_normalize::PackageName; pub use wheel::{ install_wheel, parse_key_value_file, read_record_file, relative_to, SHEBANG_PYTHON, }; @@ -86,7 +86,7 @@ pub enum Error { #[error("Invalid wheel size")] InvalidSize, #[error("Invalid package name")] - InvalidName(#[from] puffin_normalize::InvalidNameError), + InvalidName(#[from] uv_normalize::InvalidNameError), #[error("Invalid package version")] InvalidVersion(#[from] pep440_rs::VersionParseError), #[error("Wheel package name does not match filename: {0} != {1}")] diff --git a/crates/install-wheel-rs/src/linker.rs b/crates/install-wheel-rs/src/linker.rs index 52d7787aa3dd..ada887eb4884 100644 --- a/crates/install-wheel-rs/src/linker.rs +++ b/crates/install-wheel-rs/src/linker.rs @@ -12,8 +12,8 @@ use tracing::{debug, instrument}; use distribution_filename::WheelFilename; use pep440_rs::Version; -use puffin_normalize::PackageName; use pypi_types::DirectUrl; +use uv_normalize::PackageName; use crate::install_location::InstallLocation; use crate::wheel::{ diff --git a/crates/install-wheel-rs/src/wheel.rs b/crates/install-wheel-rs/src/wheel.rs index bc33d949432a..6140493bead9 100644 --- a/crates/install-wheel-rs/src/wheel.rs +++ b/crates/install-wheel-rs/src/wheel.rs @@ -21,9 +21,9 @@ use zip::{ZipArchive, ZipWriter}; use distribution_filename::WheelFilename; use pep440_rs::Version; -use puffin_fs::Normalized; -use puffin_normalize::PackageName; use pypi_types::DirectUrl; +use uv_fs::Normalized; +use uv_normalize::PackageName; use crate::install_location::{InstallLocation, LockedDir}; use crate::record::RecordEntry; @@ -35,19 +35,19 @@ pub const SHEBANG_PYTHON: &str = "#!/usr/bin/env python"; #[cfg(all(windows, target_arch = "x86_64"))] const LAUNCHER_X86_64_GUI: &[u8] = - include_bytes!("../../puffin-trampoline/trampolines/puffin-trampoline-x86_64-gui.exe"); + include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe"); #[cfg(all(windows, target_arch = "x86_64"))] const LAUNCHER_X86_64_CONSOLE: &[u8] = - include_bytes!("../../puffin-trampoline/trampolines/puffin-trampoline-x86_64-console.exe"); + include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe"); #[cfg(all(windows, target_arch = "aarch64"))] const LAUNCHER_AARCH64_GUI: &[u8] = - include_bytes!("../../puffin-trampoline/trampolines/puffin-trampoline-aarch64-gui.exe"); + include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe"); #[cfg(all(windows, target_arch = "aarch64"))] const LAUNCHER_AARCH64_CONSOLE: &[u8] = - include_bytes!("../../puffin-trampoline/trampolines/puffin-trampoline-aarch64-console.exe"); + include_bytes!("../../uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe"); /// Wrapper script template function /// diff --git a/crates/pep508-rs/Cargo.toml b/crates/pep508-rs/Cargo.toml index 080c403f4670..e0ca167715d9 100644 --- a/crates/pep508-rs/Cargo.toml +++ b/crates/pep508-rs/Cargo.toml @@ -18,8 +18,8 @@ crate-type = ["cdylib", "rlib"] [dependencies] pep440_rs = { path = "../pep440-rs" } -puffin-fs = { path = "../puffin-fs" } -puffin-normalize = { path = "../puffin-normalize" } +uv-fs = { path = "../uv-fs" } +uv-normalize = { path = "../uv-normalize" } derivative = { workspace = true } once_cell = { workspace = true } diff --git a/crates/pep508-rs/src/lib.rs b/crates/pep508-rs/src/lib.rs index 2cdb20f2af8a..98f7392bec93 100644 --- a/crates/pep508-rs/src/lib.rs +++ b/crates/pep508-rs/src/lib.rs @@ -6,7 +6,7 @@ //! ``` //! use std::str::FromStr; //! use pep508_rs::Requirement; -//! use puffin_normalize::ExtraName; +//! use uv_normalize::ExtraName; //! //! let marker = r#"requests [security,tests] >= 2.8.1, == 2.8.* ; python_version > "3.8""#; //! let dependency_specification = Requirement::from_str(marker).unwrap(); @@ -42,10 +42,10 @@ pub use marker::{ MarkerValueString, MarkerValueVersion, MarkerWarningKind, StringVersion, }; use pep440_rs::{Version, VersionSpecifier, VersionSpecifiers}; -use puffin_fs::normalize_url_path; +use uv_fs::normalize_url_path; #[cfg(feature = "pyo3")] -use puffin_normalize::InvalidNameError; -use puffin_normalize::{ExtraName, PackageName}; +use uv_normalize::InvalidNameError; +use uv_normalize::{ExtraName, PackageName}; pub use verbatim_url::{split_scheme, VerbatimUrl}; mod marker; @@ -1008,7 +1008,7 @@ mod tests { use indoc::indoc; use pep440_rs::{Operator, Version, VersionPattern, VersionSpecifier}; - use puffin_normalize::{ExtraName, PackageName}; + use uv_normalize::{ExtraName, PackageName}; use crate::marker::{ parse_markers_impl, MarkerExpression, MarkerOperator, MarkerTree, MarkerValue, diff --git a/crates/pep508-rs/src/marker.rs b/crates/pep508-rs/src/marker.rs index 214401cd0878..4445f8cbd2b5 100644 --- a/crates/pep508-rs/src/marker.rs +++ b/crates/pep508-rs/src/marker.rs @@ -11,7 +11,6 @@ use crate::{Cursor, Pep508Error, Pep508ErrorSource}; use pep440_rs::{Version, VersionPattern, VersionSpecifier}; -use puffin_normalize::ExtraName; #[cfg(feature = "pyo3")] use pyo3::{ basic::CompareOp, exceptions::PyValueError, pyclass, pymethods, PyAny, PyResult, Python, @@ -23,6 +22,7 @@ use std::fmt::{Display, Formatter}; use std::ops::Deref; use std::str::FromStr; use tracing::warn; +use uv_normalize::ExtraName; /// Ways in which marker evaluation can fail #[derive(Debug, Eq, Hash, Ord, PartialOrd, PartialEq, Clone, Copy)] @@ -731,7 +731,7 @@ impl MarkerExpression { /// # use std::str::FromStr; /// # use pep508_rs::{MarkerTree, Pep508Error}; /// # use pep440_rs::Version; - /// # use puffin_normalize::ExtraName; + /// # use uv_normalize::ExtraName; /// /// # fn main() -> Result<(), Pep508Error> { /// let marker_tree = MarkerTree::from_str(r#"("linux" in sys_platform) and extra == 'day'"#)?; diff --git a/crates/pypi-types/Cargo.toml b/crates/pypi-types/Cargo.toml index 9d9647b725a3..18f5c72ff620 100644 --- a/crates/pypi-types/Cargo.toml +++ b/crates/pypi-types/Cargo.toml @@ -15,7 +15,7 @@ workspace = true [dependencies] pep440_rs = { path = "../pep440-rs", features = ["rkyv", "serde"] } pep508_rs = { path = "../pep508-rs", features = ["rkyv", "serde"] } -puffin-normalize = { path = "../puffin-normalize" } +uv-normalize = { path = "../uv-normalize" } chrono = { workspace = true, features = ["serde"] } mailparse = { workspace = true } diff --git a/crates/pypi-types/src/metadata.rs b/crates/pypi-types/src/metadata.rs index e6285742a489..1fa04f9b90b9 100644 --- a/crates/pypi-types/src/metadata.rs +++ b/crates/pypi-types/src/metadata.rs @@ -9,7 +9,7 @@ use thiserror::Error; use pep440_rs::{Version, VersionParseError, VersionSpecifiers, VersionSpecifiersParseError}; use pep508_rs::{Pep508Error, Requirement}; -use puffin_normalize::{ExtraName, InvalidNameError, PackageName}; +use uv_normalize::{ExtraName, InvalidNameError, PackageName}; use crate::lenient_requirement::LenientRequirement; use crate::LenientVersionSpecifiers; @@ -145,7 +145,7 @@ mod tests { use std::str::FromStr; use pep440_rs::Version; - use puffin_normalize::PackageName; + use uv_normalize::PackageName; use crate::Error; diff --git a/crates/requirements-txt/Cargo.toml b/crates/requirements-txt/Cargo.toml index 53afec7d6a4a..683c80f9299c 100644 --- a/crates/requirements-txt/Cargo.toml +++ b/crates/requirements-txt/Cargo.toml @@ -15,8 +15,8 @@ workspace = true [dependencies] pep440_rs = { path = "../pep440-rs", features = ["rkyv", "serde"] } pep508_rs = { path = "../pep508-rs", features = ["rkyv", "serde"] } -puffin-fs = { path = "../puffin-fs" } -puffin-normalize = { path = "../puffin-normalize" } +uv-fs = { path = "../uv-fs" } +uv-normalize = { path = "../uv-normalize" } fs-err = { workspace = true } once_cell = { workspace = true } diff --git a/crates/requirements-txt/src/lib.rs b/crates/requirements-txt/src/lib.rs index 5bb5a34586e3..bce02134ff7a 100644 --- a/crates/requirements-txt/src/lib.rs +++ b/crates/requirements-txt/src/lib.rs @@ -45,8 +45,8 @@ use unscanny::{Pattern, Scanner}; use url::Url; use pep508_rs::{split_scheme, Extras, Pep508Error, Pep508ErrorSource, Requirement, VerbatimUrl}; -use puffin_fs::{normalize_url_path, Normalized}; -use puffin_normalize::ExtraName; +use uv_fs::{normalize_url_path, Normalized}; +use uv_normalize::ExtraName; /// We emit one of those for each requirements.txt entry enum RequirementsTxtStatement { @@ -298,12 +298,11 @@ impl RequirementsTxt { requirements_txt: impl AsRef, working_dir: impl AsRef, ) -> Result { - let content = puffin_fs::read_to_string(&requirements_txt).map_err(|err| { - RequirementsTxtFileError { + let content = + uv_fs::read_to_string(&requirements_txt).map_err(|err| RequirementsTxtFileError { file: requirements_txt.as_ref().to_path_buf(), error: RequirementsTxtParserError::IO(err), - } - })?; + })?; let data = Self::parse_inner(&content, working_dir.as_ref()).map_err(|err| { RequirementsTxtFileError { file: requirements_txt.as_ref().to_path_buf(), @@ -936,9 +935,9 @@ mod test { use fs_err as fs; use indoc::indoc; use itertools::Itertools; - use puffin_fs::Normalized; use tempfile::tempdir; use test_case::test_case; + use uv_fs::Normalized; use crate::{EditableRequirement, RequirementsTxt}; diff --git a/crates/puffin-build/.gitignore b/crates/uv-build/.gitignore similarity index 100% rename from crates/puffin-build/.gitignore rename to crates/uv-build/.gitignore diff --git a/crates/puffin-build/Cargo.toml b/crates/uv-build/Cargo.toml similarity index 83% rename from crates/puffin-build/Cargo.toml rename to crates/uv-build/Cargo.toml index d363e393b668..8dabecfa82bc 100644 --- a/crates/puffin-build/Cargo.toml +++ b/crates/uv-build/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-build" +name = "uv-build" version = "0.0.1" description = "Build wheels from source distributions" edition = { workspace = true } @@ -18,10 +18,10 @@ distribution-types = { path = "../distribution-types" } gourgeist = { path = "../gourgeist" } pep508_rs = { path = "../pep508-rs" } platform-host = { path = "../platform-host" } -puffin-extract = { path = "../puffin-extract" } -puffin-fs = { path = "../puffin-fs" } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-traits = { path = "../puffin-traits" } +uv-extract = { path = "../uv-extract" } +uv-fs = { path = "../uv-fs" } +uv-interpreter = { path = "../uv-interpreter" } +uv-traits = { path = "../uv-traits" } pypi-types = { path = "../pypi-types" } anyhow = { workspace = true } diff --git a/crates/puffin-build/src/lib.rs b/crates/uv-build/src/lib.rs similarity index 98% rename from crates/puffin-build/src/lib.rs rename to crates/uv-build/src/lib.rs index 4b9d3f1aa94b..b7efc1ab9248 100644 --- a/crates/puffin-build/src/lib.rs +++ b/crates/uv-build/src/lib.rs @@ -27,9 +27,9 @@ use tracing::{debug, info_span, instrument, Instrument}; use distribution_types::Resolution; use pep508_rs::Requirement; -use puffin_fs::Normalized; -use puffin_interpreter::{Interpreter, Virtualenv}; -use puffin_traits::{BuildContext, BuildKind, SetupPyStrategy, SourceBuildTrait}; +use uv_fs::Normalized; +use uv_interpreter::{Interpreter, Virtualenv}; +use uv_traits::{BuildContext, BuildKind, SetupPyStrategy, SourceBuildTrait}; /// e.g. `pygraphviz/graphviz_wrap.c:3020:10: fatal error: graphviz/cgraph.h: No such file or directory` static MISSING_HEADER_RE: Lazy = Lazy::new(|| { @@ -59,7 +59,7 @@ pub enum Error { #[error(transparent)] IO(#[from] io::Error), #[error("Failed to extract archive: {0}")] - Extraction(PathBuf, #[source] puffin_extract::Error), + Extraction(PathBuf, #[source] uv_extract::Error), #[error("Unsupported archive format (extension not recognized): {0}")] UnsupportedArchiveType(String), #[error("Invalid source distribution: {0}")] @@ -301,11 +301,11 @@ impl SourceBuild { let extracted = temp_dir.path().join("extracted"); // Unzip the archive into the temporary directory. - puffin_extract::archive(source, &extracted) + uv_extract::archive(source, &extracted) .map_err(|err| Error::Extraction(extracted.clone(), err))?; // Extract the top-level directory from the archive. - puffin_extract::strip_component(&extracted) + uv_extract::strip_component(&extracted) .map_err(|err| Error::Extraction(extracted.clone(), err))? }; let source_tree = if let Some(subdir) = subdirectory { @@ -542,7 +542,7 @@ impl SourceBuild { let wheel_dir = fs::canonicalize(wheel_dir)?; if let Some(pep517_backend) = &self.pep517_backend { - // Prevent clashes from two puffin processes building wheels in parallel. + // Prevent clashes from two uv processes building wheels in parallel. let tmp_dir = tempdir_in(&wheel_dir)?; let filename = self.pep517_build(tmp_dir.path(), pep517_backend).await?; diff --git a/crates/puffin-cache/Cargo.toml b/crates/uv-cache/Cargo.toml similarity index 88% rename from crates/puffin-cache/Cargo.toml rename to crates/uv-cache/Cargo.toml index 4c1e0aa155db..6a7208689cb5 100644 --- a/crates/puffin-cache/Cargo.toml +++ b/crates/uv-cache/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-cache" +name = "uv-cache" version = "0.0.1" description = "Generate stable hash digests across versions and platforms." edition = { workspace = true } @@ -16,8 +16,8 @@ workspace = true [dependencies] cache-key = { path = "../cache-key" } distribution-types = { path = "../distribution-types" } -puffin-fs = { path = "../puffin-fs" } -puffin-normalize = { path = "../puffin-normalize" } +uv-fs = { path = "../uv-fs" } +uv-normalize = { path = "../uv-normalize" } pypi-types = { path = "../pypi-types" } cachedir = { workspace = true } diff --git a/crates/puffin-cache/src/by_timestamp.rs b/crates/uv-cache/src/by_timestamp.rs similarity index 100% rename from crates/puffin-cache/src/by_timestamp.rs rename to crates/uv-cache/src/by_timestamp.rs diff --git a/crates/puffin-cache/src/cli.rs b/crates/uv-cache/src/cli.rs similarity index 89% rename from crates/puffin-cache/src/cli.rs rename to crates/uv-cache/src/cli.rs index 0ffcea38c9e2..fb7df391c499 100644 --- a/crates/puffin-cache/src/cli.rs +++ b/crates/uv-cache/src/cli.rs @@ -26,7 +26,7 @@ impl TryFrom for Cache { /// 1. A temporary cache directory, if the user requested `--no-cache`. /// 2. The specific cache directory specified by the user via `--cache-dir` or `PUFFIN_CACHE_DIR`. /// 3. The system-appropriate cache directory. - /// 4. A `.puffin_cache` directory in the current working directory. + /// 4. A `.uv_cache` directory in the current working directory. /// /// Returns an absolute cache dir. fn try_from(value: CacheArgs) -> Result { @@ -34,10 +34,10 @@ impl TryFrom for Cache { Cache::temp() } else if let Some(cache_dir) = value.cache_dir { Cache::from_path(cache_dir) - } else if let Some(project_dirs) = ProjectDirs::from("", "", "puffin") { + } else if let Some(project_dirs) = ProjectDirs::from("", "", "uv") { Cache::from_path(project_dirs.cache_dir()) } else { - Cache::from_path(".puffin_cache") + Cache::from_path(".uv_cache") } } } diff --git a/crates/puffin-cache/src/lib.rs b/crates/uv-cache/src/lib.rs similarity index 98% rename from crates/puffin-cache/src/lib.rs rename to crates/uv-cache/src/lib.rs index 65f9837a326e..943631c41654 100644 --- a/crates/puffin-cache/src/lib.rs +++ b/crates/uv-cache/src/lib.rs @@ -8,8 +8,8 @@ use std::sync::Arc; use fs_err as fs; use tempfile::{tempdir, TempDir}; -use puffin_fs::directories; -use puffin_normalize::PackageName; +use uv_fs::directories; +use uv_normalize::PackageName; pub use crate::by_timestamp::CachedByTimestamp; #[cfg(feature = "clap")] @@ -219,7 +219,7 @@ impl Cache { // Create a symlink to the directory store. fs_err::create_dir_all(path.as_ref().parent().expect("Cache entry to have parent"))?; - puffin_fs::replace_symlink(archive_entry.path(), path.as_ref())?; + uv_fs::replace_symlink(archive_entry.path(), path.as_ref())?; Ok(archive_entry.into_path_buf()) } @@ -283,7 +283,7 @@ pub enum CacheBucket { /// * `wheel-metadata-v0//foo/{foo-1.0.0-py3-none-any.msgpack, foo-1.0.0-py3-none-any.whl}` /// * `wheel-metadata-v0/url//foo/{foo-1.0.0-py3-none-any.msgpack, foo-1.0.0-py3-none-any.whl}` /// - /// See `puffin_client::RegistryClient::wheel_metadata` for information on how wheel metadata + /// See `uv_client::RegistryClient::wheel_metadata` for information on how wheel metadata /// is fetched. /// /// # Example @@ -478,7 +478,7 @@ pub enum CacheBucket { /// }, /// "base_exec_prefix": "/home/ferris/.pyenv/versions/3.12.0", /// "base_prefix": "/home/ferris/.pyenv/versions/3.12.0", - /// "sys_executable": "/home/ferris/projects/puffin/.venv/bin/python" + /// "sys_executable": "/home/ferris/projects/uv/.venv/bin/python" /// } /// } /// ``` @@ -491,7 +491,7 @@ pub enum CacheBucket { /// * `simple-v0/pypi/.rkyv` /// * `simple-v0//.rkyv` /// - /// The response is parsed into `puffin_client::SimpleMetadata` before storage. + /// The response is parsed into `uv_client::SimpleMetadata` before storage. Simple, /// A cache of unzipped wheels, stored as directories. This is used internally within the cache. /// When other buckets need to store directories, they should persist them to diff --git a/crates/puffin-cache/src/removal.rs b/crates/uv-cache/src/removal.rs similarity index 100% rename from crates/puffin-cache/src/removal.rs rename to crates/uv-cache/src/removal.rs diff --git a/crates/puffin-cache/src/timestamp.rs b/crates/uv-cache/src/timestamp.rs similarity index 100% rename from crates/puffin-cache/src/timestamp.rs rename to crates/uv-cache/src/timestamp.rs diff --git a/crates/puffin-cache/src/wheel.rs b/crates/uv-cache/src/wheel.rs similarity index 100% rename from crates/puffin-cache/src/wheel.rs rename to crates/uv-cache/src/wheel.rs diff --git a/crates/puffin-client/Cargo.toml b/crates/uv-client/Cargo.toml similarity index 89% rename from crates/puffin-client/Cargo.toml rename to crates/uv-client/Cargo.toml index 90d8457dc15d..f1df77716a22 100644 --- a/crates/puffin-client/Cargo.toml +++ b/crates/uv-client/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-client" +name = "uv-client" version = "0.0.1" edition = "2021" @@ -11,9 +11,9 @@ install-wheel-rs = { path = "../install-wheel-rs" } pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs" } platform-tags = { path = "../platform-tags" } -puffin-cache = { path = "../puffin-cache" } -puffin-fs = { path = "../puffin-fs", features = ["tokio"] } -puffin-normalize = { path = "../puffin-normalize" } +uv-cache = { path = "../uv-cache" } +uv-fs = { path = "../uv-fs", features = ["tokio"] } +uv-normalize = { path = "../uv-normalize" } pypi-types = { path = "../pypi-types" } async-trait = { workspace = true } diff --git a/crates/puffin-client/README.md b/crates/uv-client/README.md similarity index 100% rename from crates/puffin-client/README.md rename to crates/uv-client/README.md diff --git a/crates/puffin-client/src/cached_client.rs b/crates/uv-client/src/cached_client.rs similarity index 99% rename from crates/puffin-client/src/cached_client.rs rename to crates/uv-client/src/cached_client.rs index 880b370a1846..fd811426e01a 100644 --- a/crates/puffin-client/src/cached_client.rs +++ b/crates/uv-client/src/cached_client.rs @@ -8,8 +8,8 @@ use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use tracing::{debug, info_span, instrument, trace, warn, Instrument}; -use puffin_cache::{CacheEntry, Freshness}; -use puffin_fs::write_atomic; +use uv_cache::{CacheEntry, Freshness}; +use uv_fs::write_atomic; use crate::{ httpcache::{AfterResponse, BeforeRequest, CachePolicy, CachePolicyBuilder}, diff --git a/crates/puffin-client/src/error.rs b/crates/uv-client/src/error.rs similarity index 99% rename from crates/puffin-client/src/error.rs rename to crates/uv-client/src/error.rs index eeac22113943..92a61a21b2b4 100644 --- a/crates/puffin-client/src/error.rs +++ b/crates/uv-client/src/error.rs @@ -3,7 +3,7 @@ use async_zip::error::ZipError; use url::Url; use distribution_filename::{WheelFilename, WheelFilenameError}; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::html; use crate::middleware::OfflineError; diff --git a/crates/puffin-client/src/flat_index.rs b/crates/uv-client/src/flat_index.rs similarity index 99% rename from crates/puffin-client/src/flat_index.rs rename to crates/uv-client/src/flat_index.rs index bb36a55dfa25..4797b0027f7b 100644 --- a/crates/puffin-client/src/flat_index.rs +++ b/crates/uv-client/src/flat_index.rs @@ -15,9 +15,9 @@ use distribution_types::{ }; use pep440_rs::Version; use platform_tags::Tags; -use puffin_cache::{Cache, CacheBucket}; -use puffin_normalize::PackageName; use pypi_types::{Hashes, Yanked}; +use uv_cache::{Cache, CacheBucket}; +use uv_normalize::PackageName; use crate::cached_client::{CacheControl, CachedClientError}; use crate::html::SimpleHtml; diff --git a/crates/puffin-client/src/html.rs b/crates/uv-client/src/html.rs similarity index 100% rename from crates/puffin-client/src/html.rs rename to crates/uv-client/src/html.rs diff --git a/crates/puffin-client/src/httpcache/control.rs b/crates/uv-client/src/httpcache/control.rs similarity index 99% rename from crates/puffin-client/src/httpcache/control.rs rename to crates/uv-client/src/httpcache/control.rs index 343494540895..43b032dde354 100644 --- a/crates/puffin-client/src/httpcache/control.rs +++ b/crates/uv-client/src/httpcache/control.rs @@ -160,7 +160,7 @@ impl FromIterator for CacheControl { /// server before using anything in case. /// /// This parser handles a bit more than what we actually need in -/// `puffin-client`. For example, we don't need to handle quoted values at all +/// `uv-client`. For example, we don't need to handle quoted values at all /// since either don't use or care about values that require quoted. With that /// said, the parser handles these because it wasn't that much extra work to do /// so and just generally seemed like good sense. (If we didn't handle them and diff --git a/crates/puffin-client/src/httpcache/mod.rs b/crates/uv-client/src/httpcache/mod.rs similarity index 99% rename from crates/puffin-client/src/httpcache/mod.rs rename to crates/uv-client/src/httpcache/mod.rs index 8e1344865f23..65dcc02cefce 100644 --- a/crates/puffin-client/src/httpcache/mod.rs +++ b/crates/uv-client/src/httpcache/mod.rs @@ -44,7 +44,7 @@ wheel. When a cached response exceeds the `max-age` configured on a response, then we call that response stale. Generally speaking, we won't return responses from the cache that are known to be stale. (This can be overridden in the -request by adding a `max-stale` cache-control directive, but nothing in Puffin +request by adding a `max-stale` cache-control directive, but nothing in uv does this at time of writing.) When a response is stale, we don't necessarily need to give up completely. It is at this point that we can send something called a re-validation request. @@ -63,7 +63,7 @@ to the behavior of caching (like a new `Age` header). # Scope -In general, the cache semantics implemented below are targeted toward Puffin's +In general, the cache semantics implemented below are targeted toward uv's use case: a private client cache for custom data objects. This constraint results in a modest simplification in what we need to support. That is, we don't need to cache the entirety of the request's or response's headers (like @@ -145,7 +145,7 @@ use self::control::CacheControl; mod control; -/// Knobs to configure Puffin's cache behavior. +/// Knobs to configure uv's cache behavior. /// /// At time of writing, we don't expose any way of modifying these since I /// suspect we won't ever need to. We split them out into their own type so @@ -164,7 +164,7 @@ struct CacheConfig { impl Default for CacheConfig { fn default() -> CacheConfig { CacheConfig { - // The caching puffin does ought to be considered + // The caching uv does ought to be considered // private. shared: false, // This is only used to heuristically guess at a freshness lifetime @@ -234,7 +234,7 @@ impl CachePolicyBuilder { } /// A value encapsulating the data needed to implement HTTP caching behavior -/// for Puffin. +/// for uv. /// /// A cache policy is meant to be stored and persisted with the data being /// cached. It is specifically meant to capture the smallest amount of @@ -242,7 +242,7 @@ impl CachePolicyBuilder { /// and the information required to issue a re-validation request. /// /// This does not provide a complete set of HTTP cache semantics. Notably -/// absent from this (among other things that Puffin probably doesn't care +/// absent from this (among other things that uv probably doesn't care /// about it) are proxy cache semantics. #[derive(Debug, rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)] #[archive(check_bytes)] diff --git a/crates/puffin-client/src/lib.rs b/crates/uv-client/src/lib.rs similarity index 100% rename from crates/puffin-client/src/lib.rs rename to crates/uv-client/src/lib.rs diff --git a/crates/puffin-client/src/middleware.rs b/crates/uv-client/src/middleware.rs similarity index 100% rename from crates/puffin-client/src/middleware.rs rename to crates/uv-client/src/middleware.rs diff --git a/crates/puffin-client/src/registry_client.rs b/crates/uv-client/src/registry_client.rs similarity index 99% rename from crates/puffin-client/src/registry_client.rs rename to crates/uv-client/src/registry_client.rs index 3d71a25be13e..3bb195c5bd88 100644 --- a/crates/puffin-client/src/registry_client.rs +++ b/crates/uv-client/src/registry_client.rs @@ -20,9 +20,9 @@ use distribution_filename::{DistFilename, SourceDistFilename, WheelFilename}; use distribution_types::{BuiltDist, File, FileLocation, IndexUrl, IndexUrls, Name}; use install_wheel_rs::find_dist_info; use pep440_rs::Version; -use puffin_cache::{Cache, CacheBucket, WheelCache}; -use puffin_normalize::PackageName; use pypi_types::{Metadata21, SimpleJson}; +use uv_cache::{Cache, CacheBucket, WheelCache}; +use uv_normalize::PackageName; use crate::cached_client::CacheControl; use crate::html::SimpleHtml; @@ -80,7 +80,7 @@ impl RegistryClientBuilder { let client_raw = { // Disallow any connections. let client_core = ClientBuilder::new() - .user_agent("puffin") + .user_agent("uv") .pool_max_idle_per_host(20) .timeout(std::time::Duration::from_secs(60 * 5)); @@ -501,7 +501,7 @@ impl RegistryClient { } } -/// It doesn't really fit into `puffin_client`, but it avoids cyclical crate dependencies. +/// It doesn't really fit into `uv_client`, but it avoids cyclical crate dependencies. async fn read_metadata_async( filename: &WheelFilename, debug_source: String, @@ -705,8 +705,8 @@ pub enum Connectivity { mod tests { use std::str::FromStr; - use puffin_normalize::PackageName; use pypi_types::SimpleJson; + use uv_normalize::PackageName; use crate::{SimpleMetadata, SimpleMetadatum}; diff --git a/crates/puffin-client/src/remote_metadata.rs b/crates/uv-client/src/remote_metadata.rs similarity index 100% rename from crates/puffin-client/src/remote_metadata.rs rename to crates/uv-client/src/remote_metadata.rs diff --git a/crates/puffin-client/src/rkyvutil.rs b/crates/uv-client/src/rkyvutil.rs similarity index 99% rename from crates/puffin-client/src/rkyvutil.rs rename to crates/uv-client/src/rkyvutil.rs index 369f5a7670e8..c60d4c1f11f4 100644 --- a/crates/puffin-client/src/rkyvutil.rs +++ b/crates/uv-client/src/rkyvutil.rs @@ -53,7 +53,7 @@ use crate::{Error, ErrorKind}; /// /// Note that this type makes a number of assumptions about the specific /// serializer, deserializer and validator used. This type could be made -/// more generic, but it's not clear we need that in puffin. By making our +/// more generic, but it's not clear we need that in uv. By making our /// choices concrete here, we make use of this type much simpler to understand. /// Unfortunately, AG couldn't find a way of making the trait bounds simpler, /// so if `OwnedVec` is being used in trait implementations, the traits bounds diff --git a/crates/puffin-client/tests/remote_metadata.rs b/crates/uv-client/tests/remote_metadata.rs similarity index 93% rename from crates/puffin-client/tests/remote_metadata.rs rename to crates/uv-client/tests/remote_metadata.rs index 874c218574ba..12763333422d 100644 --- a/crates/puffin-client/tests/remote_metadata.rs +++ b/crates/uv-client/tests/remote_metadata.rs @@ -5,8 +5,8 @@ use anyhow::Result; use distribution_filename::WheelFilename; use distribution_types::{BuiltDist, DirectUrlBuiltDist}; use pep508_rs::VerbatimUrl; -use puffin_cache::Cache; -use puffin_client::RegistryClientBuilder; +use uv_cache::Cache; +use uv_client::RegistryClientBuilder; #[tokio::test] async fn remote_metadata_with_and_without_cache() -> Result<()> { diff --git a/crates/puffin-dev/.gitignore b/crates/uv-dev/.gitignore similarity index 100% rename from crates/puffin-dev/.gitignore rename to crates/uv-dev/.gitignore diff --git a/crates/puffin-dev/Cargo.toml b/crates/uv-dev/Cargo.toml similarity index 76% rename from crates/puffin-dev/Cargo.toml rename to crates/uv-dev/Cargo.toml index b351321a7f55..ebfc673dfd3f 100644 --- a/crates/puffin-dev/Cargo.toml +++ b/crates/uv-dev/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-dev" +name = "uv-dev" version = "0.0.1" description = "Build wheels from source distributions" publish = false @@ -24,19 +24,19 @@ pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs" } platform-host = { path = "../platform-host" } platform-tags = { path = "../platform-tags" } -puffin-build = { path = "../puffin-build" } -puffin-cache = { path = "../puffin-cache", features = ["clap"] } -puffin-client = { path = "../puffin-client" } -puffin-dispatch = { path = "../puffin-dispatch" } -puffin-distribution = { path = "../puffin-distribution" } -puffin-installer = { path = "../puffin-installer" } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-normalize = { path = "../puffin-normalize" } -puffin-resolver = { path = "../puffin-resolver" } +uv-build = { path = "../uv-build" } +uv-cache = { path = "../uv-cache", features = ["clap"] } +uv-client = { path = "../uv-client" } +uv-dispatch = { path = "../uv-dispatch" } +uv-distribution = { path = "../uv-distribution" } +uv-installer = { path = "../uv-installer" } +uv-interpreter = { path = "../uv-interpreter" } +uv-normalize = { path = "../uv-normalize" } +uv-resolver = { path = "../uv-resolver" } pypi-types = { path = "../pypi-types" } -puffin-traits = { path = "../puffin-traits" } +uv-traits = { path = "../uv-traits" } -# Any dependencies that are exclusively used in `puffin-dev` should be listed as non-workspace +# Any dependencies that are exclusively used in `uv-dev` should be listed as non-workspace # dependencies, to ensure that we're forced to think twice before including them in other crates. anstream = { workspace = true } anyhow = { workspace = true } diff --git a/crates/puffin-dev/builder.dockerfile b/crates/uv-dev/builder.dockerfile similarity index 100% rename from crates/puffin-dev/builder.dockerfile rename to crates/uv-dev/builder.dockerfile diff --git a/crates/puffin-dev/src/build.rs b/crates/uv-dev/src/build.rs similarity index 86% rename from crates/puffin-dev/src/build.rs rename to crates/uv-dev/src/build.rs index 44fb068597cf..b8ad64f389b7 100644 --- a/crates/puffin-dev/src/build.rs +++ b/crates/uv-dev/src/build.rs @@ -7,14 +7,14 @@ use fs_err as fs; use distribution_types::IndexLocations; use platform_host::Platform; -use puffin_build::{SourceBuild, SourceBuildContext}; -use puffin_cache::{Cache, CacheArgs}; -use puffin_client::{FlatIndex, RegistryClientBuilder}; -use puffin_dispatch::BuildDispatch; -use puffin_installer::NoBinary; -use puffin_interpreter::Virtualenv; -use puffin_resolver::InMemoryIndex; -use puffin_traits::{BuildContext, BuildKind, InFlight, NoBuild, SetupPyStrategy}; +use uv_build::{SourceBuild, SourceBuildContext}; +use uv_cache::{Cache, CacheArgs}; +use uv_client::{FlatIndex, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_installer::NoBinary; +use uv_interpreter::Virtualenv; +use uv_resolver::InMemoryIndex; +use uv_traits::{BuildContext, BuildKind, InFlight, NoBuild, SetupPyStrategy}; #[derive(Parser)] pub(crate) struct BuildArgs { diff --git a/crates/puffin-dev/src/install_many.rs b/crates/uv-dev/src/install_many.rs similarity index 92% rename from crates/puffin-dev/src/install_many.rs rename to crates/uv-dev/src/install_many.rs index 092e243110b8..0c8f0e5ffad2 100644 --- a/crates/puffin-dev/src/install_many.rs +++ b/crates/uv-dev/src/install_many.rs @@ -17,15 +17,15 @@ use install_wheel_rs::linker::LinkMode; use pep508_rs::Requirement; use platform_host::Platform; use platform_tags::Tags; -use puffin_cache::{Cache, CacheArgs}; -use puffin_client::{FlatIndex, RegistryClient, RegistryClientBuilder}; -use puffin_dispatch::BuildDispatch; -use puffin_distribution::RegistryWheelIndex; -use puffin_installer::{Downloader, NoBinary}; -use puffin_interpreter::Virtualenv; -use puffin_normalize::PackageName; -use puffin_resolver::{DistFinder, InMemoryIndex}; -use puffin_traits::{BuildContext, InFlight, NoBuild, SetupPyStrategy}; +use uv_cache::{Cache, CacheArgs}; +use uv_client::{FlatIndex, RegistryClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_distribution::RegistryWheelIndex; +use uv_installer::{Downloader, NoBinary}; +use uv_interpreter::Virtualenv; +use uv_normalize::PackageName; +use uv_resolver::{DistFinder, InMemoryIndex}; +use uv_traits::{BuildContext, InFlight, NoBuild, SetupPyStrategy}; #[derive(Parser)] pub(crate) struct InstallManyArgs { @@ -187,7 +187,7 @@ async fn install_chunk( } let wheels: Vec<_> = wheels.into_iter().chain(cached).collect(); - puffin_installer::Installer::new(venv) + uv_installer::Installer::new(venv) .with_link_mode(LinkMode::default()) .install(&wheels) .context("Failed to install")?; diff --git a/crates/puffin-dev/src/main.rs b/crates/uv-dev/src/main.rs similarity index 93% rename from crates/puffin-dev/src/main.rs rename to crates/uv-dev/src/main.rs index 894e8d68273d..76145ee5f7c8 100644 --- a/crates/puffin-dev/src/main.rs +++ b/crates/uv-dev/src/main.rs @@ -55,11 +55,11 @@ enum Cli { /// /// Run `scripts/popular_packages/pypi_8k_downloads.sh` once, then /// ```bash - /// cargo run --bin puffin-dev -- resolve-many scripts/popular_packages/pypi_8k_downloads.txt + /// cargo run --bin uv-dev -- resolve-many scripts/popular_packages/pypi_8k_downloads.txt /// ``` /// or /// ```bash - /// cargo run --bin puffin-dev -- resolve-many scripts/popular_packages/pypi_10k_most_dependents.txt + /// cargo run --bin uv-dev -- resolve-many scripts/popular_packages/pypi_10k_most_dependents.txt /// ``` ResolveMany(ResolveManyArgs), InstallMany(InstallManyArgs), @@ -130,7 +130,7 @@ async fn main() -> ExitCode { let filter_layer = EnvFilter::try_from_default_env().unwrap_or_else(|_| { EnvFilter::builder() // Show only the important spans - .parse("puffin_dev=info,puffin_dispatch=info") + .parse("uv_dev=info,uv_dispatch=info") .unwrap() }); tracing_subscriber::registry() @@ -144,7 +144,7 @@ async fn main() -> ExitCode { let result = run().await; debug!("Took {}ms", start.elapsed().as_millis()); if let Err(err) = result { - eprintln!("{}", "puffin-dev failed".red().bold()); + eprintln!("{}", "uv-dev failed".red().bold()); for err in err.chain() { eprintln!(" {}: {}", "Caused by".red().bold(), err); } diff --git a/crates/puffin-dev/src/render_benchmarks.rs b/crates/uv-dev/src/render_benchmarks.rs similarity index 97% rename from crates/puffin-dev/src/render_benchmarks.rs rename to crates/uv-dev/src/render_benchmarks.rs index 3c3982a0ae20..a6bceb1fb426 100644 --- a/crates/puffin-dev/src/render_benchmarks.rs +++ b/crates/uv-dev/src/render_benchmarks.rs @@ -22,8 +22,8 @@ pub(crate) fn render_benchmarks(args: &RenderBenchmarksArgs) -> Result<()> { // Replace the command with a shorter name. (The command typically includes the benchmark name, // but we assume we're running over a single benchmark here.) for result in &mut results.results { - if result.command.starts_with("puffin") { - result.command = "Puffin".into(); + if result.command.starts_with("uv") { + result.command = "uv".into(); } else if result.command.starts_with("pip-compile") { result.command = "pip-compile".into(); } else if result.command.starts_with("pip-sync") { diff --git a/crates/puffin-dev/src/resolve_cli.rs b/crates/uv-dev/src/resolve_cli.rs similarity index 92% rename from crates/puffin-dev/src/resolve_cli.rs rename to crates/uv-dev/src/resolve_cli.rs index a515ad62a78e..5c74c674a49f 100644 --- a/crates/puffin-dev/src/resolve_cli.rs +++ b/crates/uv-dev/src/resolve_cli.rs @@ -12,13 +12,13 @@ use petgraph::dot::{Config as DotConfig, Dot}; use distribution_types::{FlatIndexLocation, IndexLocations, IndexUrl, Resolution}; use pep508_rs::Requirement; use platform_host::Platform; -use puffin_cache::{Cache, CacheArgs}; -use puffin_client::{FlatIndex, FlatIndexClient, RegistryClientBuilder}; -use puffin_dispatch::BuildDispatch; -use puffin_installer::NoBinary; -use puffin_interpreter::Virtualenv; -use puffin_resolver::{InMemoryIndex, Manifest, Options, Resolver}; -use puffin_traits::{InFlight, NoBuild, SetupPyStrategy}; +use uv_cache::{Cache, CacheArgs}; +use uv_client::{FlatIndex, FlatIndexClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_installer::NoBinary; +use uv_interpreter::Virtualenv; +use uv_resolver::{InMemoryIndex, Manifest, Options, Resolver}; +use uv_traits::{InFlight, NoBuild, SetupPyStrategy}; #[derive(ValueEnum, Default, Clone)] pub(crate) enum ResolveCliFormat { diff --git a/crates/puffin-dev/src/resolve_many.rs b/crates/uv-dev/src/resolve_many.rs similarity index 95% rename from crates/puffin-dev/src/resolve_many.rs rename to crates/uv-dev/src/resolve_many.rs index 40a14050d56e..e5c3b3802159 100644 --- a/crates/puffin-dev/src/resolve_many.rs +++ b/crates/uv-dev/src/resolve_many.rs @@ -14,14 +14,14 @@ use distribution_types::IndexLocations; use pep440_rs::{Version, VersionSpecifier, VersionSpecifiers}; use pep508_rs::{Requirement, VersionOrUrl}; use platform_host::Platform; -use puffin_cache::{Cache, CacheArgs}; -use puffin_client::{FlatIndex, OwnedArchive, RegistryClient, RegistryClientBuilder}; -use puffin_dispatch::BuildDispatch; -use puffin_installer::NoBinary; -use puffin_interpreter::Virtualenv; -use puffin_normalize::PackageName; -use puffin_resolver::InMemoryIndex; -use puffin_traits::{BuildContext, InFlight, NoBuild, SetupPyStrategy}; +use uv_cache::{Cache, CacheArgs}; +use uv_client::{FlatIndex, OwnedArchive, RegistryClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_installer::NoBinary; +use uv_interpreter::Virtualenv; +use uv_normalize::PackageName; +use uv_resolver::InMemoryIndex; +use uv_traits::{BuildContext, InFlight, NoBuild, SetupPyStrategy}; #[derive(Parser)] pub(crate) struct ResolveManyArgs { diff --git a/crates/puffin-dev/src/wheel_metadata.rs b/crates/uv-dev/src/wheel_metadata.rs similarity index 92% rename from crates/puffin-dev/src/wheel_metadata.rs rename to crates/uv-dev/src/wheel_metadata.rs index 1b7c6a3f2d81..64305cf1afe9 100644 --- a/crates/puffin-dev/src/wheel_metadata.rs +++ b/crates/uv-dev/src/wheel_metadata.rs @@ -7,8 +7,8 @@ use clap::Parser; use distribution_filename::WheelFilename; use distribution_types::{BuiltDist, DirectUrlBuiltDist}; use pep508_rs::VerbatimUrl; -use puffin_cache::{Cache, CacheArgs}; -use puffin_client::RegistryClientBuilder; +use uv_cache::{Cache, CacheArgs}; +use uv_client::RegistryClientBuilder; #[derive(Parser)] pub(crate) struct WheelMetadataArgs { diff --git a/crates/puffin-dev/test_sdist_building.sh b/crates/uv-dev/test_sdist_building.sh similarity index 78% rename from crates/puffin-dev/test_sdist_building.sh rename to crates/uv-dev/test_sdist_building.sh index 897c3aaa80fa..aa01fa745f39 100644 --- a/crates/puffin-dev/test_sdist_building.sh +++ b/crates/uv-dev/test_sdist_building.sh @@ -12,8 +12,8 @@ if [ ! -f sdist_building_test_data/sdist/geoextract-0.3.1.tar.gz ]; then wget https://files.pythonhosted.org/packages/c4/00/9d9826a6e1c9139cc7183647f47f6b7acb290fa4c572140aa84a12728e60/geoextract-0.3.1.tar.gz -O sdist_building_test_data/sdist/geoextract-0.3.1.tar.gz fi rm -rf sdist_building_test_data/wheels -RUST_LOG=puffin_build=debug cargo run --bin puffin-dev -- build --wheels sdist_building_test_data/wheels sdist_building_test_data/sdist/tqdm-4.66.1.tar.gz -RUST_LOG=puffin_build=debug cargo run --bin puffin-dev -- build --wheels sdist_building_test_data/wheels sdist_building_test_data/sdist/geoextract-0.3.1.tar.gz +RUST_LOG=uv_build=debug cargo run --bin uv-dev -- build --wheels sdist_building_test_data/wheels sdist_building_test_data/sdist/tqdm-4.66.1.tar.gz +RUST_LOG=uv_build=debug cargo run --bin uv-dev -- build --wheels sdist_building_test_data/wheels sdist_building_test_data/sdist/geoextract-0.3.1.tar.gz # Check that pip accepts the wheels. It would be better to do functional checks virtualenv -p 3.8 -q --clear sdist_building_test_data/.venv diff --git a/crates/puffin-dispatch/Cargo.toml b/crates/uv-dispatch/Cargo.toml similarity index 67% rename from crates/puffin-dispatch/Cargo.toml rename to crates/uv-dispatch/Cargo.toml index bb94597dedb6..52b0b7d7fd2e 100644 --- a/crates/puffin-dispatch/Cargo.toml +++ b/crates/uv-dispatch/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-dispatch" +name = "uv-dispatch" version = "0.0.1" description = "Avoid cyclic crate dependencies between resolver, installer and builder" edition = { workspace = true } @@ -19,14 +19,14 @@ gourgeist = { path = "../gourgeist" } pep508_rs = { path = "../pep508-rs" } platform-host = { path = "../platform-host" } platform-tags = { path = "../platform-tags" } -puffin-build = { path = "../puffin-build" } -puffin-cache = { path = "../puffin-cache" } -puffin-client = { path = "../puffin-client" } -puffin-distribution = { path = "../puffin-distribution" } -puffin-installer = { path = "../puffin-installer" } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-resolver = { path = "../puffin-resolver" } -puffin-traits = { path = "../puffin-traits" } +uv-build = { path = "../uv-build" } +uv-cache = { path = "../uv-cache" } +uv-client = { path = "../uv-client" } +uv-distribution = { path = "../uv-distribution" } +uv-installer = { path = "../uv-installer" } +uv-interpreter = { path = "../uv-interpreter" } +uv-resolver = { path = "../uv-resolver" } +uv-traits = { path = "../uv-traits" } pypi-types = { path = "../pypi-types" } anyhow = { workspace = true } diff --git a/crates/puffin-dispatch/src/lib.rs b/crates/uv-dispatch/src/lib.rs similarity index 93% rename from crates/puffin-dispatch/src/lib.rs rename to crates/uv-dispatch/src/lib.rs index 8b51bf1be0e6..5b8822172a9f 100644 --- a/crates/puffin-dispatch/src/lib.rs +++ b/crates/uv-dispatch/src/lib.rs @@ -1,5 +1,5 @@ -//! Avoid cyclic crate dependencies between [resolver][`puffin_resolver`], -//! [installer][`puffin_installer`] and [build][`puffin_build`] through [`BuildDispatch`] +//! Avoid cyclic crate dependencies between [resolver][`uv_resolver`], +//! [installer][`uv_installer`] and [build][`uv_build`] through [`BuildDispatch`] //! implementing [`BuildContext`]. use std::future::Future; @@ -12,13 +12,13 @@ use tracing::{debug, instrument}; use distribution_types::{IndexLocations, Name, Resolution, SourceDist}; use futures::FutureExt; use pep508_rs::Requirement; -use puffin_build::{SourceBuild, SourceBuildContext}; -use puffin_cache::Cache; -use puffin_client::{FlatIndex, RegistryClient}; -use puffin_installer::{Downloader, Installer, NoBinary, Plan, Planner, Reinstall, SitePackages}; -use puffin_interpreter::{Interpreter, Virtualenv}; -use puffin_resolver::{InMemoryIndex, Manifest, Options, Resolver}; -use puffin_traits::{BuildContext, BuildKind, InFlight, NoBuild, SetupPyStrategy}; +use uv_build::{SourceBuild, SourceBuildContext}; +use uv_cache::Cache; +use uv_client::{FlatIndex, RegistryClient}; +use uv_installer::{Downloader, Installer, NoBinary, Plan, Planner, Reinstall, SitePackages}; +use uv_interpreter::{Interpreter, Virtualenv}; +use uv_resolver::{InMemoryIndex, Manifest, Options, Resolver}; +use uv_traits::{BuildContext, BuildKind, InFlight, NoBuild, SetupPyStrategy}; /// The main implementation of [`BuildContext`], used by the CLI, see [`BuildContext`] /// documentation. @@ -208,7 +208,7 @@ impl<'a> BuildContext for BuildDispatch<'a> { // Remove any unnecessary packages. if !extraneous.is_empty() || !reinstalls.is_empty() { for dist_info in extraneous.iter().chain(reinstalls.iter()) { - let summary = puffin_installer::uninstall(dist_info) + let summary = uv_installer::uninstall(dist_info) .await .context("Failed to uninstall build dependencies")?; debug!( diff --git a/crates/puffin-distribution/Cargo.toml b/crates/uv-distribution/Cargo.toml similarity index 75% rename from crates/puffin-distribution/Cargo.toml rename to crates/uv-distribution/Cargo.toml index f82db64a7bb8..d81cac3dc129 100644 --- a/crates/puffin-distribution/Cargo.toml +++ b/crates/uv-distribution/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-distribution" +name = "uv-distribution" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -20,13 +20,13 @@ install-wheel-rs = { path = "../install-wheel-rs" } pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs" } platform-tags = { path = "../platform-tags" } -puffin-cache = { path = "../puffin-cache" } -puffin-client = { path = "../puffin-client" } -puffin-extract = { path = "../puffin-extract" } -puffin-fs = { path = "../puffin-fs", features = ["tokio"] } -puffin-git = { path = "../puffin-git", features = ["vendored-openssl"] } -puffin-normalize = { path = "../puffin-normalize" } -puffin-traits = { path = "../puffin-traits" } +uv-cache = { path = "../uv-cache" } +uv-client = { path = "../uv-client" } +uv-extract = { path = "../uv-extract" } +uv-fs = { path = "../uv-fs", features = ["tokio"] } +uv-git = { path = "../uv-git", features = ["vendored-openssl"] } +uv-normalize = { path = "../uv-normalize" } +uv-traits = { path = "../uv-traits" } pypi-types = { path = "../pypi-types" } anyhow = { workspace = true } diff --git a/crates/puffin-distribution/src/distribution_database.rs b/crates/uv-distribution/src/distribution_database.rs similarity index 97% rename from crates/puffin-distribution/src/distribution_database.rs rename to crates/uv-distribution/src/distribution_database.rs index ecf2f7702b86..dd2efdf61642 100644 --- a/crates/puffin-distribution/src/distribution_database.rs +++ b/crates/uv-distribution/src/distribution_database.rs @@ -12,12 +12,12 @@ use distribution_types::{ BuiltDist, DirectGitUrl, Dist, FileLocation, IndexLocations, LocalEditable, Name, SourceDist, }; use platform_tags::Tags; -use puffin_cache::{Cache, CacheBucket, Timestamp, WheelCache}; -use puffin_client::{CacheControl, CachedClientError, Connectivity, RegistryClient}; -use puffin_fs::metadata_if_exists; -use puffin_git::GitSource; -use puffin_traits::{BuildContext, NoBinary, NoBuild}; use pypi_types::Metadata21; +use uv_cache::{Cache, CacheBucket, Timestamp, WheelCache}; +use uv_client::{CacheControl, CachedClientError, Connectivity, RegistryClient}; +use uv_fs::metadata_if_exists; +use uv_git::GitSource; +use uv_traits::{BuildContext, NoBinary, NoBuild}; use crate::download::{BuiltWheel, UnzippedWheel}; use crate::locks::Locks; @@ -156,7 +156,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context> // Download and unzip the wheel to a temporary directory. let temp_dir = tempfile::tempdir_in(self.cache.root()).map_err(Error::CacheWrite)?; - puffin_extract::stream::unzip(reader.compat(), temp_dir.path()).await?; + uv_extract::stream::unzip(reader.compat(), temp_dir.path()).await?; // Persist the temporary directory to the directory store. let archive = self @@ -218,7 +218,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context> // Download and unzip the wheel to a temporary directory. let temp_dir = tempfile::tempdir_in(self.cache.root()).map_err(Error::CacheWrite)?; - puffin_extract::stream::unzip(reader.compat(), temp_dir.path()).await?; + uv_extract::stream::unzip(reader.compat(), temp_dir.path()).await?; // Persist the temporary directory to the directory store. let archive = self diff --git a/crates/puffin-distribution/src/download.rs b/crates/uv-distribution/src/download.rs similarity index 100% rename from crates/puffin-distribution/src/download.rs rename to crates/uv-distribution/src/download.rs diff --git a/crates/puffin-distribution/src/error.rs b/crates/uv-distribution/src/error.rs similarity index 94% rename from crates/puffin-distribution/src/error.rs rename to crates/uv-distribution/src/error.rs index d68906406bf1..9f6de3744d14 100644 --- a/crates/puffin-distribution/src/error.rs +++ b/crates/uv-distribution/src/error.rs @@ -2,7 +2,7 @@ use tokio::task::JoinError; use zip::result::ZipError; use distribution_filename::WheelFilenameError; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; #[derive(Debug, thiserror::Error)] pub enum Error { @@ -21,7 +21,7 @@ pub enum Error { #[error(transparent)] Request(#[from] reqwest::Error), #[error(transparent)] - Client(#[from] puffin_client::Error), + Client(#[from] uv_client::Error), // Cache writing error #[error("Failed to read from the distribution cache")] @@ -54,7 +54,7 @@ pub enum Error { #[error("Source distribution directory contains neither readable pyproject.toml nor setup.py")] DirWithoutEntrypoint, #[error("Failed to extract source distribution: {0}")] - Extract(#[from] puffin_extract::Error), + Extract(#[from] uv_extract::Error), /// Should not occur; only seen when another task panicked. #[error("The task executor is broken, did some other task panic?")] diff --git a/crates/puffin-distribution/src/index/built_wheel_index.rs b/crates/uv-distribution/src/index/built_wheel_index.rs similarity index 97% rename from crates/puffin-distribution/src/index/built_wheel_index.rs rename to crates/uv-distribution/src/index/built_wheel_index.rs index b644cd4d5886..f50895215924 100644 --- a/crates/puffin-distribution/src/index/built_wheel_index.rs +++ b/crates/uv-distribution/src/index/built_wheel_index.rs @@ -1,7 +1,7 @@ use distribution_types::{git_reference, DirectUrlSourceDist, GitSourceDist, Name, PathSourceDist}; use platform_tags::Tags; -use puffin_cache::{ArchiveTimestamp, Cache, CacheBucket, CacheShard, WheelCache}; -use puffin_fs::symlinks; +use uv_cache::{ArchiveTimestamp, Cache, CacheBucket, CacheShard, WheelCache}; +use uv_fs::symlinks; use crate::index::cached_wheel::CachedWheel; use crate::source::{read_http_manifest, read_timestamp_manifest, MANIFEST}; diff --git a/crates/puffin-distribution/src/index/cached_wheel.rs b/crates/uv-distribution/src/index/cached_wheel.rs similarity index 97% rename from crates/puffin-distribution/src/index/cached_wheel.rs rename to crates/uv-distribution/src/index/cached_wheel.rs index fdd299595fd0..a8e4172aa3f3 100644 --- a/crates/puffin-distribution/src/index/cached_wheel.rs +++ b/crates/uv-distribution/src/index/cached_wheel.rs @@ -3,7 +3,7 @@ use std::path::Path; use distribution_filename::WheelFilename; use distribution_types::{CachedDirectUrlDist, CachedRegistryDist}; use pep508_rs::VerbatimUrl; -use puffin_cache::CacheEntry; +use uv_cache::CacheEntry; #[derive(Debug, Clone)] pub struct CachedWheel { diff --git a/crates/puffin-distribution/src/index/mod.rs b/crates/uv-distribution/src/index/mod.rs similarity index 100% rename from crates/puffin-distribution/src/index/mod.rs rename to crates/uv-distribution/src/index/mod.rs diff --git a/crates/puffin-distribution/src/index/registry_wheel_index.rs b/crates/uv-distribution/src/index/registry_wheel_index.rs similarity index 97% rename from crates/puffin-distribution/src/index/registry_wheel_index.rs rename to crates/uv-distribution/src/index/registry_wheel_index.rs index ccd87c463bb7..15245e5cfac7 100644 --- a/crates/puffin-distribution/src/index/registry_wheel_index.rs +++ b/crates/uv-distribution/src/index/registry_wheel_index.rs @@ -7,9 +7,9 @@ use rustc_hash::FxHashMap; use distribution_types::{CachedRegistryDist, FlatIndexLocation, IndexLocations, IndexUrl}; use pep440_rs::Version; use platform_tags::Tags; -use puffin_cache::{Cache, CacheBucket, WheelCache}; -use puffin_fs::{directories, symlinks}; -use puffin_normalize::PackageName; +use uv_cache::{Cache, CacheBucket, WheelCache}; +use uv_fs::{directories, symlinks}; +use uv_normalize::PackageName; use crate::index::cached_wheel::CachedWheel; use crate::source::{read_http_manifest, MANIFEST}; diff --git a/crates/puffin-distribution/src/lib.rs b/crates/uv-distribution/src/lib.rs similarity index 100% rename from crates/puffin-distribution/src/lib.rs rename to crates/uv-distribution/src/lib.rs diff --git a/crates/puffin-distribution/src/locks.rs b/crates/uv-distribution/src/locks.rs similarity index 100% rename from crates/puffin-distribution/src/locks.rs rename to crates/uv-distribution/src/locks.rs diff --git a/crates/puffin-distribution/src/reporter.rs b/crates/uv-distribution/src/reporter.rs similarity index 90% rename from crates/puffin-distribution/src/reporter.rs rename to crates/uv-distribution/src/reporter.rs index 932d1eac7a45..678be5a4e7bf 100644 --- a/crates/puffin-distribution/src/reporter.rs +++ b/crates/uv-distribution/src/reporter.rs @@ -18,7 +18,7 @@ pub trait Reporter: Send + Sync { fn on_checkout_complete(&self, url: &Url, rev: &str, index: usize); } -/// A facade for converting from [`Reporter`] to [`puffin_git::Reporter`]. +/// A facade for converting from [`Reporter`] to [`uv_git::Reporter`]. pub(crate) struct Facade { reporter: Arc, } @@ -29,7 +29,7 @@ impl From> for Facade { } } -impl puffin_git::Reporter for Facade { +impl uv_git::Reporter for Facade { fn on_checkout_start(&self, url: &Url, rev: &str) -> usize { self.reporter.on_checkout_start(url, rev) } diff --git a/crates/puffin-distribution/src/source/built_wheel_metadata.rs b/crates/uv-distribution/src/source/built_wheel_metadata.rs similarity index 96% rename from crates/puffin-distribution/src/source/built_wheel_metadata.rs rename to crates/uv-distribution/src/source/built_wheel_metadata.rs index 1e6879a51e12..a968b88d1b87 100644 --- a/crates/puffin-distribution/src/source/built_wheel_metadata.rs +++ b/crates/uv-distribution/src/source/built_wheel_metadata.rs @@ -3,8 +3,8 @@ use std::str::FromStr; use distribution_filename::WheelFilename; use platform_tags::Tags; -use puffin_cache::CacheShard; -use puffin_fs::files; +use uv_cache::CacheShard; +use uv_fs::files; /// The information about the wheel we either just built or got from the cache. #[derive(Debug, Clone)] diff --git a/crates/puffin-distribution/src/source/manifest.rs b/crates/uv-distribution/src/source/manifest.rs similarity index 100% rename from crates/puffin-distribution/src/source/manifest.rs rename to crates/uv-distribution/src/source/manifest.rs diff --git a/crates/puffin-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs similarity index 99% rename from crates/puffin-distribution/src/source/mod.rs rename to crates/uv-distribution/src/source/mod.rs index fe4819fddaa2..61308eed5faf 100644 --- a/crates/puffin-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -21,16 +21,16 @@ use distribution_types::{ use install_wheel_rs::read_dist_info; use pep508_rs::VerbatimUrl; use platform_tags::Tags; -use puffin_cache::{ +use pypi_types::Metadata21; +use uv_cache::{ ArchiveTimestamp, CacheBucket, CacheEntry, CacheShard, CachedByTimestamp, Freshness, WheelCache, }; -use puffin_client::{ +use uv_client::{ CacheControl, CachedClientError, Connectivity, DataWithCachePolicy, RegistryClient, }; -use puffin_fs::{write_atomic, LockedFile}; -use puffin_git::{Fetch, GitSource}; -use puffin_traits::{BuildContext, BuildKind, NoBuild, SourceBuildTrait}; -use pypi_types::Metadata21; +use uv_fs::{write_atomic, LockedFile}; +use uv_git::{Fetch, GitSource}; +use uv_traits::{BuildContext, BuildKind, NoBuild, SourceBuildTrait}; use crate::error::Error; use crate::reporter::Facade; @@ -783,11 +783,11 @@ impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> { .bytes_stream() .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err)) .into_async_read(); - puffin_extract::stream::archive(reader.compat(), filename, temp_dir.path()).await?; + uv_extract::stream::archive(reader.compat(), filename, temp_dir.path()).await?; drop(span); // Extract the top-level directory. - let extracted = puffin_extract::strip_component(temp_dir.path())?; + let extracted = uv_extract::strip_component(temp_dir.path())?; // Persist it to the cache. fs_err::tokio::create_dir_all(cache_path.parent().expect("Cache entry to have parent")) diff --git a/crates/puffin-distribution/src/unzip.rs b/crates/uv-distribution/src/unzip.rs similarity index 80% rename from crates/puffin-distribution/src/unzip.rs rename to crates/uv-distribution/src/unzip.rs index 2cf933988ada..b1015d029d50 100644 --- a/crates/puffin-distribution/src/unzip.rs +++ b/crates/uv-distribution/src/unzip.rs @@ -1,6 +1,6 @@ use std::path::Path; -use puffin_extract::Error; +use uv_extract::Error; use crate::download::BuiltWheel; use crate::{DiskWheel, LocalWheel}; @@ -12,13 +12,13 @@ pub trait Unzip { impl Unzip for DiskWheel { fn unzip(&self, target: &Path) -> Result<(), Error> { - puffin_extract::unzip(fs_err::File::open(&self.path)?, target) + uv_extract::unzip(fs_err::File::open(&self.path)?, target) } } impl Unzip for BuiltWheel { fn unzip(&self, target: &Path) -> Result<(), Error> { - puffin_extract::unzip(fs_err::File::open(&self.path)?, target) + uv_extract::unzip(fs_err::File::open(&self.path)?, target) } } diff --git a/crates/puffin-extract/Cargo.toml b/crates/uv-extract/Cargo.toml similarity index 97% rename from crates/puffin-extract/Cargo.toml rename to crates/uv-extract/Cargo.toml index de38a6f5e4b7..2ac717eaab78 100644 --- a/crates/puffin-extract/Cargo.toml +++ b/crates/uv-extract/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-extract" +name = "uv-extract" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } diff --git a/crates/puffin-extract/src/error.rs b/crates/uv-extract/src/error.rs similarity index 100% rename from crates/puffin-extract/src/error.rs rename to crates/uv-extract/src/error.rs diff --git a/crates/puffin-extract/src/lib.rs b/crates/uv-extract/src/lib.rs similarity index 100% rename from crates/puffin-extract/src/lib.rs rename to crates/uv-extract/src/lib.rs diff --git a/crates/puffin-extract/src/stream.rs b/crates/uv-extract/src/stream.rs similarity index 100% rename from crates/puffin-extract/src/stream.rs rename to crates/uv-extract/src/stream.rs diff --git a/crates/puffin-extract/src/sync.rs b/crates/uv-extract/src/sync.rs similarity index 100% rename from crates/puffin-extract/src/sync.rs rename to crates/uv-extract/src/sync.rs diff --git a/crates/puffin-extract/src/vendor/cloneable_seekable_reader.rs b/crates/uv-extract/src/vendor/cloneable_seekable_reader.rs similarity index 100% rename from crates/puffin-extract/src/vendor/cloneable_seekable_reader.rs rename to crates/uv-extract/src/vendor/cloneable_seekable_reader.rs diff --git a/crates/puffin-extract/src/vendor/mod.rs b/crates/uv-extract/src/vendor/mod.rs similarity index 100% rename from crates/puffin-extract/src/vendor/mod.rs rename to crates/uv-extract/src/vendor/mod.rs diff --git a/crates/puffin-fs/Cargo.toml b/crates/uv-fs/Cargo.toml similarity index 88% rename from crates/puffin-fs/Cargo.toml rename to crates/uv-fs/Cargo.toml index 80178349ae46..af3cf42ec7ea 100644 --- a/crates/puffin-fs/Cargo.toml +++ b/crates/uv-fs/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-fs" +name = "uv-fs" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -13,7 +13,7 @@ license = { workspace = true } workspace = true [dependencies] -puffin-warnings = { path = "../puffin-warnings" } +uv-warnings = { path = "../uv-warnings" } dunce = { workspace = true } fs-err = { workspace = true } diff --git a/crates/puffin-fs/src/lib.rs b/crates/uv-fs/src/lib.rs similarity index 99% rename from crates/puffin-fs/src/lib.rs rename to crates/uv-fs/src/lib.rs index b831889c1f75..bb7d280b62d9 100644 --- a/crates/puffin-fs/src/lib.rs +++ b/crates/uv-fs/src/lib.rs @@ -6,7 +6,7 @@ use fs_err as fs; use tempfile::NamedTempFile; use tracing::{error, warn}; -use puffin_warnings::warn_user; +use uv_warnings::warn_user; pub use crate::path::*; diff --git a/crates/puffin-fs/src/path.rs b/crates/uv-fs/src/path.rs similarity index 100% rename from crates/puffin-fs/src/path.rs rename to crates/uv-fs/src/path.rs diff --git a/crates/puffin-git/Cargo.toml b/crates/uv-git/Cargo.toml similarity index 94% rename from crates/puffin-git/Cargo.toml rename to crates/uv-git/Cargo.toml index edefb73cd82d..af4b23e24a45 100644 --- a/crates/puffin-git/Cargo.toml +++ b/crates/uv-git/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-git" +name = "uv-git" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -14,7 +14,7 @@ workspace = true [dependencies] cache-key = { path = "../cache-key" } -puffin-fs = { path = "../puffin-fs" } +uv-fs = { path = "../uv-fs" } anyhow = { workspace = true } base64 = { workspace = true } diff --git a/crates/puffin-git/src/git.rs b/crates/uv-git/src/git.rs similarity index 99% rename from crates/puffin-git/src/git.rs rename to crates/uv-git/src/git.rs index 0a94803e62c1..84401d542fab 100644 --- a/crates/puffin-git/src/git.rs +++ b/crates/uv-git/src/git.rs @@ -9,11 +9,11 @@ use std::{env, str}; use anyhow::{anyhow, Context as _, Result}; use cargo_util::{paths, ProcessBuilder}; use git2::{self, ErrorClass, ObjectType}; -use puffin_fs::Normalized; use reqwest::Client; use reqwest::StatusCode; use tracing::{debug, warn}; use url::Url; +use uv_fs::Normalized; use crate::util::retry; use crate::FetchStrategy; @@ -1304,7 +1304,7 @@ fn github_fast_path( debug!("Attempting GitHub fast path for: {url}"); let mut request = client.get(&url); request = request.header("Accept", "application/vnd.github.3.sha"); - request = request.header("User-Agent", "puffin"); + request = request.header("User-Agent", "uv"); if let Some(local_object) = local_object { request = request.header("If-None-Match", local_object.to_string()); } diff --git a/crates/puffin-git/src/known_hosts.rs b/crates/uv-git/src/known_hosts.rs similarity index 100% rename from crates/puffin-git/src/known_hosts.rs rename to crates/uv-git/src/known_hosts.rs diff --git a/crates/puffin-git/src/lib.rs b/crates/uv-git/src/lib.rs similarity index 100% rename from crates/puffin-git/src/lib.rs rename to crates/uv-git/src/lib.rs diff --git a/crates/puffin-git/src/sha.rs b/crates/uv-git/src/sha.rs similarity index 100% rename from crates/puffin-git/src/sha.rs rename to crates/uv-git/src/sha.rs diff --git a/crates/puffin-git/src/source.rs b/crates/uv-git/src/source.rs similarity index 100% rename from crates/puffin-git/src/source.rs rename to crates/uv-git/src/source.rs diff --git a/crates/puffin-git/src/util/errors.rs b/crates/uv-git/src/util/errors.rs similarity index 100% rename from crates/puffin-git/src/util/errors.rs rename to crates/uv-git/src/util/errors.rs diff --git a/crates/puffin-git/src/util/mod.rs b/crates/uv-git/src/util/mod.rs similarity index 100% rename from crates/puffin-git/src/util/mod.rs rename to crates/uv-git/src/util/mod.rs diff --git a/crates/puffin-git/src/util/retry.rs b/crates/uv-git/src/util/retry.rs similarity index 100% rename from crates/puffin-git/src/util/retry.rs rename to crates/uv-git/src/util/retry.rs diff --git a/crates/puffin-installer/Cargo.toml b/crates/uv-installer/Cargo.toml similarity index 68% rename from crates/puffin-installer/Cargo.toml rename to crates/uv-installer/Cargo.toml index 9583c6a350f1..78b5cd7d0c6a 100644 --- a/crates/puffin-installer/Cargo.toml +++ b/crates/uv-installer/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-installer" +name = "uv-installer" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -20,15 +20,15 @@ once-map = { path = "../once-map" } pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs" } platform-tags = { path = "../platform-tags" } -puffin-cache = { path = "../puffin-cache" } -puffin-client = { path = "../puffin-client" } -puffin-distribution = { path = "../puffin-distribution" } -puffin-extract = { path = "../puffin-extract" } -puffin-fs = { path = "../puffin-fs" } -puffin-git = { path = "../puffin-git", features = ["vendored-openssl"] } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-normalize = { path = "../puffin-normalize" } -puffin-traits = { path = "../puffin-traits" } +uv-cache = { path = "../uv-cache" } +uv-client = { path = "../uv-client" } +uv-distribution = { path = "../uv-distribution" } +uv-extract = { path = "../uv-extract" } +uv-fs = { path = "../uv-fs" } +uv-git = { path = "../uv-git", features = ["vendored-openssl"] } +uv-interpreter = { path = "../uv-interpreter" } +uv-normalize = { path = "../uv-normalize" } +uv-traits = { path = "../uv-traits" } pypi-types = { path = "../pypi-types" } requirements-txt = { path = "../requirements-txt" } diff --git a/crates/puffin-installer/src/downloader.rs b/crates/uv-installer/src/downloader.rs similarity index 94% rename from crates/puffin-installer/src/downloader.rs rename to crates/uv-installer/src/downloader.rs index a17f6b120c60..9c7b54751d71 100644 --- a/crates/puffin-installer/src/downloader.rs +++ b/crates/uv-installer/src/downloader.rs @@ -9,24 +9,24 @@ use url::Url; use distribution_types::{CachedDist, Dist, Identifier, LocalEditable, RemoteSource, SourceDist}; use platform_tags::Tags; -use puffin_cache::Cache; -use puffin_client::RegistryClient; -use puffin_distribution::{DistributionDatabase, LocalWheel, Unzip}; -use puffin_traits::{BuildContext, InFlight}; +use uv_cache::Cache; +use uv_client::RegistryClient; +use uv_distribution::{DistributionDatabase, LocalWheel, Unzip}; +use uv_traits::{BuildContext, InFlight}; use crate::editable::BuiltEditable; #[derive(thiserror::Error, Debug)] pub enum Error { #[error("Failed to unzip wheel: {0}")] - Unzip(Dist, #[source] puffin_extract::Error), + Unzip(Dist, #[source] uv_extract::Error), #[error("Failed to fetch wheel: {0}")] - Fetch(Dist, #[source] puffin_distribution::Error), + Fetch(Dist, #[source] uv_distribution::Error), /// Should not occur; only seen when another task panicked. #[error("The task executor is broken, did some other task panic?")] Join(#[from] JoinError), #[error(transparent)] - Editable(#[from] puffin_distribution::Error), + Editable(#[from] uv_distribution::Error), #[error("Unzip failed in another thread: {0}")] Thread(String), } @@ -200,7 +200,7 @@ impl<'a, Context: BuildContext + Send + Sync> Downloader<'a, Context> { let archive = tokio::task::spawn_blocking({ let download = download.clone(); let cache = self.cache.clone(); - move || -> Result { + move || -> Result { // Unzip the wheel into a temporary directory. let temp_dir = tempfile::tempdir_in(cache.root())?; download.unzip(temp_dir.path())?; @@ -243,7 +243,7 @@ pub trait Reporter: Send + Sync { fn on_checkout_complete(&self, url: &Url, rev: &str, index: usize); } -/// A facade for converting from [`Reporter`] to [`puffin_git::Reporter`]. +/// A facade for converting from [`Reporter`] to [`uv_git::Reporter`]. struct Facade { reporter: Arc, } @@ -254,7 +254,7 @@ impl From> for Facade { } } -impl puffin_distribution::Reporter for Facade { +impl uv_distribution::Reporter for Facade { fn on_build_start(&self, dist: &SourceDist) -> usize { self.reporter.on_build_start(dist) } diff --git a/crates/puffin-installer/src/editable.rs b/crates/uv-installer/src/editable.rs similarity index 98% rename from crates/puffin-installer/src/editable.rs rename to crates/uv-installer/src/editable.rs index 3a433d85b896..dc2e684efab8 100644 --- a/crates/puffin-installer/src/editable.rs +++ b/crates/uv-installer/src/editable.rs @@ -1,8 +1,8 @@ use distribution_types::{ CachedDist, InstalledDist, InstalledMetadata, InstalledVersion, LocalEditable, Name, }; -use puffin_normalize::PackageName; use pypi_types::Metadata21; +use uv_normalize::PackageName; /// An editable distribution that has been built. #[derive(Debug, Clone)] diff --git a/crates/puffin-installer/src/installer.rs b/crates/uv-installer/src/installer.rs similarity index 97% rename from crates/puffin-installer/src/installer.rs rename to crates/uv-installer/src/installer.rs index 0c846141421a..8b8a91722935 100644 --- a/crates/puffin-installer/src/installer.rs +++ b/crates/uv-installer/src/installer.rs @@ -3,7 +3,7 @@ use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use tracing::instrument; use distribution_types::CachedDist; -use puffin_interpreter::Virtualenv; +use uv_interpreter::Virtualenv; pub struct Installer<'a> { venv: &'a Virtualenv, @@ -56,7 +56,7 @@ impl<'a> Installer<'a> { .map(pypi_types::DirectUrl::try_from) .transpose()? .as_ref(), - Some("puffin"), + Some("uv"), self.link_mode, ) .with_context(|| format!("Failed to install: {} ({wheel})", wheel.filename()))?; diff --git a/crates/puffin-installer/src/lib.rs b/crates/uv-installer/src/lib.rs similarity index 92% rename from crates/puffin-installer/src/lib.rs rename to crates/uv-installer/src/lib.rs index 0d458858a8c4..0c2c6bf7ffff 100644 --- a/crates/puffin-installer/src/lib.rs +++ b/crates/uv-installer/src/lib.rs @@ -3,9 +3,9 @@ pub use editable::{BuiltEditable, ResolvedEditable}; pub use installer::{Installer, Reporter as InstallReporter}; pub use plan::{Plan, Planner, Reinstall}; // TODO(zanieb): Just import this properly everywhere else -pub use puffin_traits::NoBinary; pub use site_packages::SitePackages; pub use uninstall::uninstall; +pub use uv_traits::NoBinary; mod downloader; mod editable; mod installer; diff --git a/crates/puffin-installer/src/plan.rs b/crates/uv-installer/src/plan.rs similarity index 98% rename from crates/puffin-installer/src/plan.rs rename to crates/uv-installer/src/plan.rs index 9add740ade4f..ccb1e38d0ad7 100644 --- a/crates/puffin-installer/src/plan.rs +++ b/crates/uv-installer/src/plan.rs @@ -12,12 +12,12 @@ use distribution_types::{ }; use pep508_rs::{Requirement, VersionOrUrl}; use platform_tags::Tags; -use puffin_cache::{ArchiveTimestamp, Cache, CacheBucket, CacheEntry, Timestamp, WheelCache}; -use puffin_distribution::{BuiltWheelIndex, RegistryWheelIndex}; -use puffin_fs::Normalized; -use puffin_interpreter::Virtualenv; -use puffin_normalize::PackageName; -use puffin_traits::NoBinary; +use uv_cache::{ArchiveTimestamp, Cache, CacheBucket, CacheEntry, Timestamp, WheelCache}; +use uv_distribution::{BuiltWheelIndex, RegistryWheelIndex}; +use uv_fs::Normalized; +use uv_interpreter::Virtualenv; +use uv_normalize::PackageName; +use uv_traits::NoBinary; use crate::{ResolvedEditable, SitePackages}; @@ -357,7 +357,7 @@ impl<'a> Planner<'a> { // Remove any unnecessary packages. if !site_packages.is_empty() { - // If Puffin created the virtual environment, then remove all packages, regardless of + // If uv created the virtual environment, then remove all packages, regardless of // whether they're considered "seed" packages. let seed_packages = !venv.cfg().is_ok_and(|cfg| cfg.is_gourgeist()); for dist_info in site_packages { diff --git a/crates/puffin-installer/src/site_packages.rs b/crates/uv-installer/src/site_packages.rs similarity index 99% rename from crates/puffin-installer/src/site_packages.rs rename to crates/uv-installer/src/site_packages.rs index 9f640fc977a4..52ba487c0418 100644 --- a/crates/puffin-installer/src/site_packages.rs +++ b/crates/uv-installer/src/site_packages.rs @@ -9,9 +9,9 @@ use url::Url; use distribution_types::{InstalledDist, InstalledMetadata, InstalledVersion, Name}; use pep440_rs::{Version, VersionSpecifiers}; use pep508_rs::{Requirement, VerbatimUrl}; -use puffin_interpreter::Virtualenv; -use puffin_normalize::PackageName; use requirements_txt::EditableRequirement; +use uv_interpreter::Virtualenv; +use uv_normalize::PackageName; /// An index over the packages installed in an environment. /// diff --git a/crates/puffin-installer/src/uninstall.rs b/crates/uv-installer/src/uninstall.rs similarity index 100% rename from crates/puffin-installer/src/uninstall.rs rename to crates/uv-installer/src/uninstall.rs diff --git a/crates/puffin-interpreter/Cargo.toml b/crates/uv-interpreter/Cargo.toml similarity index 90% rename from crates/puffin-interpreter/Cargo.toml rename to crates/uv-interpreter/Cargo.toml index 563881e99ee7..85c85d7e6c43 100644 --- a/crates/puffin-interpreter/Cargo.toml +++ b/crates/uv-interpreter/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-interpreter" +name = "uv-interpreter" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -18,8 +18,8 @@ pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs", features = ["serde"] } platform-host = { path = "../platform-host" } platform-tags = { path = "../platform-tags" } -puffin-cache = { path = "../puffin-cache" } -puffin-fs = { path = "../puffin-fs" } +uv-cache = { path = "../uv-cache" } +uv-fs = { path = "../uv-fs" } fs-err = { workspace = true, features = ["tokio"] } once_cell = { workspace = true } diff --git a/crates/puffin-interpreter/src/cfg.rs b/crates/uv-interpreter/src/cfg.rs similarity index 100% rename from crates/puffin-interpreter/src/cfg.rs rename to crates/uv-interpreter/src/cfg.rs diff --git a/crates/puffin-interpreter/src/get_interpreter_info.py b/crates/uv-interpreter/src/get_interpreter_info.py similarity index 100% rename from crates/puffin-interpreter/src/get_interpreter_info.py rename to crates/uv-interpreter/src/get_interpreter_info.py diff --git a/crates/puffin-interpreter/src/interpreter.rs b/crates/uv-interpreter/src/interpreter.rs similarity index 98% rename from crates/puffin-interpreter/src/interpreter.rs rename to crates/uv-interpreter/src/interpreter.rs index 9bdef18b54a1..8fd6d0e0cd43 100644 --- a/crates/puffin-interpreter/src/interpreter.rs +++ b/crates/uv-interpreter/src/interpreter.rs @@ -12,8 +12,8 @@ use pep440_rs::Version; use pep508_rs::MarkerEnvironment; use platform_host::Platform; use platform_tags::{Tags, TagsError}; -use puffin_cache::{Cache, CacheBucket, CachedByTimestamp, Freshness, Timestamp}; -use puffin_fs::write_atomic_sync; +use uv_cache::{Cache, CacheBucket, CachedByTimestamp, Freshness, Timestamp}; +use uv_fs::write_atomic_sync; use crate::python_platform::PythonPlatform; use crate::virtual_env::detect_virtual_env; @@ -436,7 +436,7 @@ mod tests { use pep440_rs::Version; use platform_host::Platform; - use puffin_cache::Cache; + use uv_cache::Cache; use crate::Interpreter; @@ -462,7 +462,7 @@ mod tests { "base_exec_prefix": "/home/ferris/.pyenv/versions/3.12.0", "base_prefix": "/home/ferris/.pyenv/versions/3.12.0", "stdlib": "/usr/lib/python3.12", - "sys_executable": "/home/ferris/projects/puffin/.venv/bin/python" + "sys_executable": "/home/ferris/projects/uv/.venv/bin/python" } "##}; diff --git a/crates/puffin-interpreter/src/lib.rs b/crates/uv-interpreter/src/lib.rs similarity index 95% rename from crates/puffin-interpreter/src/lib.rs rename to crates/uv-interpreter/src/lib.rs index cd9d62ac5eee..684c7f164646 100644 --- a/crates/puffin-interpreter/src/lib.rs +++ b/crates/uv-interpreter/src/lib.rs @@ -5,7 +5,7 @@ use std::path::PathBuf; use pep440_rs::Version; use thiserror::Error; -use puffin_fs::Normalized; +use uv_fs::Normalized; pub use crate::cfg::Configuration; pub use crate::interpreter::Interpreter; @@ -30,7 +30,7 @@ pub enum Error { Conflict, #[error("No versions of Python could be found. Is Python installed?")] PythonNotFound, - #[error("Failed to locate a virtualenv or Conda environment (checked: `VIRTUAL_ENV`, `CONDA_PREFIX`, and `.venv`). Run `puffin venv` to create a virtualenv.")] + #[error("Failed to locate a virtualenv or Conda environment (checked: `VIRTUAL_ENV`, `CONDA_PREFIX`, and `.venv`). Run `uv venv` to create a virtualenv.")] NotFound, #[error(transparent)] Io(#[from] io::Error), diff --git a/crates/puffin-interpreter/src/python_platform.rs b/crates/uv-interpreter/src/python_platform.rs similarity index 100% rename from crates/puffin-interpreter/src/python_platform.rs rename to crates/uv-interpreter/src/python_platform.rs diff --git a/crates/puffin-interpreter/src/python_query.rs b/crates/uv-interpreter/src/python_query.rs similarity index 99% rename from crates/puffin-interpreter/src/python_query.rs rename to crates/uv-interpreter/src/python_query.rs index 33abd089343f..20a4ab30e2eb 100644 --- a/crates/puffin-interpreter/src/python_query.rs +++ b/crates/uv-interpreter/src/python_query.rs @@ -6,9 +6,9 @@ use std::process::Command; use once_cell::sync::Lazy; use platform_host::Platform; -use puffin_cache::Cache; use regex::Regex; use tracing::{info_span, instrument}; +use uv_cache::Cache; use crate::{Error, Interpreter}; @@ -256,7 +256,7 @@ mod tests { use insta::assert_snapshot; use itertools::Itertools; use platform_host::Platform; - use puffin_cache::Cache; + use uv_cache::Cache; use crate::python_query::find_requested_python; use crate::Error; diff --git a/crates/puffin-interpreter/src/python_version.rs b/crates/uv-interpreter/src/python_version.rs similarity index 100% rename from crates/puffin-interpreter/src/python_version.rs rename to crates/uv-interpreter/src/python_version.rs diff --git a/crates/puffin-interpreter/src/virtual_env.rs b/crates/uv-interpreter/src/virtual_env.rs similarity index 98% rename from crates/puffin-interpreter/src/virtual_env.rs rename to crates/uv-interpreter/src/virtual_env.rs index eb69b4a9cabe..46c727c3c2ff 100644 --- a/crates/puffin-interpreter/src/virtual_env.rs +++ b/crates/uv-interpreter/src/virtual_env.rs @@ -5,8 +5,8 @@ use std::path::{Path, PathBuf}; use tracing::debug; use platform_host::Platform; -use puffin_cache::Cache; -use puffin_fs::{LockedFile, Normalized}; +use uv_cache::Cache; +use uv_fs::{LockedFile, Normalized}; use crate::cfg::Configuration; use crate::python_platform::PythonPlatform; diff --git a/crates/puffin-normalize/Cargo.toml b/crates/uv-normalize/Cargo.toml similarity index 90% rename from crates/puffin-normalize/Cargo.toml rename to crates/uv-normalize/Cargo.toml index 21c7f23f84ea..0e2c79dfa39d 100644 --- a/crates/puffin-normalize/Cargo.toml +++ b/crates/uv-normalize/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-normalize" +name = "uv-normalize" version = "0.0.1" edition = "2021" description = "Normalization for distribution, package and extra anmes" diff --git a/crates/puffin-normalize/src/extra_name.rs b/crates/uv-normalize/src/extra_name.rs similarity index 100% rename from crates/puffin-normalize/src/extra_name.rs rename to crates/uv-normalize/src/extra_name.rs diff --git a/crates/puffin-normalize/src/lib.rs b/crates/uv-normalize/src/lib.rs similarity index 100% rename from crates/puffin-normalize/src/lib.rs rename to crates/uv-normalize/src/lib.rs diff --git a/crates/puffin-normalize/src/package_name.rs b/crates/uv-normalize/src/package_name.rs similarity index 100% rename from crates/puffin-normalize/src/package_name.rs rename to crates/uv-normalize/src/package_name.rs diff --git a/crates/puffin-resolver/Cargo.toml b/crates/uv-resolver/Cargo.toml similarity index 79% rename from crates/puffin-resolver/Cargo.toml rename to crates/uv-resolver/Cargo.toml index b8580f3e3f42..38fe6601deef 100644 --- a/crates/puffin-resolver/Cargo.toml +++ b/crates/uv-resolver/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-resolver" +name = "uv-resolver" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -22,14 +22,14 @@ pep440_rs = { path = "../pep440-rs", features = ["pubgrub"] } pep508_rs = { path = "../pep508-rs" } platform-host = { path = "../platform-host" } platform-tags = { path = "../platform-tags" } -puffin-cache = { path = "../puffin-cache" } -puffin-client = { path = "../puffin-client" } -puffin-distribution = { path = "../puffin-distribution" } -puffin-git = { path = "../puffin-git", features = ["vendored-openssl"] } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-normalize = { path = "../puffin-normalize" } -puffin-traits = { path = "../puffin-traits" } -puffin-warnings = { path = "../puffin-warnings" } +uv-cache = { path = "../uv-cache" } +uv-client = { path = "../uv-client" } +uv-distribution = { path = "../uv-distribution" } +uv-git = { path = "../uv-git", features = ["vendored-openssl"] } +uv-interpreter = { path = "../uv-interpreter" } +uv-normalize = { path = "../uv-normalize" } +uv-traits = { path = "../uv-traits" } +uv-warnings = { path = "../uv-warnings" } pypi-types = { path = "../pypi-types" } anstream = { workspace = true } @@ -63,7 +63,7 @@ zip = { workspace = true } [dev-dependencies] gourgeist = { path = "../gourgeist" } -puffin-interpreter = { path = "../puffin-interpreter" } +uv-interpreter = { path = "../uv-interpreter" } once_cell = { version = "1.19.0" } insta = { version = "1.34.0" } diff --git a/crates/puffin-resolver/src/candidate_selector.rs b/crates/uv-resolver/src/candidate_selector.rs similarity index 99% rename from crates/puffin-resolver/src/candidate_selector.rs rename to crates/uv-resolver/src/candidate_selector.rs index 10e93e3cea43..dc5f26b27f4c 100644 --- a/crates/puffin-resolver/src/candidate_selector.rs +++ b/crates/uv-resolver/src/candidate_selector.rs @@ -6,7 +6,7 @@ use distribution_types::CompatibleDist; use distribution_types::{DistributionMetadata, IncompatibleWheel, Name, PrioritizedDist}; use pep440_rs::Version; use pep508_rs::{Requirement, VersionOrUrl}; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::prerelease_mode::PreReleaseStrategy; diff --git a/crates/puffin-resolver/src/dependency_mode.rs b/crates/uv-resolver/src/dependency_mode.rs similarity index 100% rename from crates/puffin-resolver/src/dependency_mode.rs rename to crates/uv-resolver/src/dependency_mode.rs diff --git a/crates/puffin-resolver/src/error.rs b/crates/uv-resolver/src/error.rs similarity index 96% rename from crates/puffin-resolver/src/error.rs rename to crates/uv-resolver/src/error.rs index 6c06a1b8aa35..c32e247f9ad8 100644 --- a/crates/puffin-resolver/src/error.rs +++ b/crates/uv-resolver/src/error.rs @@ -13,7 +13,7 @@ use distribution_types::{BuiltDist, IndexLocations, PathBuiltDist, PathSourceDis use once_map::OnceMap; use pep440_rs::Version; use pep508_rs::Requirement; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::candidate_selector::CandidateSelector; use crate::pubgrub::{PubGrubPackage, PubGrubPython, PubGrubReportFormatter}; @@ -26,7 +26,7 @@ pub enum ResolveError { NotFound(Requirement), #[error(transparent)] - Client(#[from] puffin_client::Error), + Client(#[from] uv_client::Error), #[error("The channel is closed, was there a panic?")] ChannelClosed, @@ -59,16 +59,16 @@ pub enum ResolveError { DistributionType(#[from] distribution_types::Error), #[error("Failed to download: {0}")] - Fetch(Box, #[source] puffin_distribution::Error), + Fetch(Box, #[source] uv_distribution::Error), #[error("Failed to download and build: {0}")] - FetchAndBuild(Box, #[source] puffin_distribution::Error), + FetchAndBuild(Box, #[source] uv_distribution::Error), #[error("Failed to read: {0}")] - Read(Box, #[source] puffin_distribution::Error), + Read(Box, #[source] uv_distribution::Error), #[error("Failed to build: {0}")] - Build(Box, #[source] puffin_distribution::Error), + Build(Box, #[source] uv_distribution::Error), #[error(transparent)] NoSolution(#[from] NoSolutionError), diff --git a/crates/puffin-resolver/src/finder.rs b/crates/uv-resolver/src/finder.rs similarity index 98% rename from crates/puffin-resolver/src/finder.rs rename to crates/uv-resolver/src/finder.rs index 97305056ce80..a1034186dfe2 100644 --- a/crates/puffin-resolver/src/finder.rs +++ b/crates/uv-resolver/src/finder.rs @@ -4,18 +4,18 @@ use anyhow::Result; use futures::{stream, Stream, StreamExt, TryStreamExt}; -use puffin_traits::NoBinary; use rustc_hash::FxHashMap; +use uv_traits::NoBinary; use distribution_filename::DistFilename; use distribution_types::{Dist, IndexUrl, Resolution}; use pep508_rs::{Requirement, VersionOrUrl}; use platform_tags::{TagCompatibility, Tags}; -use puffin_client::{ +use uv_client::{ FlatDistributions, FlatIndex, OwnedArchive, RegistryClient, SimpleMetadata, SimpleMetadatum, }; -use puffin_interpreter::Interpreter; -use puffin_normalize::PackageName; +use uv_interpreter::Interpreter; +use uv_normalize::PackageName; use crate::error::ResolveError; diff --git a/crates/puffin-resolver/src/lib.rs b/crates/uv-resolver/src/lib.rs similarity index 100% rename from crates/puffin-resolver/src/lib.rs rename to crates/uv-resolver/src/lib.rs diff --git a/crates/puffin-resolver/src/manifest.rs b/crates/uv-resolver/src/manifest.rs similarity index 97% rename from crates/puffin-resolver/src/manifest.rs rename to crates/uv-resolver/src/manifest.rs index 0a2d1431799c..9ac01cd6c088 100644 --- a/crates/puffin-resolver/src/manifest.rs +++ b/crates/uv-resolver/src/manifest.rs @@ -1,7 +1,7 @@ use distribution_types::LocalEditable; use pep508_rs::Requirement; -use puffin_normalize::PackageName; use pypi_types::Metadata21; +use uv_normalize::PackageName; /// A manifest of requirements, constraints, and preferences. #[derive(Debug)] diff --git a/crates/puffin-resolver/src/options.rs b/crates/uv-resolver/src/options.rs similarity index 100% rename from crates/puffin-resolver/src/options.rs rename to crates/uv-resolver/src/options.rs diff --git a/crates/puffin-resolver/src/overrides.rs b/crates/uv-resolver/src/overrides.rs similarity index 97% rename from crates/puffin-resolver/src/overrides.rs rename to crates/uv-resolver/src/overrides.rs index 885bec91f646..ca3b1d31a2b6 100644 --- a/crates/puffin-resolver/src/overrides.rs +++ b/crates/uv-resolver/src/overrides.rs @@ -4,7 +4,7 @@ use std::hash::BuildHasherDefault; use rustc_hash::FxHashMap; use pep508_rs::Requirement; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; /// A set of overrides for a set of requirements. #[derive(Debug, Default, Clone)] diff --git a/crates/puffin-resolver/src/pins.rs b/crates/uv-resolver/src/pins.rs similarity index 96% rename from crates/puffin-resolver/src/pins.rs rename to crates/uv-resolver/src/pins.rs index 428f5074f481..6c656c5008b7 100644 --- a/crates/puffin-resolver/src/pins.rs +++ b/crates/uv-resolver/src/pins.rs @@ -1,7 +1,7 @@ use rustc_hash::FxHashMap; use distribution_types::{CompatibleDist, Dist}; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::candidate_selector::Candidate; diff --git a/crates/puffin-resolver/src/prerelease_mode.rs b/crates/uv-resolver/src/prerelease_mode.rs similarity index 99% rename from crates/puffin-resolver/src/prerelease_mode.rs rename to crates/uv-resolver/src/prerelease_mode.rs index a1f4b6cd464f..5f5a84188334 100644 --- a/crates/puffin-resolver/src/prerelease_mode.rs +++ b/crates/uv-resolver/src/prerelease_mode.rs @@ -1,7 +1,7 @@ use rustc_hash::FxHashSet; use pep508_rs::{Requirement, VersionOrUrl}; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] diff --git a/crates/puffin-resolver/src/pubgrub/dependencies.rs b/crates/uv-resolver/src/pubgrub/dependencies.rs similarity index 99% rename from crates/puffin-resolver/src/pubgrub/dependencies.rs rename to crates/uv-resolver/src/pubgrub/dependencies.rs index f54747d520ab..e7745ccea218 100644 --- a/crates/puffin-resolver/src/pubgrub/dependencies.rs +++ b/crates/uv-resolver/src/pubgrub/dependencies.rs @@ -5,7 +5,7 @@ use pubgrub::type_aliases::DependencyConstraints; use tracing::warn; use pep508_rs::{MarkerEnvironment, Requirement, VersionOrUrl}; -use puffin_normalize::{ExtraName, PackageName}; +use uv_normalize::{ExtraName, PackageName}; use crate::overrides::Overrides; use crate::pubgrub::specifier::PubGrubSpecifier; diff --git a/crates/puffin-resolver/src/pubgrub/distribution.rs b/crates/uv-resolver/src/pubgrub/distribution.rs similarity index 96% rename from crates/puffin-resolver/src/pubgrub/distribution.rs rename to crates/uv-resolver/src/pubgrub/distribution.rs index 064a9a4c8a43..3a0c92cffa7b 100644 --- a/crates/puffin-resolver/src/pubgrub/distribution.rs +++ b/crates/uv-resolver/src/pubgrub/distribution.rs @@ -1,7 +1,7 @@ use distribution_types::{DistributionMetadata, Name, VersionOrUrl}; use pep440_rs::Version; use pep508_rs::VerbatimUrl; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; #[derive(Debug)] pub(crate) enum PubGrubDistribution<'a> { diff --git a/crates/puffin-resolver/src/pubgrub/mod.rs b/crates/uv-resolver/src/pubgrub/mod.rs similarity index 100% rename from crates/puffin-resolver/src/pubgrub/mod.rs rename to crates/uv-resolver/src/pubgrub/mod.rs diff --git a/crates/puffin-resolver/src/pubgrub/package.rs b/crates/uv-resolver/src/pubgrub/package.rs similarity index 99% rename from crates/puffin-resolver/src/pubgrub/package.rs rename to crates/uv-resolver/src/pubgrub/package.rs index 555489587c6f..6fb3181adf02 100644 --- a/crates/puffin-resolver/src/pubgrub/package.rs +++ b/crates/uv-resolver/src/pubgrub/package.rs @@ -1,7 +1,7 @@ use derivative::Derivative; use pep508_rs::VerbatimUrl; -use puffin_normalize::{ExtraName, PackageName}; +use uv_normalize::{ExtraName, PackageName}; /// A PubGrub-compatible wrapper around a "Python package", with two notable characteristics: /// diff --git a/crates/puffin-resolver/src/pubgrub/priority.rs b/crates/uv-resolver/src/pubgrub/priority.rs similarity index 96% rename from crates/puffin-resolver/src/pubgrub/priority.rs rename to crates/uv-resolver/src/pubgrub/priority.rs index 4f9e5d82fcc6..d8fc3f21040f 100644 --- a/crates/puffin-resolver/src/pubgrub/priority.rs +++ b/crates/uv-resolver/src/pubgrub/priority.rs @@ -2,7 +2,7 @@ use std::cmp::Reverse; use rustc_hash::FxHashMap; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::pubgrub::package::PubGrubPackage; diff --git a/crates/puffin-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs similarity index 99% rename from crates/puffin-resolver/src/pubgrub/report.rs rename to crates/uv-resolver/src/pubgrub/report.rs index 421ea25fb5cf..aca97ed0c775 100644 --- a/crates/puffin-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -12,8 +12,8 @@ use pubgrub::range::Range; use pubgrub::report::{DerivationTree, Derived, External, ReportFormatter}; use pubgrub::term::Term; use pubgrub::type_aliases::Map; -use puffin_normalize::PackageName; use rustc_hash::FxHashMap; +use uv_normalize::PackageName; use crate::candidate_selector::CandidateSelector; use crate::prerelease_mode::PreReleaseStrategy; diff --git a/crates/puffin-resolver/src/pubgrub/specifier.rs b/crates/uv-resolver/src/pubgrub/specifier.rs similarity index 100% rename from crates/puffin-resolver/src/pubgrub/specifier.rs rename to crates/uv-resolver/src/pubgrub/specifier.rs diff --git a/crates/puffin-resolver/src/python_requirement.rs b/crates/uv-resolver/src/python_requirement.rs similarity index 98% rename from crates/puffin-resolver/src/python_requirement.rs rename to crates/uv-resolver/src/python_requirement.rs index 5bc507bf8770..f6ab142c0f50 100644 --- a/crates/puffin-resolver/src/python_requirement.rs +++ b/crates/uv-resolver/src/python_requirement.rs @@ -1,7 +1,7 @@ use distribution_types::{CompatibleDist, Dist}; use pep440_rs::{Version, VersionSpecifiers}; use pep508_rs::MarkerEnvironment; -use puffin_interpreter::Interpreter; +use uv_interpreter::Interpreter; #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] pub struct PythonRequirement { diff --git a/crates/puffin-resolver/src/resolution.rs b/crates/uv-resolver/src/resolution.rs similarity index 99% rename from crates/puffin-resolver/src/resolution.rs rename to crates/uv-resolver/src/resolution.rs index 67c4d1a32c84..4d001d7477a1 100644 --- a/crates/puffin-resolver/src/resolution.rs +++ b/crates/uv-resolver/src/resolution.rs @@ -17,8 +17,8 @@ use distribution_types::{Dist, DistributionMetadata, LocalEditable, Name, Packag use once_map::OnceMap; use pep440_rs::Version; use pep508_rs::VerbatimUrl; -use puffin_normalize::{ExtraName, PackageName}; use pypi_types::{Hashes, Metadata21}; +use uv_normalize::{ExtraName, PackageName}; use crate::pins::FilePins; use crate::pubgrub::{PubGrubDistribution, PubGrubPackage, PubGrubPriority}; diff --git a/crates/puffin-resolver/src/resolution_mode.rs b/crates/uv-resolver/src/resolution_mode.rs similarity index 97% rename from crates/puffin-resolver/src/resolution_mode.rs rename to crates/uv-resolver/src/resolution_mode.rs index dc9f841eeb33..8ccf549f8340 100644 --- a/crates/puffin-resolver/src/resolution_mode.rs +++ b/crates/uv-resolver/src/resolution_mode.rs @@ -1,7 +1,7 @@ use rustc_hash::FxHashSet; use pep508_rs::Requirement; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] diff --git a/crates/puffin-resolver/src/resolver/allowed_urls.rs b/crates/uv-resolver/src/resolver/allowed_urls.rs similarity index 100% rename from crates/puffin-resolver/src/resolver/allowed_urls.rs rename to crates/uv-resolver/src/resolver/allowed_urls.rs diff --git a/crates/puffin-resolver/src/resolver/index.rs b/crates/uv-resolver/src/resolver/index.rs similarity index 96% rename from crates/puffin-resolver/src/resolver/index.rs rename to crates/uv-resolver/src/resolver/index.rs index aaab596516f7..1fbc0d3064db 100644 --- a/crates/puffin-resolver/src/resolver/index.rs +++ b/crates/uv-resolver/src/resolver/index.rs @@ -3,8 +3,8 @@ use url::Url; use distribution_types::PackageId; use once_map::OnceMap; -use puffin_normalize::PackageName; use pypi_types::Metadata21; +use uv_normalize::PackageName; use super::provider::VersionsResponse; diff --git a/crates/puffin-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs similarity index 99% rename from crates/puffin-resolver/src/resolver/mod.rs rename to crates/uv-resolver/src/resolver/mod.rs index d202b57e4dd6..260ea55a93c7 100644 --- a/crates/puffin-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -18,21 +18,6 @@ use tokio_stream::wrappers::ReceiverStream; use tracing::{debug, info_span, instrument, trace, warn, Instrument}; use url::Url; -use distribution_filename::WheelFilename; -use distribution_types::{ - BuiltDist, Dist, DistributionMetadata, IncompatibleWheel, LocalEditable, Name, RemoteSource, - SourceDist, VersionOrUrl, -}; -use pep440_rs::{Version, VersionSpecifiers, MIN_VERSION}; -use pep508_rs::{MarkerEnvironment, Requirement}; -use platform_tags::{IncompatibleTag, Tags}; -use puffin_client::{FlatIndex, RegistryClient}; -use puffin_distribution::DistributionDatabase; -use puffin_interpreter::Interpreter; -use puffin_normalize::PackageName; -use puffin_traits::BuildContext; -use pypi_types::{Metadata21, Yanked}; - use crate::candidate_selector::{CandidateDist, CandidateSelector}; use crate::error::ResolveError; use crate::manifest::Manifest; @@ -53,6 +38,20 @@ use crate::resolver::reporter::Facade; pub use crate::resolver::reporter::{BuildId, Reporter}; use crate::yanks::AllowedYanks; use crate::{DependencyMode, Options}; +use distribution_filename::WheelFilename; +use distribution_types::{ + BuiltDist, Dist, DistributionMetadata, IncompatibleWheel, LocalEditable, Name, RemoteSource, + SourceDist, VersionOrUrl, +}; +use pep440_rs::{Version, VersionSpecifiers, MIN_VERSION}; +use pep508_rs::{MarkerEnvironment, Requirement}; +use platform_tags::{IncompatibleTag, Tags}; +use pypi_types::{Metadata21, Yanked}; +use uv_client::{FlatIndex, RegistryClient}; +use uv_distribution::DistributionDatabase; +use uv_interpreter::Interpreter; +use uv_normalize::PackageName; +use uv_traits::BuildContext; mod allowed_urls; mod index; diff --git a/crates/puffin-resolver/src/resolver/provider.rs b/crates/uv-resolver/src/resolver/provider.rs similarity index 87% rename from crates/puffin-resolver/src/resolver/provider.rs rename to crates/uv-resolver/src/resolver/provider.rs index 0fa2c17eb150..9ecdb4a694f4 100644 --- a/crates/puffin-resolver/src/resolver/provider.rs +++ b/crates/uv-resolver/src/resolver/provider.rs @@ -8,17 +8,17 @@ use url::Url; use distribution_types::{Dist, IndexLocations}; use platform_tags::Tags; -use puffin_client::{FlatIndex, RegistryClient}; -use puffin_distribution::DistributionDatabase; -use puffin_normalize::PackageName; -use puffin_traits::{BuildContext, NoBinary}; use pypi_types::Metadata21; +use uv_client::{FlatIndex, RegistryClient}; +use uv_distribution::DistributionDatabase; +use uv_normalize::PackageName; +use uv_traits::{BuildContext, NoBinary}; use crate::python_requirement::PythonRequirement; use crate::version_map::VersionMap; -type PackageVersionsResult = Result; -type WheelMetadataResult = Result<(Metadata21, Option), puffin_distribution::Error>; +type PackageVersionsResult = Result; +type WheelMetadataResult = Result<(Metadata21, Option), uv_distribution::Error>; /// The response when requesting versions for a package #[derive(Debug)] @@ -52,9 +52,9 @@ pub trait ResolverProvider: Send + Sync { fn index_locations(&self) -> &IndexLocations; - /// Set the [`puffin_distribution::Reporter`] to use for this installer. + /// Set the [`uv_distribution::Reporter`] to use for this installer. #[must_use] - fn with_reporter(self, reporter: impl puffin_distribution::Reporter + 'static) -> Self; + fn with_reporter(self, reporter: impl uv_distribution::Reporter + 'static) -> Self; } /// The main IO backend for the resolver, which does cached requests network requests using the @@ -143,14 +143,14 @@ impl<'a, Context: BuildContext + Send + Sync> ResolverProvider .expect("Tokio executor failed, was there a panic?")) } Err(err) => match err.into_kind() { - puffin_client::ErrorKind::PackageNotFound(_) => { + uv_client::ErrorKind::PackageNotFound(_) => { if let Some(flat_index) = self.flat_index.get(package_name).cloned() { Ok(VersionsResponse::Found(VersionMap::from(flat_index))) } else { Ok(VersionsResponse::NotFound) } } - puffin_client::ErrorKind::NoIndex(_) => { + uv_client::ErrorKind::NoIndex(_) => { if let Some(flat_index) = self.flat_index.get(package_name).cloned() { Ok(VersionsResponse::Found(VersionMap::from(flat_index))) } else if self.flat_index.offline() { @@ -159,7 +159,7 @@ impl<'a, Context: BuildContext + Send + Sync> ResolverProvider Ok(VersionsResponse::NoIndex) } } - puffin_client::ErrorKind::Offline(_) => { + uv_client::ErrorKind::Offline(_) => { if let Some(flat_index) = self.flat_index.get(package_name).cloned() { Ok(VersionsResponse::Found(VersionMap::from(flat_index))) } else { @@ -179,9 +179,9 @@ impl<'a, Context: BuildContext + Send + Sync> ResolverProvider self.fetcher.index_locations() } - /// Set the [`puffin_distribution::Reporter`] to use for this installer. + /// Set the [`uv_distribution::Reporter`] to use for this installer. #[must_use] - fn with_reporter(self, reporter: impl puffin_distribution::Reporter + 'static) -> Self { + fn with_reporter(self, reporter: impl uv_distribution::Reporter + 'static) -> Self { Self { fetcher: self.fetcher.with_reporter(reporter), ..self diff --git a/crates/puffin-resolver/src/resolver/reporter.rs b/crates/uv-resolver/src/resolver/reporter.rs similarity index 89% rename from crates/puffin-resolver/src/resolver/reporter.rs rename to crates/uv-resolver/src/resolver/reporter.rs index 12b257196a97..cece31ea07c8 100644 --- a/crates/puffin-resolver/src/resolver/reporter.rs +++ b/crates/uv-resolver/src/resolver/reporter.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use url::Url; use distribution_types::{SourceDist, VersionOrUrl}; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; pub type BuildId = usize; @@ -27,12 +27,12 @@ pub trait Reporter: Send + Sync { fn on_checkout_complete(&self, url: &Url, rev: &str, index: usize); } -/// A facade for converting from [`Reporter`] to [`puffin_distribution::Reporter`]. +/// A facade for converting from [`Reporter`] to [`uv_distribution::Reporter`]. pub(crate) struct Facade { pub(crate) reporter: Arc, } -impl puffin_distribution::Reporter for Facade { +impl uv_distribution::Reporter for Facade { fn on_build_start(&self, dist: &SourceDist) -> usize { self.reporter.on_build_start(dist) } diff --git a/crates/puffin-resolver/src/version_map.rs b/crates/uv-resolver/src/version_map.rs similarity index 98% rename from crates/puffin-resolver/src/version_map.rs rename to crates/uv-resolver/src/version_map.rs index 1d2793c84188..813652d81789 100644 --- a/crates/puffin-resolver/src/version_map.rs +++ b/crates/uv-resolver/src/version_map.rs @@ -8,12 +8,12 @@ use distribution_filename::DistFilename; use distribution_types::{Dist, IncompatibleWheel, IndexUrl, PrioritizedDist, WheelCompatibility}; use pep440_rs::Version; use platform_tags::Tags; -use puffin_client::{FlatDistributions, OwnedArchive, SimpleMetadata, VersionFiles}; -use puffin_normalize::PackageName; -use puffin_traits::NoBinary; -use puffin_warnings::warn_user_once; use pypi_types::Hashes; use rkyv::{de::deserializers::SharedDeserializeMap, Deserialize}; +use uv_client::{FlatDistributions, OwnedArchive, SimpleMetadata, VersionFiles}; +use uv_normalize::PackageName; +use uv_traits::NoBinary; +use uv_warnings::warn_user_once; use crate::python_requirement::PythonRequirement; diff --git a/crates/puffin-resolver/src/yanks.rs b/crates/uv-resolver/src/yanks.rs similarity index 97% rename from crates/puffin-resolver/src/yanks.rs rename to crates/uv-resolver/src/yanks.rs index 4abb5ec0a397..26579be4c800 100644 --- a/crates/puffin-resolver/src/yanks.rs +++ b/crates/uv-resolver/src/yanks.rs @@ -2,7 +2,7 @@ use rustc_hash::{FxHashMap, FxHashSet}; use pep440_rs::Version; use pep508_rs::Requirement; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; /// A set of package versions that are permitted, even if they're marked as yanked by the /// relevant index. diff --git a/crates/puffin-resolver/tests/resolver.rs b/crates/uv-resolver/tests/resolver.rs similarity index 98% rename from crates/puffin-resolver/tests/resolver.rs rename to crates/uv-resolver/tests/resolver.rs index 7cf2bd7be65a..77e0fc73360b 100644 --- a/crates/puffin-resolver/tests/resolver.rs +++ b/crates/uv-resolver/tests/resolver.rs @@ -14,16 +14,14 @@ use distribution_types::{IndexLocations, Resolution, SourceDist}; use pep508_rs::{MarkerEnvironment, Requirement, StringVersion}; use platform_host::{Arch, Os, Platform}; use platform_tags::Tags; -use puffin_cache::Cache; -use puffin_client::{FlatIndex, RegistryClientBuilder}; -use puffin_interpreter::{Interpreter, Virtualenv}; -use puffin_resolver::{ +use uv_cache::Cache; +use uv_client::{FlatIndex, RegistryClientBuilder}; +use uv_interpreter::{Interpreter, Virtualenv}; +use uv_resolver::{ DisplayResolutionGraph, InMemoryIndex, Manifest, Options, OptionsBuilder, PreReleaseMode, ResolutionGraph, ResolutionMode, Resolver, }; -use puffin_traits::{ - BuildContext, BuildKind, NoBinary, NoBuild, SetupPyStrategy, SourceBuildTrait, -}; +use uv_traits::{BuildContext, BuildKind, NoBinary, NoBuild, SetupPyStrategy, SourceBuildTrait}; // Exclude any packages uploaded after this date. static EXCLUDE_NEWER: Lazy> = Lazy::new(|| { diff --git a/crates/puffin-traits/Cargo.toml b/crates/uv-traits/Cargo.toml similarity index 74% rename from crates/puffin-traits/Cargo.toml rename to crates/uv-traits/Cargo.toml index 5bc5595a0b72..7af63adc159c 100644 --- a/crates/puffin-traits/Cargo.toml +++ b/crates/uv-traits/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-traits" +name = "uv-traits" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } @@ -16,9 +16,9 @@ workspace = true distribution-types = { path = "../distribution-types" } once-map = { path = "../once-map" } pep508_rs = { path = "../pep508-rs" } -puffin-cache = { path = "../puffin-cache" } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-normalize = { path = "../puffin-normalize" } +uv-cache = { path = "../uv-cache" } +uv-interpreter = { path = "../uv-interpreter" } +uv-normalize = { path = "../uv-normalize" } anyhow = { workspace = true } tokio = { workspace = true, features = ["sync"] } diff --git a/crates/puffin-traits/src/lib.rs b/crates/uv-traits/src/lib.rs similarity index 92% rename from crates/puffin-traits/src/lib.rs rename to crates/uv-traits/src/lib.rs index b8f2e038127d..cad85e41663a 100644 --- a/crates/puffin-traits/src/lib.rs +++ b/crates/uv-traits/src/lib.rs @@ -10,9 +10,9 @@ use anyhow::Result; use distribution_types::{CachedDist, DistributionId, IndexLocations, Resolution, SourceDist}; use once_map::OnceMap; use pep508_rs::Requirement; -use puffin_cache::Cache; -use puffin_interpreter::{Interpreter, Virtualenv}; -use puffin_normalize::PackageName; +use uv_cache::Cache; +use uv_interpreter::{Interpreter, Virtualenv}; +use uv_normalize::PackageName; /// Avoid cyclic crate dependencies between resolver, installer and builder. /// @@ -29,27 +29,27 @@ use puffin_normalize::PackageName; /// /// ```text /// ┌────────────────┐ -/// │puffin │ +/// │uv │ /// └───────▲────────┘ /// │ /// │ /// ┌───────┴────────┐ -/// ┌─────────►│puffin-dispatch │◄─────────┐ +/// ┌─────────►│uv-dispatch │◄─────────┐ /// │ └───────▲────────┘ │ /// │ │ │ /// │ │ │ /// ┌───────┴────────┐ ┌───────┴────────┐ ┌────────┴───────┐ -/// │puffin-resolver │ │puffin-installer│ │puffin-build │ +/// │uv-resolver │ │uv-installer│ │uv-build │ /// └───────▲────────┘ └───────▲────────┘ └────────▲───────┘ /// │ │ │ /// └─────────────┐ │ ┌──────────────┘ /// ┌──┴────┴────┴───┐ -/// │puffin-traits │ +/// │uv-traits │ /// └────────────────┘ /// ``` /// -/// Put in a different way, this trait allows `puffin-resolver` to depend on `puffin-build` and -/// `puffin-build` to depend on `puffin-resolver` which having actual crate dependencies between +/// Put in a different way, this trait allows `uv-resolver` to depend on `uv-build` and +/// `uv-build` to depend on `uv-resolver` which having actual crate dependencies between /// them. // TODO(konstin): Proper error types @@ -94,7 +94,7 @@ pub trait BuildContext: Sync { ) -> impl Future> + Send + 'a; /// Setup a source distribution build by installing the required dependencies. A wrapper for - /// `puffin_build::SourceBuild::setup`. + /// `uv_build::SourceBuild::setup`. /// /// For PEP 517 builds, this calls `get_requires_for_build_wheel`. /// @@ -110,12 +110,12 @@ pub trait BuildContext: Sync { ) -> impl Future> + Send + 'a; } -/// A wrapper for `puffin_build::SourceBuild` to avoid cyclical crate dependencies. +/// A wrapper for `uv_build::SourceBuild` to avoid cyclical crate dependencies. /// /// You can either call only `wheel()` to build the wheel directly, call only `metadata()` to get /// the metadata without performing the actual or first call `metadata()` and then `wheel()`. pub trait SourceBuildTrait { - /// A wrapper for `puffin_build::SourceBuild::get_metadata_without_build`. + /// A wrapper for `uv_build::SourceBuild::get_metadata_without_build`. /// /// For PEP 517 builds, this calls `prepare_metadata_for_build_wheel` /// @@ -123,7 +123,7 @@ pub trait SourceBuildTrait { /// `prepare_metadata_for_build_wheel` hook exists fn metadata(&mut self) -> impl Future>> + Send; - /// A wrapper for `puffin_build::SourceBuild::build`. + /// A wrapper for `uv_build::SourceBuild::build`. /// /// For PEP 517 builds, this calls `build_wheel`. /// @@ -174,7 +174,7 @@ pub enum PackageNameSpecifier { } impl FromStr for PackageNameSpecifier { - type Err = puffin_normalize::InvalidNameError; + type Err = uv_normalize::InvalidNameError; fn from_str(name: &str) -> Result { match name { diff --git a/crates/puffin-trampoline/Cargo.lock b/crates/uv-trampoline/Cargo.lock similarity index 99% rename from crates/puffin-trampoline/Cargo.lock rename to crates/uv-trampoline/Cargo.lock index 10e890283656..bbff1a39c1df 100644 --- a/crates/puffin-trampoline/Cargo.lock +++ b/crates/uv-trampoline/Cargo.lock @@ -18,7 +18,7 @@ dependencies = [ ] [[package]] -name = "puffin-trampoline" +name = "uv-trampoline" version = "0.1.0" dependencies = [ "embed-manifest", diff --git a/crates/puffin-trampoline/Cargo.toml b/crates/uv-trampoline/Cargo.toml similarity index 98% rename from crates/puffin-trampoline/Cargo.toml rename to crates/uv-trampoline/Cargo.toml index 478e1fa3e1df..124ab6dc701c 100644 --- a/crates/puffin-trampoline/Cargo.toml +++ b/crates/uv-trampoline/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-trampoline" +name = "uv-trampoline" version = "0.1.0" authors = ["Nathaniel J. Smith "] license = "MIT OR Apache-2.0" diff --git a/crates/puffin-trampoline/README.md b/crates/uv-trampoline/README.md similarity index 100% rename from crates/puffin-trampoline/README.md rename to crates/uv-trampoline/README.md diff --git a/crates/puffin-trampoline/build.rs b/crates/uv-trampoline/build.rs similarity index 83% rename from crates/puffin-trampoline/build.rs rename to crates/uv-trampoline/build.rs index 115c8e8fa653..e89b972bf6b3 100644 --- a/crates/puffin-trampoline/build.rs +++ b/crates/uv-trampoline/build.rs @@ -6,8 +6,8 @@ use embed_manifest::{embed_manifest, new_manifest}; fn main() { if std::env::var_os("CARGO_CFG_WINDOWS").is_some() { - let manifest = new_manifest("Puffin.Trampoline") - .remove_dependency("Microsoft.Windows.Common-Controls"); + let manifest = + new_manifest("uv.Trampoline").remove_dependency("Microsoft.Windows.Common-Controls"); embed_manifest(manifest).expect("unable to embed manifest"); println!("cargo:rustc-link-arg=/ENTRY:entry"); println!("cargo:rustc-link-arg=/LTCG"); diff --git a/crates/puffin-trampoline/rust-toolchain.toml b/crates/uv-trampoline/rust-toolchain.toml similarity index 100% rename from crates/puffin-trampoline/rust-toolchain.toml rename to crates/uv-trampoline/rust-toolchain.toml diff --git a/crates/puffin-trampoline/src/bin/puffin-trampoline-console.rs b/crates/uv-trampoline/src/bin/uv-trampoline-console.rs similarity index 81% rename from crates/puffin-trampoline/src/bin/puffin-trampoline-console.rs rename to crates/uv-trampoline/src/bin/uv-trampoline-console.rs index d6b101cc08cc..315b4b9dadaf 100644 --- a/crates/puffin-trampoline/src/bin/puffin-trampoline-console.rs +++ b/crates/uv-trampoline/src/bin/uv-trampoline-console.rs @@ -5,5 +5,5 @@ // build.rs passes a custom linker flag to make this the entrypoint to the executable #[no_mangle] pub extern "C" fn entry() -> ! { - puffin_trampoline::bounce::bounce(false) + uv_trampoline::bounce::bounce(false) } diff --git a/crates/puffin-trampoline/src/bin/puffin-trampoline-gui.rs b/crates/uv-trampoline/src/bin/uv-trampoline-gui.rs similarity index 81% rename from crates/puffin-trampoline/src/bin/puffin-trampoline-gui.rs rename to crates/uv-trampoline/src/bin/uv-trampoline-gui.rs index c80af919b1ac..ad6d20989ef1 100644 --- a/crates/puffin-trampoline/src/bin/puffin-trampoline-gui.rs +++ b/crates/uv-trampoline/src/bin/uv-trampoline-gui.rs @@ -5,5 +5,5 @@ // build.rs passes a custom linker flag to make this the entrypoint to the executable #[no_mangle] pub extern "C" fn entry() -> ! { - puffin_trampoline::bounce::bounce(true) + uv_trampoline::bounce::bounce(true) } diff --git a/crates/puffin-trampoline/src/bounce.rs b/crates/uv-trampoline/src/bounce.rs similarity index 99% rename from crates/puffin-trampoline/src/bounce.rs rename to crates/uv-trampoline/src/bounce.rs index 25fe90943c37..18cf561cdf09 100644 --- a/crates/puffin-trampoline/src/bounce.rs +++ b/crates/uv-trampoline/src/bounce.rs @@ -218,7 +218,7 @@ fn clear_app_starting_state(child_handle: HANDLE) { let hwnd = CreateWindowExA( 0, c!("STATIC").as_ptr() as *const _, - c!("Puffin Python Trampoline").as_ptr() as *const _, + c!("uv Python Trampoline").as_ptr() as *const _, 0, 0, 0, diff --git a/crates/puffin-trampoline/src/diagnostics.rs b/crates/uv-trampoline/src/diagnostics.rs similarity index 100% rename from crates/puffin-trampoline/src/diagnostics.rs rename to crates/uv-trampoline/src/diagnostics.rs diff --git a/crates/puffin-trampoline/src/helpers.rs b/crates/uv-trampoline/src/helpers.rs similarity index 100% rename from crates/puffin-trampoline/src/helpers.rs rename to crates/uv-trampoline/src/helpers.rs diff --git a/crates/puffin-trampoline/src/lib.rs b/crates/uv-trampoline/src/lib.rs similarity index 100% rename from crates/puffin-trampoline/src/lib.rs rename to crates/uv-trampoline/src/lib.rs diff --git a/crates/puffin-trampoline/src/runtime.rs b/crates/uv-trampoline/src/runtime.rs similarity index 100% rename from crates/puffin-trampoline/src/runtime.rs rename to crates/uv-trampoline/src/runtime.rs diff --git a/crates/puffin-trampoline/trampolines/puffin-trampoline-aarch64-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe similarity index 100% rename from crates/puffin-trampoline/trampolines/puffin-trampoline-aarch64-console.exe rename to crates/uv-trampoline/trampolines/uv-trampoline-aarch64-console.exe diff --git a/crates/puffin-trampoline/trampolines/puffin-trampoline-aarch64-gui.exe b/crates/uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe similarity index 100% rename from crates/puffin-trampoline/trampolines/puffin-trampoline-aarch64-gui.exe rename to crates/uv-trampoline/trampolines/uv-trampoline-aarch64-gui.exe diff --git a/crates/puffin-trampoline/trampolines/puffin-trampoline-x86_64-console.exe b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe similarity index 100% rename from crates/puffin-trampoline/trampolines/puffin-trampoline-x86_64-console.exe rename to crates/uv-trampoline/trampolines/uv-trampoline-x86_64-console.exe diff --git a/crates/puffin-trampoline/trampolines/puffin-trampoline-x86_64-gui.exe b/crates/uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe similarity index 100% rename from crates/puffin-trampoline/trampolines/puffin-trampoline-x86_64-gui.exe rename to crates/uv-trampoline/trampolines/uv-trampoline-x86_64-gui.exe diff --git a/crates/puffin-warnings/Cargo.toml b/crates/uv-warnings/Cargo.toml similarity index 94% rename from crates/puffin-warnings/Cargo.toml rename to crates/uv-warnings/Cargo.toml index 0d84af01dcdd..ddf7864b878a 100644 --- a/crates/puffin-warnings/Cargo.toml +++ b/crates/uv-warnings/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin-warnings" +name = "uv-warnings" version = "0.0.1" edition = { workspace = true } rust-version = { workspace = true } diff --git a/crates/puffin-warnings/src/lib.rs b/crates/uv-warnings/src/lib.rs similarity index 100% rename from crates/puffin-warnings/src/lib.rs rename to crates/uv-warnings/src/lib.rs diff --git a/crates/puffin/Cargo.toml b/crates/uv/Cargo.toml similarity index 80% rename from crates/puffin/Cargo.toml rename to crates/uv/Cargo.toml index 352b9b2e5f01..14f48ac84fce 100644 --- a/crates/puffin/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "puffin" +name = "uv" version = "0.0.4" edition = { workspace = true } rust-version = { workspace = true } @@ -8,7 +8,7 @@ documentation = { workspace = true } repository = { workspace = true } authors = { workspace = true } license = { workspace = true } -default-run = "puffin" +default-run = "uv" [lints] workspace = true @@ -22,18 +22,18 @@ pep440_rs = { path = "../pep440-rs" } pep508_rs = { path = "../pep508-rs" } platform-host = { path = "../platform-host" } platform-tags = { path = "../platform-tags" } -puffin-build = { path = "../puffin-build" } -puffin-cache = { path = "../puffin-cache", features = ["clap"] } -puffin-client = { path = "../puffin-client" } -puffin-dispatch = { path = "../puffin-dispatch" } -puffin-distribution = { path = "../puffin-distribution" } -puffin-fs = { path = "../puffin-fs" } -puffin-installer = { path = "../puffin-installer" } -puffin-interpreter = { path = "../puffin-interpreter" } -puffin-normalize = { path = "../puffin-normalize" } -puffin-resolver = { path = "../puffin-resolver", features = ["clap"] } -puffin-traits = { path = "../puffin-traits" } -puffin-warnings = { path = "../puffin-warnings" } +uv-build = { path = "../uv-build" } +uv-cache = { path = "../uv-cache", features = ["clap"] } +uv-client = { path = "../uv-client" } +uv-dispatch = { path = "../uv-dispatch" } +uv-distribution = { path = "../uv-distribution" } +uv-fs = { path = "../uv-fs" } +uv-installer = { path = "../uv-installer" } +uv-interpreter = { path = "../uv-interpreter" } +uv-normalize = { path = "../uv-normalize" } +uv-resolver = { path = "../uv-resolver", features = ["clap"] } +uv-traits = { path = "../uv-traits" } +uv-warnings = { path = "../uv-warnings" } pypi-types = { path = "../pypi-types" } requirements-txt = { path = "../requirements-txt" } diff --git a/crates/puffin/src/commands/clean.rs b/crates/uv/src/commands/clean.rs similarity index 98% rename from crates/puffin/src/commands/clean.rs rename to crates/uv/src/commands/clean.rs index 5fac89c742a7..a598fbbbb40a 100644 --- a/crates/puffin/src/commands/clean.rs +++ b/crates/uv/src/commands/clean.rs @@ -3,9 +3,9 @@ use std::fmt::Write; use anyhow::{Context, Result}; use owo_colors::OwoColorize; -use puffin_cache::Cache; -use puffin_fs::Normalized; -use puffin_normalize::PackageName; +use uv_cache::Cache; +use uv_fs::Normalized; +use uv_normalize::PackageName; use crate::commands::ExitStatus; use crate::printer::Printer; diff --git a/crates/puffin/src/commands/freeze.rs b/crates/uv/src/commands/freeze.rs similarity index 91% rename from crates/puffin/src/commands/freeze.rs rename to crates/uv/src/commands/freeze.rs index 725f9a47083c..0899ea247fd4 100644 --- a/crates/puffin/src/commands/freeze.rs +++ b/crates/uv/src/commands/freeze.rs @@ -8,10 +8,10 @@ use tracing::debug; use distribution_types::Name; use platform_host::Platform; -use puffin_cache::Cache; -use puffin_fs::Normalized; -use puffin_installer::SitePackages; -use puffin_interpreter::Virtualenv; +use uv_cache::Cache; +use uv_fs::Normalized; +use uv_installer::SitePackages; +use uv_interpreter::Virtualenv; use crate::commands::ExitStatus; use crate::printer::Printer; diff --git a/crates/puffin/src/commands/mod.rs b/crates/uv/src/commands/mod.rs similarity index 100% rename from crates/puffin/src/commands/mod.rs rename to crates/uv/src/commands/mod.rs diff --git a/crates/puffin/src/commands/pip_compile.rs b/crates/uv/src/commands/pip_compile.rs similarity index 95% rename from crates/puffin/src/commands/pip_compile.rs rename to crates/uv/src/commands/pip_compile.rs index 972216b0043e..28f9a76fe9d9 100644 --- a/crates/puffin/src/commands/pip_compile.rs +++ b/crates/uv/src/commands/pip_compile.rs @@ -19,20 +19,20 @@ use distribution_types::{IndexLocations, LocalEditable}; use pep508_rs::Requirement; use platform_host::Platform; use platform_tags::Tags; -use puffin_cache::Cache; -use puffin_client::{Connectivity, FlatIndex, FlatIndexClient, RegistryClientBuilder}; -use puffin_dispatch::BuildDispatch; -use puffin_fs::Normalized; -use puffin_installer::{Downloader, NoBinary}; -use puffin_interpreter::{Interpreter, PythonVersion}; -use puffin_normalize::{ExtraName, PackageName}; -use puffin_resolver::{ +use requirements_txt::EditableRequirement; +use uv_cache::Cache; +use uv_client::{Connectivity, FlatIndex, FlatIndexClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_fs::Normalized; +use uv_installer::{Downloader, NoBinary}; +use uv_interpreter::{Interpreter, PythonVersion}; +use uv_normalize::{ExtraName, PackageName}; +use uv_resolver::{ DependencyMode, DisplayResolutionGraph, InMemoryIndex, Manifest, OptionsBuilder, PreReleaseMode, ResolutionMode, Resolver, }; -use puffin_traits::{InFlight, NoBuild, SetupPyStrategy}; -use puffin_warnings::warn_user; -use requirements_txt::EditableRequirement; +use uv_traits::{InFlight, NoBuild, SetupPyStrategy}; +use uv_warnings::warn_user; use crate::commands::reporters::{DownloadReporter, ResolverReporter}; use crate::commands::{elapsed, ExitStatus}; @@ -301,7 +301,7 @@ pub(crate) async fn pip_compile( .with_reporter(ResolverReporter::from(printer)); let resolution = match resolver.resolve().await { - Err(puffin_resolver::ResolveError::NoSolution(err)) => { + Err(uv_resolver::ResolveError::NoSolution(err)) => { let report = miette::Report::msg(format!("{err}")) .context("No solution found when resolving dependencies:"); eprint!("{report:?}"); @@ -346,16 +346,14 @@ pub(crate) async fn pip_compile( writeln!( writer, "{}", - format!( - "# This file was autogenerated by Puffin v{VERSION} via the following command:" - ) - .green() + format!("# This file was autogenerated by uv v{VERSION} via the following command:") + .green() )?; writeln!( writer, "{}", format!( - "# puffin {}", + "# uv {}", env::args_os() .skip(1) .map(|arg| arg.normalized_display().to_string()) diff --git a/crates/puffin/src/commands/pip_install.rs b/crates/uv/src/commands/pip_install.rs similarity index 96% rename from crates/puffin/src/commands/pip_install.rs rename to crates/uv/src/commands/pip_install.rs index 0d1dd3cf9ebb..aa2a06ad07fd 100644 --- a/crates/puffin/src/commands/pip_install.rs +++ b/crates/uv/src/commands/pip_install.rs @@ -16,24 +16,22 @@ use install_wheel_rs::linker::LinkMode; use pep508_rs::{MarkerEnvironment, Requirement}; use platform_host::Platform; use platform_tags::Tags; -use puffin_cache::Cache; -use puffin_client::{ - Connectivity, FlatIndex, FlatIndexClient, RegistryClient, RegistryClientBuilder, -}; -use puffin_dispatch::BuildDispatch; -use puffin_fs::Normalized; -use puffin_installer::{ +use pypi_types::Yanked; +use requirements_txt::EditableRequirement; +use uv_cache::Cache; +use uv_client::{Connectivity, FlatIndex, FlatIndexClient, RegistryClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_fs::Normalized; +use uv_installer::{ BuiltEditable, Downloader, NoBinary, Plan, Planner, Reinstall, ResolvedEditable, SitePackages, }; -use puffin_interpreter::{Interpreter, Virtualenv}; -use puffin_normalize::PackageName; -use puffin_resolver::{ +use uv_interpreter::{Interpreter, Virtualenv}; +use uv_normalize::PackageName; +use uv_resolver::{ DependencyMode, InMemoryIndex, Manifest, Options, OptionsBuilder, PreReleaseMode, ResolutionGraph, ResolutionMode, Resolver, }; -use puffin_traits::{InFlight, NoBuild, SetupPyStrategy}; -use pypi_types::Yanked; -use requirements_txt::EditableRequirement; +use uv_traits::{InFlight, NoBuild, SetupPyStrategy}; use crate::commands::reporters::{DownloadReporter, InstallReporter, ResolverReporter}; use crate::commands::{elapsed, ChangeEvent, ChangeEventKind, ExitStatus}; @@ -221,7 +219,7 @@ pub(crate) async fn pip_install( .await { Ok(resolution) => Resolution::from(resolution), - Err(Error::Resolve(puffin_resolver::ResolveError::NoSolution(err))) => { + Err(Error::Resolve(uv_resolver::ResolveError::NoSolution(err))) => { let report = miette::Report::msg(format!("{err}")) .context("No solution found when resolving dependencies:"); eprint!("{report:?}"); @@ -586,7 +584,7 @@ async fn install( // Remove any existing installations. if !reinstalls.is_empty() { for dist_info in &reinstalls { - let summary = puffin_installer::uninstall(dist_info).await?; + let summary = uv_installer::uninstall(dist_info).await?; debug!( "Uninstalled {} ({} file{}, {} director{})", dist_info.name(), @@ -602,7 +600,7 @@ async fn install( let wheels = wheels.into_iter().chain(local).collect::>(); if !wheels.is_empty() { let start = std::time::Instant::now(); - puffin_installer::Installer::new(venv) + uv_installer::Installer::new(venv) .with_link_mode(link_mode) .with_reporter(InstallReporter::from(printer).with_length(wheels.len() as u64)) .install(&wheels)?; @@ -687,10 +685,10 @@ fn validate(resolution: &Resolution, venv: &Virtualenv, mut printer: Printer) -> #[derive(thiserror::Error, Debug)] enum Error { #[error(transparent)] - Resolve(#[from] puffin_resolver::ResolveError), + Resolve(#[from] uv_resolver::ResolveError), #[error(transparent)] - Client(#[from] puffin_client::Error), + Client(#[from] uv_client::Error), #[error(transparent)] Platform(#[from] platform_host::PlatformError), diff --git a/crates/puffin/src/commands/pip_sync.rs b/crates/uv/src/commands/pip_sync.rs similarity index 95% rename from crates/puffin/src/commands/pip_sync.rs rename to crates/uv/src/commands/pip_sync.rs index d0187f0308d0..ed6272fdc4b1 100644 --- a/crates/puffin/src/commands/pip_sync.rs +++ b/crates/uv/src/commands/pip_sync.rs @@ -9,20 +9,18 @@ use distribution_types::{IndexLocations, InstalledMetadata, LocalDist, LocalEdit use install_wheel_rs::linker::LinkMode; use platform_host::Platform; use platform_tags::Tags; -use puffin_cache::Cache; -use puffin_client::{ - Connectivity, FlatIndex, FlatIndexClient, RegistryClient, RegistryClientBuilder, -}; -use puffin_dispatch::BuildDispatch; -use puffin_fs::Normalized; -use puffin_installer::{ - Downloader, NoBinary, Plan, Planner, Reinstall, ResolvedEditable, SitePackages, -}; -use puffin_interpreter::Virtualenv; -use puffin_resolver::InMemoryIndex; -use puffin_traits::{InFlight, NoBuild, SetupPyStrategy}; use pypi_types::Yanked; use requirements_txt::EditableRequirement; +use uv_cache::Cache; +use uv_client::{Connectivity, FlatIndex, FlatIndexClient, RegistryClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_fs::Normalized; +use uv_installer::{ + Downloader, NoBinary, Plan, Planner, Reinstall, ResolvedEditable, SitePackages, +}; +use uv_interpreter::Virtualenv; +use uv_resolver::InMemoryIndex; +use uv_traits::{InFlight, NoBuild, SetupPyStrategy}; use crate::commands::reporters::{DownloadReporter, FinderReporter, InstallReporter}; use crate::commands::{elapsed, ChangeEvent, ChangeEventKind, ExitStatus}; @@ -179,14 +177,9 @@ pub(crate) async fn pip_sync( } else { let start = std::time::Instant::now(); - let wheel_finder = puffin_resolver::DistFinder::new( - tags, - &client, - venv.interpreter(), - &flat_index, - no_binary, - ) - .with_reporter(FinderReporter::from(printer).with_length(remote.len() as u64)); + let wheel_finder = + uv_resolver::DistFinder::new(tags, &client, venv.interpreter(), &flat_index, no_binary) + .with_reporter(FinderReporter::from(printer).with_length(remote.len() as u64)); let resolution = wheel_finder.resolve(&remote).await?; let s = if resolution.len() == 1 { "" } else { "s" }; @@ -265,7 +258,7 @@ pub(crate) async fn pip_sync( let start = std::time::Instant::now(); for dist_info in extraneous.iter().chain(reinstalls.iter()) { - let summary = puffin_installer::uninstall(dist_info).await?; + let summary = uv_installer::uninstall(dist_info).await?; debug!( "Uninstalled {} ({} file{}, {} director{})", dist_info.name(), @@ -297,7 +290,7 @@ pub(crate) async fn pip_sync( let wheels = wheels.into_iter().chain(local).collect::>(); if !wheels.is_empty() { let start = std::time::Instant::now(); - puffin_installer::Installer::new(&venv) + uv_installer::Installer::new(&venv) .with_link_mode(link_mode) .with_reporter(InstallReporter::from(printer).with_length(wheels.len() as u64)) .install(&wheels)?; diff --git a/crates/puffin/src/commands/pip_uninstall.rs b/crates/uv/src/commands/pip_uninstall.rs similarity index 95% rename from crates/puffin/src/commands/pip_uninstall.rs rename to crates/uv/src/commands/pip_uninstall.rs index 477b6508ae70..dd296683b8f3 100644 --- a/crates/puffin/src/commands/pip_uninstall.rs +++ b/crates/uv/src/commands/pip_uninstall.rs @@ -6,9 +6,9 @@ use tracing::debug; use distribution_types::{InstalledMetadata, Name}; use platform_host::Platform; -use puffin_cache::Cache; -use puffin_fs::Normalized; -use puffin_interpreter::Virtualenv; +use uv_cache::Cache; +use uv_fs::Normalized; +use uv_interpreter::Virtualenv; use crate::commands::{elapsed, ExitStatus}; use crate::printer::Printer; @@ -48,7 +48,7 @@ pub(crate) async fn pip_uninstall( let _lock = venv.lock()?; // Index the current `site-packages` directory. - let site_packages = puffin_installer::SitePackages::from_executable(&venv)?; + let site_packages = uv_installer::SitePackages::from_executable(&venv)?; // Sort and deduplicate the packages, which are keyed by name. let packages = { @@ -124,7 +124,7 @@ pub(crate) async fn pip_uninstall( // Uninstall each package. for distribution in &distributions { - let summary = puffin_installer::uninstall(distribution).await?; + let summary = uv_installer::uninstall(distribution).await?; debug!( "Uninstalled {} ({} file{}, {} director{})", distribution.name(), diff --git a/crates/puffin/src/commands/reporters.rs b/crates/uv/src/commands/reporters.rs similarity index 97% rename from crates/puffin/src/commands/reporters.rs rename to crates/uv/src/commands/reporters.rs index 69ad97fda0d5..f6b027830b88 100644 --- a/crates/puffin/src/commands/reporters.rs +++ b/crates/uv/src/commands/reporters.rs @@ -8,7 +8,7 @@ use url::Url; use distribution_types::{ CachedDist, Dist, DistributionMetadata, LocalEditable, Name, SourceDist, VersionOrUrl, }; -use puffin_normalize::PackageName; +use uv_normalize::PackageName; use crate::printer::Printer; @@ -36,7 +36,7 @@ impl FinderReporter { } } -impl puffin_resolver::FinderReporter for FinderReporter { +impl uv_resolver::FinderReporter for FinderReporter { fn on_progress(&self, dist: &Dist) { self.progress.set_message(format!("{dist}")); self.progress.inc(1); @@ -104,7 +104,7 @@ impl DownloadReporter { } } -impl puffin_installer::DownloadReporter for DownloadReporter { +impl uv_installer::DownloadReporter for DownloadReporter { fn on_progress(&self, dist: &CachedDist) { self.progress.set_message(format!("{dist}")); self.progress.inc(1); @@ -186,7 +186,7 @@ impl InstallReporter { } } -impl puffin_installer::InstallReporter for InstallReporter { +impl uv_installer::InstallReporter for InstallReporter { fn on_install_progress(&self, wheel: &CachedDist) { self.progress.set_message(format!("{wheel}")); self.progress.inc(1); @@ -227,7 +227,7 @@ impl From for ResolverReporter { } } -impl puffin_resolver::ResolverReporter for ResolverReporter { +impl uv_resolver::ResolverReporter for ResolverReporter { fn on_progress(&self, name: &PackageName, version_or_url: VersionOrUrl) { match version_or_url { VersionOrUrl::Version(version) => { diff --git a/crates/puffin/src/commands/venv.rs b/crates/uv/src/commands/venv.rs similarity index 88% rename from crates/puffin/src/commands/venv.rs rename to crates/uv/src/commands/venv.rs index de22a560cc78..d6d164d548f3 100644 --- a/crates/puffin/src/commands/venv.rs +++ b/crates/uv/src/commands/venv.rs @@ -12,14 +12,14 @@ use thiserror::Error; use distribution_types::{DistributionMetadata, IndexLocations, Name}; use pep508_rs::Requirement; use platform_host::Platform; -use puffin_cache::Cache; -use puffin_client::{Connectivity, FlatIndex, FlatIndexClient, RegistryClientBuilder}; -use puffin_dispatch::BuildDispatch; -use puffin_fs::Normalized; -use puffin_installer::NoBinary; -use puffin_interpreter::{find_default_python, find_requested_python, Error}; -use puffin_resolver::{InMemoryIndex, OptionsBuilder}; -use puffin_traits::{BuildContext, InFlight, NoBuild, SetupPyStrategy}; +use uv_cache::Cache; +use uv_client::{Connectivity, FlatIndex, FlatIndexClient, RegistryClientBuilder}; +use uv_dispatch::BuildDispatch; +use uv_fs::Normalized; +use uv_installer::NoBinary; +use uv_interpreter::{find_default_python, find_requested_python, Error}; +use uv_resolver::{InMemoryIndex, OptionsBuilder}; +use uv_traits::{BuildContext, InFlight, NoBuild, SetupPyStrategy}; use crate::commands::ExitStatus; use crate::printer::Printer; @@ -59,20 +59,20 @@ pub(crate) async fn venv( #[derive(Error, Debug, Diagnostic)] enum VenvError { #[error("Failed to create virtualenv")] - #[diagnostic(code(puffin::venv::creation))] + #[diagnostic(code(uv::venv::creation))] Creation(#[source] gourgeist::Error), #[error("Failed to install seed packages")] - #[diagnostic(code(puffin::venv::seed))] + #[diagnostic(code(uv::venv::seed))] Seed(#[source] anyhow::Error), #[error("Failed to extract interpreter tags")] - #[diagnostic(code(puffin::venv::tags))] + #[diagnostic(code(uv::venv::tags))] Tags(#[source] platform_tags::TagsError), #[error("Failed to resolve `--find-links` entry")] - #[diagnostic(code(puffin::venv::flat_index))] - FlatIndex(#[source] puffin_client::FlatIndexError), + #[diagnostic(code(uv::venv::flat_index))] + FlatIndex(#[source] uv_client::FlatIndexError), } /// Create a virtual environment. diff --git a/crates/puffin/src/compat/mod.rs b/crates/uv/src/compat/mod.rs similarity index 75% rename from crates/puffin/src/compat/mod.rs rename to crates/uv/src/compat/mod.rs index 60ace94dcd57..e91086be1ac1 100644 --- a/crates/puffin/src/compat/mod.rs +++ b/crates/uv/src/compat/mod.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Result}; use clap::{Args, ValueEnum}; -use puffin_warnings::warn_user; +use uv_warnings::warn_user; pub(crate) trait CompatArgs { fn validate(&self) -> Result<()>; @@ -9,8 +9,8 @@ pub(crate) trait CompatArgs { /// Arguments for `pip-compile` compatibility. /// -/// These represent a subset of the `pip-compile` interface that Puffin supports by default. -/// For example, users often pass `--allow-unsafe`, which is unnecessary with Puffin. But it's a +/// These represent a subset of the `pip-compile` interface that uv supports by default. +/// For example, users often pass `--allow-unsafe`, which is unnecessary with uv. But it's a /// nice user experience to warn, rather than fail, when users pass `--allow-unsafe`. #[derive(Args)] #[allow(clippy::struct_excessive_bools)] @@ -91,39 +91,41 @@ pub(crate) struct PipCompileCompatArgs { impl CompatArgs for PipCompileCompatArgs { /// Validate the arguments passed for `pip-compile` compatibility. /// - /// This method will warn when an argument is passed that has no effect but matches Puffin's - /// behavior. If an argument is passed that does _not_ match Puffin's behavior (e.g., + /// This method will warn when an argument is passed that has no effect but matches uv's + /// behavior. If an argument is passed that does _not_ match uv's behavior (e.g., /// `--no-build-isolation`), this method will return an error. fn validate(&self) -> Result<()> { if self.allow_unsafe { warn_user!( - "pip-compile's `--allow-unsafe` has no effect (Puffin can safely pin `pip` and other packages)." + "pip-compile's `--allow-unsafe` has no effect (uv can safely pin `pip` and other packages)." ); } if self.no_allow_unsafe { - warn_user!("pip-compile's `--no-allow-unsafe` has no effect (Puffin can safely pin `pip` and other packages)."); + warn_user!("pip-compile's `--no-allow-unsafe` has no effect (uv can safely pin `pip` and other packages)."); } if self.reuse_hashes { return Err(anyhow!( - "pip-compile's `--reuse-hashes` is unsupported (Puffin doesn't reuse hashes)." + "pip-compile's `--reuse-hashes` is unsupported (uv doesn't reuse hashes)." )); } if self.no_reuse_hashes { warn_user!( - "pip-compile's `--no-reuse-hashes` has no effect (Puffin doesn't reuse hashes)." + "pip-compile's `--no-reuse-hashes` has no effect (uv doesn't reuse hashes)." ); } if self.build_isolation { - warn_user!("pip-compile's `--build-isolation` has no effect (Puffin always uses build isolation)."); + warn_user!( + "pip-compile's `--build-isolation` has no effect (uv always uses build isolation)." + ); } if self.no_build_isolation { return Err(anyhow!( - "pip-compile's `--no-build-isolation` is unsupported (Puffin always uses build isolation)." + "pip-compile's `--no-build-isolation` is unsupported (uv always uses build isolation)." )); } @@ -131,12 +133,12 @@ impl CompatArgs for PipCompileCompatArgs { match resolver { Resolver::Backtracking => { warn_user!( - "pip-compile's `--resolver=backtracking` has no effect (Puffin always backtracks)." + "pip-compile's `--resolver=backtracking` has no effect (uv always backtracks)." ); } Resolver::Legacy => { return Err(anyhow!( - "pip-compile's `--resolver=legacy` is unsupported (Puffin always backtracks)." + "pip-compile's `--resolver=legacy` is unsupported (uv always backtracks)." )); } } @@ -146,12 +148,12 @@ impl CompatArgs for PipCompileCompatArgs { match annotation_style { AnnotationStyle::Split => { warn_user!( - "pip-compile's `--annotation-style=split` has no effect (Puffin always emits split annotations)." + "pip-compile's `--annotation-style=split` has no effect (uv always emits split annotations)." ); } AnnotationStyle::Line => { return Err(anyhow!( - "pip-compile's `--annotation-style=line` is unsupported (Puffin always emits split annotations)." + "pip-compile's `--annotation-style=line` is unsupported (uv always emits split annotations)." )); } } @@ -159,31 +161,31 @@ impl CompatArgs for PipCompileCompatArgs { if self.max_rounds.is_some() { return Err(anyhow!( - "pip-compile's `--max-rounds` is unsupported (Puffin always resolves until convergence)." + "pip-compile's `--max-rounds` is unsupported (uv always resolves until convergence)." )); } if self.client_cert.is_some() { return Err(anyhow!( - "pip-compile's `--client-cert` is unsupported (Puffin doesn't support dedicated client certificates)." + "pip-compile's `--client-cert` is unsupported (uv doesn't support dedicated client certificates)." )); } if self.trusted_host.is_some() { return Err(anyhow!( - "pip-compile's `--trusted-host` is unsupported (Puffin always requires HTTPS)." + "pip-compile's `--trusted-host` is unsupported (uv always requires HTTPS)." )); } if self.emit_trusted_host { return Err(anyhow!( - "pip-compile's `--emit-trusted-host` is unsupported (Puffin always requires HTTPS)." + "pip-compile's `--emit-trusted-host` is unsupported (uv always requires HTTPS)." )); } if self.no_emit_trusted_host { warn_user!( - "pip-compile's `--no-emit-trusted-host` has no effect (Puffin never emits trusted hosts)." + "pip-compile's `--no-emit-trusted-host` has no effect (uv never emits trusted hosts)." ); } @@ -195,55 +197,51 @@ impl CompatArgs for PipCompileCompatArgs { if self.config.is_some() { return Err(anyhow!( - "pip-compile's `--config` is unsupported (Puffin does not use a configuration file)." + "pip-compile's `--config` is unsupported (uv does not use a configuration file)." )); } if self.no_config { warn_user!( - "pip-compile's `--no-config` has no effect (Puffin does not use a configuration file)." + "pip-compile's `--no-config` has no effect (uv does not use a configuration file)." ); } if self.no_emit_index_url { warn_user!( - "pip-compile's `--no-emit-index-url` has no effect (Puffin excludes index URLs by default)." + "pip-compile's `--no-emit-index-url` has no effect (uv excludes index URLs by default)." ); } if self.no_emit_find_links { warn_user!( - "pip-compile's `--no-emit-find-links` has no effect (Puffin excludes `--find-links` URLs by default)." + "pip-compile's `--no-emit-find-links` has no effect (uv excludes `--find-links` URLs by default)." ); } if self.emit_options { return Err(anyhow!( - "pip-compile's `--emit-options` is unsupported (Puffin never emits options)." + "pip-compile's `--emit-options` is unsupported (uv never emits options)." )); } if self.no_emit_options { - warn_user!( - "pip-compile's `--no-emit-options` has no effect (Puffin never emits options)." - ); + warn_user!("pip-compile's `--no-emit-options` has no effect (uv never emits options)."); } if self.strip_extras { - warn_user!( - "pip-compile's `--strip-extras` has no effect (Puffin always strips extras)." - ); + warn_user!("pip-compile's `--strip-extras` has no effect (uv always strips extras)."); } if self.no_strip_extras { return Err(anyhow!( - "pip-compile's `--no-strip-extras` is unsupported (Puffin always strips extras)." + "pip-compile's `--no-strip-extras` is unsupported (uv always strips extras)." )); } if self.pip_args.is_some() { return Err(anyhow!( - "pip-compile's `--pip-args` is unsupported (try passing arguments to Puffin directly)." + "pip-compile's `--pip-args` is unsupported (try passing arguments to uv directly)." )); } @@ -253,7 +251,7 @@ impl CompatArgs for PipCompileCompatArgs { /// Arguments for `pip-sync` compatibility. /// -/// These represent a subset of the `pip-sync` interface that Puffin supports by default. +/// These represent a subset of the `pip-sync` interface that uv supports by default. #[derive(Args)] #[allow(clippy::struct_excessive_bools)] pub(crate) struct PipSyncCompatArgs { @@ -288,13 +286,13 @@ pub(crate) struct PipSyncCompatArgs { impl CompatArgs for PipSyncCompatArgs { /// Validate the arguments passed for `pip-sync` compatibility. /// - /// This method will warn when an argument is passed that has no effect but matches Puffin's - /// behavior. If an argument is passed that does _not_ match Puffin's behavior, this method will + /// This method will warn when an argument is passed that has no effect but matches uv's + /// behavior. If an argument is passed that does _not_ match uv's behavior, this method will /// return an error. fn validate(&self) -> Result<()> { if self.ask { return Err(anyhow!( - "pip-sync's `--ask` is unsupported (Puffin never asks for confirmation)." + "pip-sync's `--ask` is unsupported (uv never asks for confirmation)." )); } @@ -310,31 +308,31 @@ impl CompatArgs for PipSyncCompatArgs { if self.client_cert.is_some() { return Err(anyhow!( - "pip-sync's `--client-cert` is unsupported (Puffin doesn't support dedicated client certificates)." + "pip-sync's `--client-cert` is unsupported (uv doesn't support dedicated client certificates)." )); } if self.trusted_host.is_some() { return Err(anyhow!( - "pip-sync's `--trusted-host` is unsupported (Puffin always requires HTTPS)." + "pip-sync's `--trusted-host` is unsupported (uv always requires HTTPS)." )); } if self.config.is_some() { return Err(anyhow!( - "pip-sync's `--config` is unsupported (Puffin does not use a configuration file)." + "pip-sync's `--config` is unsupported (uv does not use a configuration file)." )); } if self.no_config { warn_user!( - "pip-sync's `--no-config` has no effect (Puffin does not use a configuration file)." + "pip-sync's `--no-config` has no effect (uv does not use a configuration file)." ); } if self.pip_args.is_some() { return Err(anyhow!( - "pip-sync's `--pip-args` is unsupported (try passing arguments to Puffin directly)." + "pip-sync's `--pip-args` is unsupported (try passing arguments to uv directly)." )); } @@ -356,7 +354,7 @@ enum AnnotationStyle { /// Arguments for `venv` compatibility. /// -/// These represent a subset of the `virtualenv` interface that Puffin supports by default. +/// These represent a subset of the `virtualenv` interface that uv supports by default. #[derive(Args)] #[allow(clippy::struct_excessive_bools)] pub(crate) struct VenvCompatArgs { @@ -379,36 +377,34 @@ pub(crate) struct VenvCompatArgs { impl CompatArgs for VenvCompatArgs { /// Validate the arguments passed for `venv` compatibility. /// - /// This method will warn when an argument is passed that has no effect but matches Puffin's - /// behavior. If an argument is passed that does _not_ match Puffin's behavior, this method will + /// This method will warn when an argument is passed that has no effect but matches uv's + /// behavior. If an argument is passed that does _not_ match uv's behavior, this method will /// return an error. fn validate(&self) -> Result<()> { if self.clear { warn_user!( - "virtualenv's `--clear` has no effect (Puffin always clears the virtual environment)." + "virtualenv's `--clear` has no effect (uv always clears the virtual environment)." ); } if self.no_seed { warn_user!( - "virtualenv's `--no-seed` has no effect (Puffin omits seed packages by default)." + "virtualenv's `--no-seed` has no effect (uv omits seed packages by default)." ); } if self.no_pip { - warn_user!("virtualenv's `--no-pip` has no effect (Puffin omits `pip` by default)."); + warn_user!("virtualenv's `--no-pip` has no effect (uv omits `pip` by default)."); } if self.no_setuptools { warn_user!( - "virtualenv's `--no-setuptools` has no effect (Puffin omits `setuptools` by default)." + "virtualenv's `--no-setuptools` has no effect (uv omits `setuptools` by default)." ); } if self.no_wheel { - warn_user!( - "virtualenv's `--no-wheel` has no effect (Puffin omits `wheel` by default)." - ); + warn_user!("virtualenv's `--no-wheel` has no effect (uv omits `wheel` by default)."); } Ok(()) diff --git a/crates/puffin/src/confirm.rs b/crates/uv/src/confirm.rs similarity index 100% rename from crates/puffin/src/confirm.rs rename to crates/uv/src/confirm.rs diff --git a/crates/puffin/src/logging.rs b/crates/uv/src/logging.rs similarity index 96% rename from crates/puffin/src/logging.rs rename to crates/uv/src/logging.rs index ceaabed52e33..6c8316610bb6 100644 --- a/crates/puffin/src/logging.rs +++ b/crates/uv/src/logging.rs @@ -23,7 +23,7 @@ pub(crate) enum Level { /// /// The [`Level`] is used to dictate the default filters (which can be overridden by the `RUST_LOG` /// environment variable) along with the formatting of the output. For example, [`Level::Verbose`] -/// includes targets and timestamps, along with all `puffin=debug` messages by default. +/// includes targets and timestamps, along with all `uv=debug` messages by default. pub(crate) fn setup_logging(level: Level, duration: impl Layer + Send + Sync) { match level { Level::Default => { @@ -47,7 +47,7 @@ pub(crate) fn setup_logging(level: Level, duration: impl Layer + Send Level::Verbose => { // Show `DEBUG` messages from the CLI crate, but allow `RUST_LOG` to override. let filter = EnvFilter::try_from_default_env() - .or_else(|_| EnvFilter::try_new("puffin=debug")) + .or_else(|_| EnvFilter::try_new("uv=debug")) .unwrap(); // Regardless of the tracing level, include the uptime and target for each message. diff --git a/crates/puffin/src/main.rs b/crates/uv/src/main.rs similarity index 97% rename from crates/puffin/src/main.rs rename to crates/uv/src/main.rs index 42858d2ad35c..f0d91635d02b 100644 --- a/crates/puffin/src/main.rs +++ b/crates/uv/src/main.rs @@ -12,14 +12,14 @@ use owo_colors::OwoColorize; use tracing::instrument; use distribution_types::{FlatIndexLocation, IndexLocations, IndexUrl}; -use puffin_cache::{Cache, CacheArgs, Refresh}; -use puffin_client::Connectivity; -use puffin_installer::{NoBinary, Reinstall}; -use puffin_interpreter::PythonVersion; -use puffin_normalize::{ExtraName, PackageName}; -use puffin_resolver::{DependencyMode, PreReleaseMode, ResolutionMode}; -use puffin_traits::{NoBuild, PackageNameSpecifier, SetupPyStrategy}; use requirements::ExtrasSpecification; +use uv_cache::{Cache, CacheArgs, Refresh}; +use uv_client::Connectivity; +use uv_installer::{NoBinary, Reinstall}; +use uv_interpreter::PythonVersion; +use uv_normalize::{ExtraName, PackageName}; +use uv_resolver::{DependencyMode, PreReleaseMode, ResolutionMode}; +use uv_traits::{NoBuild, PackageNameSpecifier, SetupPyStrategy}; use crate::commands::{extra_name_with_clap_error, ExitStatus, Upgrade}; use crate::compat::CompatArgs; @@ -696,31 +696,31 @@ async fn run() -> Result { "compile" | "lock" => { err.insert( ContextKind::SuggestedSubcommand, - ContextValue::String("puffin pip compile".to_string()), + ContextValue::String("uv pip compile".to_string()), ); } "sync" => { err.insert( ContextKind::SuggestedSubcommand, - ContextValue::String("puffin pip sync".to_string()), + ContextValue::String("uv pip sync".to_string()), ); } "install" | "add" => { err.insert( ContextKind::SuggestedSubcommand, - ContextValue::String("puffin pip install".to_string()), + ContextValue::String("uv pip install".to_string()), ); } "uninstall" | "remove" => { err.insert( ContextKind::SuggestedSubcommand, - ContextValue::String("puffin pip uninstall".to_string()), + ContextValue::String("uv pip uninstall".to_string()), ); } "freeze" => { err.insert( ContextKind::SuggestedSubcommand, - ContextValue::String("puffin pip freeze".to_string()), + ContextValue::String("uv pip freeze".to_string()), ); } _ => {} @@ -755,7 +755,7 @@ async fn run() -> Result { // Configure the `warn!` macros, which control user-facing warnings in the CLI. if !cli.quiet { - puffin_warnings::enable(); + uv_warnings::enable(); } if cli.no_color { diff --git a/crates/puffin/src/printer.rs b/crates/uv/src/printer.rs similarity index 100% rename from crates/puffin/src/printer.rs rename to crates/uv/src/printer.rs diff --git a/crates/puffin/src/requirements.rs b/crates/uv/src/requirements.rs similarity index 97% rename from crates/puffin/src/requirements.rs rename to crates/uv/src/requirements.rs index 315d0abf3ca1..d0c0d46759f1 100644 --- a/crates/puffin/src/requirements.rs +++ b/crates/uv/src/requirements.rs @@ -8,9 +8,9 @@ use rustc_hash::FxHashSet; use distribution_types::{FlatIndexLocation, IndexUrl}; use pep508_rs::Requirement; -use puffin_fs::Normalized; -use puffin_normalize::{ExtraName, PackageName}; use requirements_txt::{EditableRequirement, FindLink, RequirementsTxt}; +use uv_fs::Normalized; +use uv_normalize::{ExtraName, PackageName}; use crate::confirm; @@ -42,7 +42,7 @@ impl RequirementsSource { /// directory, prompt them to correct it (if the terminal is interactive). pub(crate) fn from_package(name: String) -> Self { // If the user provided a `requirements.txt` file without `-r` (as in - // `puffin pip install requirements.txt`), prompt them to correct it. + // `uv pip install requirements.txt`), prompt them to correct it. #[allow(clippy::case_sensitive_file_extension_comparisons)] if name.ends_with(".txt") || name.ends_with(".in") { if Path::new(&name).is_file() { @@ -60,7 +60,7 @@ impl RequirementsSource { } // If the user provided a path to a local directory without `-e` (as in - // `puffin pip install ../flask`), prompt them to correct it. + // `uv pip install ../flask`), prompt them to correct it. if name.contains('/') || name.contains('\\') { if Path::new(&name).is_dir() { let term = Term::stderr(); @@ -192,7 +192,7 @@ impl RequirementsSpecification { } } RequirementsSource::PyprojectToml(path) => { - let contents = puffin_fs::read_to_string(path)?; + let contents = uv_fs::read_to_string(path)?; let pyproject_toml = toml::from_str::(&contents) .with_context(|| format!("Failed to parse `{}`", path.normalized_display()))?; let mut used_extras = FxHashSet::default(); diff --git a/crates/puffin/tests/common/mod.rs b/crates/uv/tests/common/mod.rs similarity index 95% rename from crates/puffin/tests/common/mod.rs rename to crates/uv/tests/common/mod.rs index d7640cdbec2b..658fa389bb0b 100644 --- a/crates/puffin/tests/common/mod.rs +++ b/crates/uv/tests/common/mod.rs @@ -15,10 +15,10 @@ use fs_err::os::unix::fs::symlink as symlink_file; #[cfg(windows)] use fs_err::os::windows::fs::symlink_file; use platform_host::Platform; -use puffin_cache::Cache; use regex::Regex; +use uv_cache::Cache; -use puffin_interpreter::find_requested_python; +use uv_interpreter::find_requested_python; // Exclude any packages uploaded after this date. pub static EXCLUDE_NEWER: &str = "2023-11-18T12:00:00Z"; @@ -27,13 +27,13 @@ pub const INSTA_FILTERS: &[(&str, &str)] = &[ (r"--cache-dir [^\s]+", "--cache-dir [CACHE_DIR]"), // Operation times (r"(\d+m )?(\d+\.)?\d+(ms|s)", "[TIME]"), - // Puffin versions + // uv versions (r"v\d+\.\d+\.\d+", "v[VERSION]"), // File sizes (r"(\d+\.)?\d+([KM]i)?B", "[SIZE]"), // Rewrite Windows output to Unix output (r"\\([\w\d])", "/$1"), - (r"puffin.exe", "puffin"), + (r"uv.exe", "uv"), // The exact message is host language dependent ( r"Caused by: .* \(os error 2\)", @@ -109,7 +109,7 @@ pub fn venv_to_interpreter(venv: &Path) -> PathBuf { /// /// Python versions are sorted from newest to oldest. pub fn bootstrapped_pythons() -> Option> { - // Current dir is `/crates/puffin`. + // Current dir is `/crates/uv`. let bootstrapped_pythons = std::env::current_dir() .unwrap() .parent() @@ -179,11 +179,11 @@ pub fn create_venv( venv.to_path_buf() } -/// Returns the puffin binary that cargo built before launching the tests. +/// Returns the uv binary that cargo built before launching the tests. /// /// pub fn get_bin() -> PathBuf { - PathBuf::from(env!("CARGO_BIN_EXE_puffin")) + PathBuf::from(env!("CARGO_BIN_EXE_uv")) } /// Create a directory with the requested Python binaries available. @@ -211,7 +211,7 @@ pub fn create_bin_with_executables( &Platform::current().unwrap(), &Cache::temp().unwrap(), )? - .ok_or(puffin_interpreter::Error::NoSuchPython(request.to_string()))?; + .ok_or(uv_interpreter::Error::NoSuchPython(request.to_string()))?; let name = interpreter .sys_executable() .file_name() @@ -288,9 +288,9 @@ pub fn run_and_format<'a>( /// By default, the filters will search for the generally windows-only deps colorama and tzdata, /// filter them out and decrease the package counts by one for each match. #[allow(unused_macros)] -macro_rules! puffin_snapshot { +macro_rules! uv_snapshot { ($spawnable:expr, @$snapshot:literal) => {{ - puffin_snapshot!($crate::common::INSTA_FILTERS.to_vec(), $spawnable, @$snapshot) + uv_snapshot!($crate::common::INSTA_FILTERS.to_vec(), $spawnable, @$snapshot) }}; ($filters:expr, $spawnable:expr, @$snapshot:literal) => {{ // Take a reference for backwards compatibility with the vec-expecting insta filters. @@ -308,4 +308,4 @@ macro_rules! puffin_snapshot { /// #[allow(unused_imports)] -pub(crate) use puffin_snapshot; +pub(crate) use uv_snapshot; diff --git a/crates/puffin/tests/pip_compile.rs b/crates/uv/tests/pip_compile.rs similarity index 85% rename from crates/puffin/tests/pip_compile.rs rename to crates/uv/tests/pip_compile.rs index dee0559cb9ab..5871ba6afc32 100644 --- a/crates/puffin/tests/pip_compile.rs +++ b/crates/uv/tests/pip_compile.rs @@ -12,8 +12,8 @@ use insta::assert_snapshot; use itertools::Itertools; use url::Url; -use common::{puffin_snapshot, TestContext, INSTA_FILTERS}; -use puffin_fs::Normalized; +use common::{uv_snapshot, TestContext, INSTA_FILTERS}; +use uv_fs::Normalized; use crate::common::{get_bin, EXCLUDE_NEWER}; @@ -26,14 +26,14 @@ fn compile_requirements_in() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("django==5.0b1")?; - puffin_snapshot!(context + uv_snapshot!(context .compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in asgiref==3.7.2 # via django django==5.0b1 @@ -55,15 +55,15 @@ fn compile_requirements_in_stdin() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("django==5.0b1")?; - puffin_snapshot!(context + uv_snapshot!(context .compile() .stdin(fs::File::open(requirements_in)?) .arg("-"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z - + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z - asgiref==3.7.2 # via django django==5.0b1 @@ -82,7 +82,7 @@ fn missing_requirements_in() { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -103,7 +103,7 @@ fn missing_venv() -> Result<()> { let cache_dir = TempDir::new()?; let venv = temp_dir.child(".venv"); - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("compile") .arg("requirements.in") @@ -143,13 +143,13 @@ dependencies = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml asgiref==3.7.2 # via django django==5.0b1 @@ -174,15 +174,15 @@ fn compile_constraints_txt() -> Result<()> { let constraints_txt = context.temp_dir.child("constraints.txt"); constraints_txt.write_str("sqlparse<0.4.4")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--constraint") .arg("constraints.txt"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt asgiref==3.7.2 # via django django==5.0b1 @@ -208,13 +208,13 @@ fn compile_constraints_inline() -> Result<()> { let constraints_txt = context.temp_dir.child("constraints.txt"); constraints_txt.write_str("sqlparse<0.4.4")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in ----- stderr ----- Resolved 0 packages in [TIME] @@ -238,15 +238,15 @@ fn compile_constraints_markers() -> Result<()> { constraints_txt.write_str("sniffio==1.2.0;python_version<='3.7'")?; constraints_txt.write_str("sniffio==1.3.0;python_version>'3.7'")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--constraint") .arg("constraints.txt"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt anyio==4.0.0 idna==3.4 # via anyio @@ -279,15 +279,15 @@ optional-dependencies.foo = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--extra") .arg("foo"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml --extra foo + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml --extra foo asgiref==3.7.2 # via django django==5.0b1 @@ -320,15 +320,15 @@ optional-dependencies."FrIeNdLy-._.-bArD" = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--extra") .arg("FRiENDlY-...-_-BARd"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml --extra FRiENDlY-...-_-BARd + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml --extra FRiENDlY-...-_-BARd asgiref==3.7.2 # via django django==5.0b1 @@ -361,7 +361,7 @@ optional-dependencies.foo = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--extra") .arg("bar"), @r###" @@ -395,7 +395,7 @@ optional-dependencies.foo = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--extra") .arg("foo") @@ -422,7 +422,7 @@ fn compile_requirements_file_extra() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("django==5.0b1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--all-extras"), @r###" @@ -456,7 +456,7 @@ optional-dependencies.foo = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--extra") .arg("invalid name!"), @r###" @@ -481,15 +481,15 @@ fn compile_python_312() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--python-version") .arg("3.12"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --python-version 3.12 + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --python-version 3.12 black==23.10.1 click==8.1.7 # via black @@ -517,7 +517,7 @@ fn compile_python_312_no_deps() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--no-deps") .arg("--python-version") @@ -525,8 +525,8 @@ fn compile_python_312_no_deps() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-deps --python-version 3.12 + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-deps --python-version 3.12 black==23.10.1 ----- stderr ----- @@ -555,7 +555,7 @@ fn compile_python_37() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in") .arg("--python-version") .arg("3.7"), @r###" @@ -582,7 +582,7 @@ fn compile_python_invalid_version() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--python-version") .arg("3.7.x"), @r###" @@ -607,7 +607,7 @@ fn compile_python_dev_version() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--python-version") .arg("3.7-dev"), @r###" @@ -626,7 +626,7 @@ fn compile_python_dev_version() -> Result<()> { } /// Test that we select the last 3.8 compatible numpy version instead of trying to compile an -/// incompatible sdist +/// incompatible sdist #[test] fn compile_numpy_py38() -> Result<()> { let context = TestContext::new("3.8"); @@ -634,14 +634,14 @@ fn compile_numpy_py38() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("numpy")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--no-build"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-build + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-build numpy==1.24.4 ----- stderr ----- @@ -659,13 +659,13 @@ fn compile_wheel_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ https://files.pythonhosted.org/packages/36/42/015c23096649b908c809c69388a805a571a3bea44362fe87e33fc3afa01f/flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -699,13 +699,13 @@ fn compile_sdist_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ https://files.pythonhosted.org/packages/d8/09/c1a7354d3925a3c6c8cfdebf4245bae67d633ffda1ba415add06ffc839c5/flask-3.0.0.tar.gz")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -744,13 +744,13 @@ fn compile_git_https_dependency() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -782,13 +782,13 @@ fn compile_git_branch_https_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ git+https://github.com/pallets/flask.git@1.0.x")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in click==8.1.7 # via flask flask @ git+https://github.com/pallets/flask.git@d92b64aa275841b0c9aea3903aba72fbc4275d91 @@ -819,13 +819,13 @@ fn compile_git_tag_https_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ git+https://github.com/pallets/flask.git@3.0.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -860,13 +860,13 @@ fn compile_git_long_commit_https_dependency() -> Result<()> { "flask @ git+https://github.com/pallets/flask.git@d92b64aa275841b0c9aea3903aba72fbc4275d91", )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in click==8.1.7 # via flask flask @ git+https://github.com/pallets/flask.git@d92b64aa275841b0c9aea3903aba72fbc4275d91 @@ -897,13 +897,13 @@ fn compile_git_short_commit_https_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ git+https://github.com/pallets/flask.git@d92b64a")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in click==8.1.7 # via flask flask @ git+https://github.com/pallets/flask.git@d92b64aa275841b0c9aea3903aba72fbc4275d91 @@ -935,13 +935,13 @@ fn compile_git_refs_https_dependency() -> Result<()> { requirements_in .write_str("flask @ git+https://github.com/pallets/flask.git@refs/pull/5313/head")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -974,13 +974,13 @@ fn compile_git_subdirectory_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("example-pkg-a @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_a")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in example-pkg-a @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_a ----- stderr ----- @@ -1000,13 +1000,13 @@ fn compile_git_concurrent_access() -> Result<()> { requirements_in .write_str("example-pkg-a @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_a\nexample-pkg-b @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_b")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in example-pkg-a @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_a example-pkg-b @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_b @@ -1027,7 +1027,7 @@ fn compile_git_mismatched_name() -> Result<()> { requirements_in .write_str("flask @ git+https://github.com/pallets/flask.git@2.0.0\ndask @ git+https://github.com/pallets/flask.git@3.0.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -1050,13 +1050,13 @@ fn mixed_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask==3.0.0\nwerkzeug @ https://files.pythonhosted.org/packages/c3/fc/254c3e9b5feb89ff5b9076a23218dafbc99c96ac5941e900b71206e6313b/werkzeug-3.0.1-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1089,7 +1089,7 @@ fn conflicting_direct_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("werkzeug==3.0.0\nwerkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 1 @@ -1114,13 +1114,13 @@ fn compatible_direct_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("werkzeug==2.0.0\nwerkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in werkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl ----- stderr ----- @@ -1138,7 +1138,7 @@ fn conflicting_repeated_url_dependency_version_mismatch() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("werkzeug @ https://files.pythonhosted.org/packages/bd/24/11c3ea5a7e866bf2d97f0501d0b4b1c9bbeade102bb4b588f0d2919a5212/Werkzeug-2.0.1-py3-none-any.whl\nwerkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 1 @@ -1165,7 +1165,7 @@ fn conflicting_repeated_url_dependency_version_match() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@2.0.0\nwerkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 1 @@ -1190,7 +1190,7 @@ fn conflicting_transitive_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask==3.0.0\nwerkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 1 @@ -1217,7 +1217,7 @@ fn disallowed_transitive_url_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("transitive_url_dependency @ https://github.com/astral-sh/ruff/files/14078476/transitive_url_dependency.zip")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -1243,15 +1243,15 @@ fn allowed_transitive_url_dependency() -> Result<()> { let constraints_txt = context.temp_dir.child("constraints.txt"); constraints_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug@2.0.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--constraint") .arg("constraints.txt"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt transitive-url-dependency @ https://github.com/astral-sh/ruff/files/14078476/transitive_url_dependency.zip werkzeug @ git+https://github.com/pallets/werkzeug@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74 # via transitive-url-dependency @@ -1277,15 +1277,15 @@ fn allowed_transitive_canonical_url_dependency() -> Result<()> { let constraints_txt = context.temp_dir.child("constraints.txt"); constraints_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@2.0.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--constraint") .arg("constraints.txt"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --constraint constraints.txt transitive-url-dependency @ https://github.com/astral-sh/ruff/files/14078476/transitive_url_dependency.zip werkzeug @ git+https://github.com/pallets/werkzeug@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74 # via transitive-url-dependency @@ -1319,14 +1319,14 @@ optional-dependencies.bar = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--all-extras"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml --all-extras + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z pyproject.toml --all-extras anyio==4.0.0 # via httpcore asgiref==3.7.2 @@ -1375,7 +1375,7 @@ optional-dependencies.bar = [ "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml") .arg("--all-extras") .arg("--extra") @@ -1388,7 +1388,7 @@ optional-dependencies.bar = [ ----- stderr ----- error: the argument '--all-extras' cannot be used with '--extra ' - Usage: puffin pip compile --cache-dir [CACHE_DIR] --all-extras ... + Usage: uv pip compile --cache-dir [CACHE_DIR] --all-extras ... For more information, try '--help'. "### @@ -1412,7 +1412,7 @@ dependencies = ["django==5.0b1", "django==5.0a1"] "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml"), @r###" success: false exit_code: 1 @@ -1444,7 +1444,7 @@ dependencies = ["django==300.1.4"] "#, )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pyproject.toml"), @r###" success: false exit_code: 1 @@ -1468,7 +1468,7 @@ fn compile_exclude_newer() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("tqdm")?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("compile") .arg("requirements.in") @@ -1483,8 +1483,8 @@ fn compile_exclude_newer() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --exclude-newer 2022-04-04T12:00:00Z --cache-dir [CACHE_DIR] + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --exclude-newer 2022-04-04T12:00:00Z --cache-dir [CACHE_DIR] tqdm==4.64.0 ----- stderr ----- @@ -1494,7 +1494,7 @@ fn compile_exclude_newer() -> Result<()> { // Use a date as input instead. // We interpret a date as including this day - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("compile") .arg("requirements.in") @@ -1507,8 +1507,8 @@ fn compile_exclude_newer() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --exclude-newer 2022-04-04 --cache-dir [CACHE_DIR] + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --exclude-newer 2022-04-04 --cache-dir [CACHE_DIR] tqdm==4.64.0 ----- stderr ----- @@ -1517,7 +1517,7 @@ fn compile_exclude_newer() -> Result<()> { ); // Check the error message for invalid datetime - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("compile") .arg("requirements.in") @@ -1563,13 +1563,13 @@ fn compile_wheel_path_dependency() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1594,13 +1594,13 @@ fn compile_wheel_path_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ file:flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1626,13 +1626,13 @@ fn compile_wheel_path_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ file://flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1658,13 +1658,13 @@ fn compile_wheel_path_dependency() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ ./flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1711,13 +1711,13 @@ fn compile_source_distribution_path_dependency() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1754,7 +1754,7 @@ fn compile_wheel_path_dependency_missing() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -1774,13 +1774,13 @@ fn compile_yanked_version_direct() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("attrs==21.1.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in attrs==21.1.0 ----- stderr ----- @@ -1798,7 +1798,7 @@ fn compile_yanked_version_indirect() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("attrs>20.3.0,<21.2.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 1 @@ -1832,15 +1832,15 @@ fn override_dependency() -> Result<()> { let overrides_txt = context.temp_dir.child("overrides.txt"); overrides_txt.write_str("werkzeug==2.3.0")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--override") .arg("overrides.txt"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --override overrides.txt + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --override overrides.txt blinker==1.7.0 # via flask click==8.1.7 @@ -1878,15 +1878,15 @@ fn override_multi_dependency() -> Result<()> { "tomli>=1.1.0; python_version >= '3.11'\ntomli<1.0.0; python_version < '3.11'", )?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--override") .arg("overrides.txt"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --override overrides.txt + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --override overrides.txt black==23.10.1 click==8.1.7 # via black @@ -1916,13 +1916,13 @@ fn missing_registry_extra() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black[tensorboard]==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in black==23.10.1 click==8.1.7 # via black @@ -1951,13 +1951,13 @@ fn missing_url_extra() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask[tensorboard] @ https://files.pythonhosted.org/packages/36/42/015c23096649b908c809c69388a805a571a3bea44362fe87e33fc3afa01f/flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -1991,13 +1991,13 @@ fn preserve_url() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ https://files.PYTHONHOSTED.org/packages/36/42/015c23096649b908c809c69388a805a571a3bea44362fe87e33fc3afa01f/flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -2036,13 +2036,13 @@ fn preserve_env_var() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flask @ file://${PROJECT_ROOT}/flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in blinker==1.7.0 # via flask click==8.1.7 @@ -2086,7 +2086,7 @@ fn compile_editable() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("compile") .arg(requirements_in.path()) @@ -2098,8 +2098,8 @@ fn compile_editable() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z -e ${PROJECT_ROOT}/../../scripts/editable-installs/maturin_editable -e ../../scripts/editable-installs/poetry_editable -e file://../../scripts/editable-installs/black_editable @@ -2169,7 +2169,7 @@ fn cache_errors_are_non_fatal() -> Result<()> { ]; let check = || { - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("pip") .arg("compile") .arg(requirements_in.path()) @@ -2231,7 +2231,7 @@ fn compile_html() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("jinja2<=3.1.2")?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("compile") .arg("requirements.in") @@ -2244,8 +2244,8 @@ fn compile_html() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --cache-dir [CACHE_DIR] --index-url https://download.pytorch.org/whl + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --cache-dir [CACHE_DIR] --index-url https://download.pytorch.org/whl jinja2==3.1.2 markupsafe==2.1.3 # via jinja2 @@ -2265,15 +2265,15 @@ fn trailing_slash() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("jinja2")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--index-url") .arg("https://test.pypi.org/simple"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --index-url https://test.pypi.org/simple + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --index-url https://test.pypi.org/simple jinja2==3.1.2 markupsafe==2.1.3 # via jinja2 @@ -2283,15 +2283,15 @@ fn trailing_slash() -> Result<()> { "### ); - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--index-url") .arg("https://test.pypi.org/simple/"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --index-url https://test.pypi.org/simple/ + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --index-url https://test.pypi.org/simple/ jinja2==3.1.2 markupsafe==2.1.3 # via jinja2 @@ -2311,13 +2311,13 @@ fn compile_legacy_sdist_pep_517() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flake8 @ https://files.pythonhosted.org/packages/66/53/3ad4a3b74d609b3b9008a10075c40e7c8909eae60af53623c3888f7a529a/flake8-6.0.0.tar.gz")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in flake8 @ https://files.pythonhosted.org/packages/66/53/3ad4a3b74d609b3b9008a10075c40e7c8909eae60af53623c3888f7a529a/flake8-6.0.0.tar.gz mccabe==0.7.0 # via flake8 @@ -2341,14 +2341,14 @@ fn compile_legacy_sdist_setuptools() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flake8 @ https://files.pythonhosted.org/packages/66/53/3ad4a3b74d609b3b9008a10075c40e7c8909eae60af53623c3888f7a529a/flake8-6.0.0.tar.gz")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--legacy-setup-py"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --legacy-setup-py + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --legacy-setup-py flake8 @ https://files.pythonhosted.org/packages/66/53/3ad4a3b74d609b3b9008a10075c40e7c8909eae60af53623c3888f7a529a/flake8-6.0.0.tar.gz mccabe==0.7.0 # via flake8 @@ -2391,14 +2391,14 @@ fn generate_hashes() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in") .arg("--generate-hashes"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --generate-hashes + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --generate-hashes blinker==1.7.0 \ --hash=sha256:c3f865d4d54db7abc53758a01601cf343fe55b84c1de4e3fa910e420b438d5b9 \ --hash=sha256:e6820ff6fa4e4d1d8e2747c2283749c3f547e4fee112b98555cdcdae32996182 @@ -2520,15 +2520,15 @@ fn find_links_directory() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in") .arg("--find-links") .arg(project_root.join("scripts").join("wheels")), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --find-links [PROJECT_ROOT]/scripts/wheels + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --find-links [PROJECT_ROOT]/scripts/wheels markupsafe==2.1.3 # via werkzeug numpy==1.26.2 @@ -2549,7 +2549,7 @@ fn find_links_url() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("tqdm")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--no-index") .arg("--find-links") @@ -2557,8 +2557,8 @@ fn find_links_url() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-index --find-links https://download.pytorch.org/whl/torch_stable.html + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-index --find-links https://download.pytorch.org/whl/torch_stable.html tqdm==4.64.1 ----- stderr ----- @@ -2577,15 +2577,15 @@ fn find_links_requirements_txt() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("-f https://download.pytorch.org/whl/torch_stable.html\ntqdm")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--no-index") .arg("--emit-find-links"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-index --emit-find-links + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-index --emit-find-links --find-links https://download.pytorch.org/whl/torch_stable.html tqdm==4.64.1 @@ -2630,7 +2630,7 @@ fn upgrade_none() -> Result<()> { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in") .arg("--output-file") .arg("requirements.txt"), @r###" @@ -2677,8 +2677,8 @@ fn upgrade_all() -> Result<()> { let requirements_txt = context.temp_dir.child("requirements.txt"); requirements_txt.write_str(indoc! {r" - # This file was autogenerated by Puffin v0.0.1 via the following command: - # puffin pip compile requirements.in --python-version 3.12 --cache-dir [CACHE_DIR] + # This file was autogenerated by uv v0.0.1 via the following command: + # uv pip compile requirements.in --python-version 3.12 --cache-dir [CACHE_DIR] black==23.10.1 click==8.1.2 # via black @@ -2701,7 +2701,7 @@ fn upgrade_all() -> Result<()> { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in") .arg("--output-file") .arg("requirements.txt") @@ -2767,8 +2767,8 @@ fn upgrade_package() -> Result<()> { let requirements_txt = context.temp_dir.child("requirements.txt"); requirements_txt.write_str(indoc! {r" - # This file was autogenerated by Puffin v0.0.1 via the following command: - # puffin pip compile requirements.in --python-version 3.12 --cache-dir [CACHE_DIR] + # This file was autogenerated by uv v0.0.1 via the following command: + # uv pip compile requirements.in --python-version 3.12 --cache-dir [CACHE_DIR] black==23.10.1 click==8.1.2 # via black @@ -2791,7 +2791,7 @@ fn upgrade_package() -> Result<()> { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in") .arg("--output-file") .arg("requirements.txt") @@ -2847,7 +2847,7 @@ fn missing_path_requirement() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -2877,7 +2877,7 @@ fn missing_editable_requirement() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect::>(); - puffin_snapshot!(filters, context.compile() + uv_snapshot!(filters, context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -2899,7 +2899,7 @@ fn missing_package_name() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("https://files.pythonhosted.org/packages/36/42/015c23096649b908c809c69388a805a571a3bea44362fe87e33fc3afa01f/flask-3.0.0-py3-none-any.whl")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 2 @@ -2923,14 +2923,14 @@ fn no_annotate() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--no-annotate"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-annotate + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --no-annotate black==23.10.1 click==8.1.7 mypy-extensions==1.0.0 @@ -2953,7 +2953,7 @@ fn no_header() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--no-header"), @r###" success: true @@ -2986,20 +2986,20 @@ fn allow_unsafe() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("werkzeug==3.0.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--allow-unsafe"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --allow-unsafe + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --allow-unsafe markupsafe==2.1.3 # via werkzeug werkzeug==3.0.1 ----- stderr ----- - warning: pip-compile's `--allow-unsafe` has no effect (Puffin can safely pin `pip` and other packages). + warning: pip-compile's `--allow-unsafe` has no effect (uv can safely pin `pip` and other packages). Resolved 2 packages in [TIME] "### ); @@ -3014,7 +3014,7 @@ fn resolver_legacy() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("werkzeug==3.0.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--resolver=legacy"), @r###" success: false @@ -3022,7 +3022,7 @@ fn resolver_legacy() -> Result<()> { ----- stdout ----- ----- stderr ----- - error: pip-compile's `--resolver=legacy` is unsupported (Puffin always backtracks). + error: pip-compile's `--resolver=legacy` is unsupported (uv always backtracks). "### ); @@ -3036,7 +3036,7 @@ fn emit_index_urls() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--emit-index-url") .arg("--extra-index-url") @@ -3044,8 +3044,8 @@ fn emit_index_urls() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --emit-index-url --extra-index-url https://test.pypi.org/simple/ + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --emit-index-url --extra-index-url https://test.pypi.org/simple/ --index-url https://pypi.org/simple --extra-index-url https://test.pypi.org/simple/ @@ -3076,7 +3076,7 @@ fn emit_find_links() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("black==23.10.1")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--emit-find-links") .arg("--find-links") @@ -3084,8 +3084,8 @@ fn emit_find_links() -> Result<()> { success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --emit-find-links --find-links ./ + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --emit-find-links --find-links ./ --find-links ./ black==23.10.1 @@ -3115,7 +3115,7 @@ fn no_index_requirements_txt() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("--no-index\ntqdm")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: false exit_code: 1 @@ -3143,15 +3143,15 @@ fn index_url_requirements_txt() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("--index-url https://google.com\ntqdm")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--index-url") .arg("https://pypi.org/simple"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --index-url https://pypi.org/simple + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --index-url https://pypi.org/simple tqdm==4.66.1 ----- stderr ----- @@ -3172,7 +3172,7 @@ fn conflicting_index_urls_requirements_txt() -> Result<()> { let constraints_in = context.temp_dir.child("constraints.in"); constraints_in.write_str("--index-url https://wikipedia.org\nflask")?; - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--constraint") .arg("constraints.in"), @r###" @@ -3196,7 +3196,7 @@ fn offline() -> Result<()> { requirements_in.write_str("black==23.10.1")?; // Resolve with `--offline` with an empty cache. - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--offline"), @r###" success: false @@ -3213,13 +3213,13 @@ fn offline() -> Result<()> { ); // Populate the cache. - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in black==23.10.1 click==8.1.7 # via black @@ -3238,14 +3238,14 @@ fn offline() -> Result<()> { ); // Resolve with `--offline` with a populated cache. - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--offline"), @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --offline + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile --cache-dir [CACHE_DIR] --exclude-newer 2023-11-18T12:00:00Z requirements.in --offline black==23.10.1 click==8.1.7 # via black @@ -3277,7 +3277,7 @@ fn offline_find_links() -> Result<()> { // Resolve with `--offline` and `--find-links`. We indicate that the network was disabled, // since both the `--find-links` and the registry lookups fail (but, importantly, we don't error // when failing to fetch the `--find-links` URL). - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--find-links") .arg("https://download.pytorch.org/whl/torch_stable.html") @@ -3296,7 +3296,7 @@ fn offline_find_links() -> Result<()> { ); // Resolve with `--offline`, `--find-links`, and `--no-index`. - puffin_snapshot!(context.compile() + uv_snapshot!(context.compile() .arg("requirements.in") .arg("--find-links") .arg("https://download.pytorch.org/whl/torch_stable.html") diff --git a/crates/puffin/tests/pip_compile_scenarios.rs b/crates/uv/tests/pip_compile_scenarios.rs similarity index 92% rename from crates/puffin/tests/pip_compile_scenarios.rs rename to crates/uv/tests/pip_compile_scenarios.rs index 0b7920f6532b..96bb814862d4 100644 --- a/crates/puffin/tests/pip_compile_scenarios.rs +++ b/crates/uv/tests/pip_compile_scenarios.rs @@ -13,7 +13,7 @@ use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileWriteStr, PathChild}; use predicates::prelude::predicate; -use common::{create_bin_with_executables, get_bin, puffin_snapshot, TestContext, INSTA_FILTERS}; +use common::{create_bin_with_executables, get_bin, uv_snapshot, TestContext, INSTA_FILTERS}; mod common; @@ -67,14 +67,14 @@ fn requires_incompatible_python_version_compatible_override() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("a-3f4ac9b2==1.0.0")?; - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.11") , @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.11 + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.11 albatross==1.0.0 ----- stderr ----- @@ -120,7 +120,7 @@ fn requires_compatible_python_version_incompatible_override() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("a-fd6db412==1.0.0")?; - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.9") , @r###" success: false @@ -173,7 +173,7 @@ fn requires_incompatible_python_version_compatible_override_no_wheels() -> Resul // Since there are no wheels for the package and it is not compatible with the // local installation, we cannot build the source distribution to determine its // dependencies. - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.11") , @r###" success: false @@ -228,14 +228,14 @@ fn requires_incompatible_python_version_compatible_override_no_wheels_available_ // Since there is a compatible Python version available on the system, it should be // used to build the source distributions. - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.11") , @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.11 + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.11 albatross==1.0.0 ----- stderr ----- @@ -284,7 +284,7 @@ fn requires_incompatible_python_version_compatible_override_no_compatible_wheels // Since there are no compatible wheels for the package and it is not compatible // with the local installation, we cannot build the source distribution to // determine its dependencies. - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.11") , @r###" success: false @@ -342,7 +342,7 @@ fn requires_incompatible_python_version_compatible_override_other_wheel() -> Res // target and it is not compatible with the local installation, we cannot build the // source distribution to determine its dependencies. The other version has wheels // available, but is not compatible with the target version and cannot be used. - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.11") , @r###" success: false @@ -400,7 +400,7 @@ fn requires_python_patch_version_override_no_patch() -> Result<()> { // Since the resolver is asked to solve with 3.8, the minimum compatible Python // requirement is treated as 3.8.0. - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.8") , @r###" success: false @@ -448,14 +448,14 @@ fn requires_python_patch_version_override_patch_compatible() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("a-91b4bcfc==1.0.0")?; - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) .arg("--python-version=3.8.0") , @r###" success: true exit_code: 0 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.8.0 + # This file was autogenerated by uv v[VERSION] via the following command: + # uv pip compile requirements.in --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] --python-version=3.8.0 albatross==1.0.0 ----- stderr ----- diff --git a/crates/puffin/tests/pip_install.rs b/crates/uv/tests/pip_install.rs similarity index 94% rename from crates/puffin/tests/pip_install.rs rename to crates/uv/tests/pip_install.rs index 216892b395d8..f210969b1b63 100644 --- a/crates/puffin/tests/pip_install.rs +++ b/crates/uv/tests/pip_install.rs @@ -8,7 +8,7 @@ use assert_fs::prelude::*; use indoc::indoc; use url::Url; -use common::{puffin_snapshot, TestContext, EXCLUDE_NEWER, INSTA_FILTERS}; +use common::{uv_snapshot, TestContext, EXCLUDE_NEWER, INSTA_FILTERS}; use crate::common::get_bin; @@ -34,7 +34,7 @@ fn missing_requirements_txt() { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -55,7 +55,7 @@ fn missing_requirements_txt() { fn no_solution() { let context = TestContext::new("3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("flask>=3.0.0") .arg("WerkZeug<1.0.0") .arg("--strict"), @r###" @@ -79,7 +79,7 @@ fn install_package() { let context = TestContext::new("3.12"); // Install Flask. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("Flask") .arg("--strict"), @r###" success: true @@ -112,7 +112,7 @@ fn install_requirements_txt() -> Result<()> { let requirements_txt = context.temp_dir.child("requirements.txt"); requirements_txt.write_str("Flask")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -140,7 +140,7 @@ fn install_requirements_txt() -> Result<()> { let requirements_txt = context.temp_dir.child("requirements.txt"); requirements_txt.write_str("Jinja2")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -168,7 +168,7 @@ fn respect_installed() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("Flask==2.3.2")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -197,7 +197,7 @@ fn respect_installed() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("Flask")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -227,7 +227,7 @@ fn respect_installed() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -249,7 +249,7 @@ fn respect_installed() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("Flask")?; - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("-r") .arg("requirements.txt") .arg("--reinstall-package") @@ -281,7 +281,7 @@ fn allow_incompatibilities() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("Flask")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -310,7 +310,7 @@ fn allow_incompatibilities() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("jinja2==2.11.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("-r") .arg("requirements.txt") .arg("--strict"), @r###" @@ -352,7 +352,7 @@ fn install_editable() -> Result<()> { .collect::>(); // Install the editable package. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("install") .arg("-e") @@ -379,7 +379,7 @@ fn install_editable() -> Result<()> { ); // Install it again (no-op). - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("install") .arg("-e") @@ -401,7 +401,7 @@ fn install_editable() -> Result<()> { ); // Add another, non-editable dependency. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("install") .arg("-e") @@ -454,7 +454,7 @@ fn install_editable_and_registry() -> Result<()> { .collect(); // Install the registry-based version of Black. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("install") .arg("black") @@ -483,7 +483,7 @@ fn install_editable_and_registry() -> Result<()> { ); // Install the editable version of Black. This should remove the registry-based version. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("install") .arg("-e") @@ -510,7 +510,7 @@ fn install_editable_and_registry() -> Result<()> { // Re-install the registry-based version of Black. This should be a no-op, since we have a // version of Black installed (the editable version) that satisfies the requirements. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("install") .arg("black") @@ -539,7 +539,7 @@ fn install_editable_and_registry() -> Result<()> { .collect(); // Re-install Black at a specific version. This should replace the editable version. - puffin_snapshot!(filters2, Command::new(get_bin()) + uv_snapshot!(filters2, Command::new(get_bin()) .arg("pip") .arg("install") .arg("black==23.10.0") @@ -581,7 +581,7 @@ fn reinstall_build_system() -> Result<()> { " })?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("--reinstall") .arg("-r") .arg("requirements.txt") @@ -613,7 +613,7 @@ fn reinstall_build_system() -> Result<()> { fn install_no_index() { let context = TestContext::new("3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("Flask") .arg("--no-index"), @r###" success: false @@ -640,7 +640,7 @@ fn install_no_index() { fn install_no_index_version() { let context = TestContext::new("3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("Flask==3.0.0") .arg("--no-index"), @r###" success: false @@ -675,7 +675,7 @@ fn reinstall_no_binary() { // default windows stack of 1MB command.env("PUFFIN_STACK_SIZE", (2 * 1024 * 1024).to_string()); } - puffin_snapshot!(command, @r###" + uv_snapshot!(command, @r###" success: true exit_code: 0 ----- stdout ----- @@ -705,7 +705,7 @@ fn reinstall_no_binary() { // default windows stack of 1MB command.env("PUFFIN_STACK_SIZE", (2 * 1024 * 1024).to_string()); } - puffin_snapshot!(command, @r###" + uv_snapshot!(command, @r###" success: true exit_code: 0 ----- stdout ----- @@ -741,7 +741,7 @@ fn reinstall_no_binary() { // default windows stack of 1MB command.env("PUFFIN_STACK_SIZE", (2 * 1024 * 1024).to_string()); } - puffin_snapshot!(filters, command, @r###" + uv_snapshot!(filters, command, @r###" success: true exit_code: 0 ----- stdout ----- @@ -765,7 +765,7 @@ fn reinstall_no_binary() { fn install_executable() { let context = TestContext::new("3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("pylint==3.0.0"), @r###" success: true exit_code: 0 @@ -799,7 +799,7 @@ fn install_executable() { fn install_executable_copy() { let context = TestContext::new("3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("pylint==3.0.0") .arg("--link-mode") .arg("copy"), @r###" @@ -835,7 +835,7 @@ fn install_executable_copy() { fn install_executable_hardlink() { let context = TestContext::new("3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("pylint==3.0.0") .arg("--link-mode") .arg("hardlink"), @r###" @@ -871,7 +871,7 @@ fn no_deps() { let context = TestContext::new("3.12"); // Install Flask. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("Flask") .arg("--no-deps") .arg("--strict"), @r###" diff --git a/crates/puffin/tests/pip_install_scenarios.rs b/crates/uv/tests/pip_install_scenarios.rs similarity index 97% rename from crates/puffin/tests/pip_install_scenarios.rs rename to crates/uv/tests/pip_install_scenarios.rs index fed29ba9b4fe..5b65aaba6c66 100644 --- a/crates/puffin/tests/pip_install_scenarios.rs +++ b/crates/uv/tests/pip_install_scenarios.rs @@ -13,7 +13,7 @@ use assert_cmd::prelude::*; use common::{venv_to_interpreter, INSTA_FILTERS}; -use crate::common::{get_bin, puffin_snapshot, TestContext}; +use crate::common::{get_bin, uv_snapshot, TestContext}; mod common; @@ -75,7 +75,7 @@ fn requires_package_does_not_exist() { let mut filters = INSTA_FILTERS.to_vec(); filters.push((r"-5a1a4a35", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-5a1a4a35") , @r###" success: false @@ -113,7 +113,7 @@ fn requires_exact_version_does_not_exist() { filters.push((r"a-7cff23d9", "albatross")); filters.push((r"-7cff23d9", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-7cff23d9==2.0.0") , @r###" success: false @@ -153,7 +153,7 @@ fn requires_greater_version_does_not_exist() { filters.push((r"a-63569c9e", "albatross")); filters.push((r"-63569c9e", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-63569c9e>1.0.0") , @r###" success: false @@ -194,7 +194,7 @@ fn requires_less_version_does_not_exist() { filters.push((r"a-2af6fa02", "albatross")); filters.push((r"-2af6fa02", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-2af6fa02<2.0.0") , @r###" success: false @@ -234,7 +234,7 @@ fn transitive_requires_package_does_not_exist() { filters.push((r"a-64b04b2b", "albatross")); filters.push((r"-64b04b2b", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-64b04b2b") , @r###" success: false @@ -274,7 +274,7 @@ fn excluded_only_version() { filters.push((r"a-72f0d052", "albatross")); filters.push((r"-72f0d052", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-72f0d052!=1.0.0") , @r###" success: false @@ -333,7 +333,7 @@ fn excluded_only_compatible_version() { filters.push((r"b-d6ce69da", "bluebird")); filters.push((r"-d6ce69da", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-d6ce69da!=2.0.0") .arg("b-d6ce69da<3.0.0,>=2.0.0") , @r###" @@ -432,7 +432,7 @@ fn dependency_excludes_range_of_compatible_versions() { filters.push((r"c-5824fb81", "crow")); filters.push((r"-5824fb81", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-5824fb81") .arg("b-5824fb81<3.0.0,>=2.0.0") .arg("c-5824fb81") @@ -547,7 +547,7 @@ fn dependency_excludes_non_contiguous_range_of_compatible_versions() { filters.push((r"c-119f929b", "crow")); filters.push((r"-119f929b", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-119f929b") .arg("b-119f929b<3.0.0,>=2.0.0") .arg("c-119f929b") @@ -616,7 +616,7 @@ fn extra_required() { filters.push((r"b-c1e0ed38", "bluebird")); filters.push((r"-c1e0ed38", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-c1e0ed38[extra]") , @r###" success: true @@ -659,7 +659,7 @@ fn missing_extra() { filters.push((r"a-de25a6db", "albatross")); filters.push((r"-de25a6db", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-de25a6db[extra]") , @r###" success: true @@ -714,7 +714,7 @@ fn multiple_extras_required() { filters.push((r"c-502cbb59", "crow")); filters.push((r"-502cbb59", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-502cbb59[extra_b,extra_c]") , @r###" success: true @@ -771,7 +771,7 @@ fn extra_incompatible_with_extra() { filters.push((r"b-a5547b80", "bluebird")); filters.push((r"-a5547b80", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-a5547b80[extra_b,extra_c]") , @r###" success: false @@ -825,7 +825,7 @@ fn extra_incompatible_with_extra_not_requested() { filters.push((r"b-8bb31c23", "bluebird")); filters.push((r"-8bb31c23", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-8bb31c23[extra_c]") , @r###" success: true @@ -880,7 +880,7 @@ fn extra_incompatible_with_root() { filters.push((r"b-aca6971b", "bluebird")); filters.push((r"-aca6971b", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-aca6971b[extra]") .arg("b-aca6971b==2.0.0") , @r###" @@ -935,7 +935,7 @@ fn extra_does_not_exist_backtrack() { filters.push((r"b-c4307e58", "bluebird")); filters.push((r"-c4307e58", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-c4307e58[extra]") , @r###" success: true @@ -980,7 +980,7 @@ fn direct_incompatible_versions() { filters.push((r"a-c0e7adfa", "albatross")); filters.push((r"-c0e7adfa", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-c0e7adfa==1.0.0") .arg("a-c0e7adfa==2.0.0") , @r###" @@ -1029,7 +1029,7 @@ fn transitive_incompatible_with_root_version() { filters.push((r"b-a13da883", "bluebird")); filters.push((r"-a13da883", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-a13da883") .arg("b-a13da883==1.0.0") , @r###" @@ -1084,7 +1084,7 @@ fn transitive_incompatible_with_transitive() { filters.push((r"c-ec82e315", "crow")); filters.push((r"-ec82e315", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-ec82e315") .arg("b-ec82e315") , @r###" @@ -1127,7 +1127,7 @@ fn package_only_prereleases() { filters.push((r"a-472fcc7e", "albatross")); filters.push((r"-472fcc7e", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-472fcc7e") , @r###" success: true @@ -1171,7 +1171,7 @@ fn package_only_prereleases_in_range() { filters.push((r"a-1017748b", "albatross")); filters.push((r"-1017748b", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-1017748b>0.1.0") , @r###" success: false @@ -1216,7 +1216,7 @@ fn requires_package_only_prereleases_in_range_global_opt_in() { filters.push((r"a-95140069", "albatross")); filters.push((r"-95140069", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("--prerelease=allow") .arg("a-95140069>0.1.0") , @r###" @@ -1259,7 +1259,7 @@ fn requires_package_prerelease_and_final_any() { filters.push((r"a-909975d8", "albatross")); filters.push((r"-909975d8", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-909975d8") , @r###" success: true @@ -1306,7 +1306,7 @@ fn package_prerelease_specified_only_final_available() { filters.push((r"a-6f8bea9f", "albatross")); filters.push((r"-6f8bea9f", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-6f8bea9f>=0.1.0a1") , @r###" success: true @@ -1352,7 +1352,7 @@ fn package_prerelease_specified_only_prerelease_available() { filters.push((r"a-48d4bba0", "albatross")); filters.push((r"-48d4bba0", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-48d4bba0>=0.1.0a1") , @r###" success: true @@ -1400,7 +1400,7 @@ fn package_prerelease_specified_mixed_available() { filters.push((r"a-2b1193a7", "albatross")); filters.push((r"-2b1193a7", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-2b1193a7>=0.1.0a1") , @r###" success: true @@ -1447,7 +1447,7 @@ fn package_multiple_prereleases_kinds() { filters.push((r"a-72919cf7", "albatross")); filters.push((r"-72919cf7", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-72919cf7>=1.0.0a1") , @r###" success: true @@ -1492,7 +1492,7 @@ fn package_multiple_prereleases_numbers() { filters.push((r"a-cecdb92d", "albatross")); filters.push((r"-cecdb92d", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-cecdb92d>=1.0.0a1") , @r###" success: true @@ -1539,7 +1539,7 @@ fn transitive_package_only_prereleases() { filters.push((r"b-e3c94488", "bluebird")); filters.push((r"-e3c94488", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-e3c94488") , @r###" success: true @@ -1590,7 +1590,7 @@ fn transitive_package_only_prereleases_in_range() { filters.push((r"b-20238f1b", "bluebird")); filters.push((r"-20238f1b", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-20238f1b") , @r###" success: false @@ -1644,7 +1644,7 @@ fn transitive_package_only_prereleases_in_range_opt_in() { filters.push((r"b-d65d5fdf", "bluebird")); filters.push((r"-d65d5fdf", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-d65d5fdf") .arg("b-d65d5fdf>0.0.0a1") , @r###" @@ -1703,7 +1703,7 @@ fn transitive_prerelease_and_stable_dependency() { filters.push((r"c-d62255d0", "crow")); filters.push((r"-d62255d0", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-d62255d0") .arg("b-d62255d0") , @r###" @@ -1765,7 +1765,7 @@ fn transitive_prerelease_and_stable_dependency_opt_in() { filters.push((r"c-0778b0eb", "crow")); filters.push((r"-0778b0eb", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-0778b0eb") .arg("b-0778b0eb") .arg("c-0778b0eb>=0.0.0a1") @@ -1851,7 +1851,7 @@ fn transitive_prerelease_and_stable_dependency_many_versions() { filters.push((r"c-cc6a6eac", "crow")); filters.push((r"-cc6a6eac", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-cc6a6eac") .arg("b-cc6a6eac") , @r###" @@ -1929,7 +1929,7 @@ fn transitive_prerelease_and_stable_dependency_many_versions_holes() { filters.push((r"c-041e36bc", "crow")); filters.push((r"-041e36bc", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-041e36bc") .arg("b-041e36bc") , @r###" @@ -1987,7 +1987,7 @@ fn requires_python_version_does_not_exist() { filters.push((r"a-4486c0e5", "albatross")); filters.push((r"-4486c0e5", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-4486c0e5==1.0.0") , @r###" success: false @@ -2028,7 +2028,7 @@ fn requires_python_version_less_than_current() { filters.push((r"a-d4ea58de", "albatross")); filters.push((r"-d4ea58de", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-d4ea58de==1.0.0") , @r###" success: false @@ -2069,7 +2069,7 @@ fn requires_python_version_greater_than_current() { filters.push((r"a-741c8854", "albatross")); filters.push((r"-741c8854", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-741c8854==1.0.0") , @r###" success: false @@ -2110,7 +2110,7 @@ fn requires_python_version_greater_than_current_patch() { filters.push((r"a-0044ac94", "albatross")); filters.push((r"-0044ac94", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-0044ac94==1.0.0") , @r###" success: false @@ -2173,7 +2173,7 @@ fn requires_python_version_greater_than_current_many() { filters.push((r"a-da5bd150", "albatross")); filters.push((r"-da5bd150", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-da5bd150==1.0.0") , @r###" success: false @@ -2221,7 +2221,7 @@ fn requires_python_version_greater_than_current_backtrack() { filters.push((r"a-3204bc0a", "albatross")); filters.push((r"-3204bc0a", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-3204bc0a") , @r###" success: true @@ -2270,7 +2270,7 @@ fn requires_python_version_greater_than_current_excluded() { filters.push((r"a-874cae6d", "albatross")); filters.push((r"-874cae6d", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-874cae6d>=2.0.0") , @r###" success: false @@ -2325,7 +2325,7 @@ fn specific_tag_and_default() { filters.push((r"a-8f7a81f1", "albatross")); filters.push((r"-8f7a81f1", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-8f7a81f1") , @r###" success: true @@ -2363,7 +2363,7 @@ fn only_wheels() { filters.push((r"a-a874f41e", "albatross")); filters.push((r"-a874f41e", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-a874f41e") , @r###" success: true @@ -2401,7 +2401,7 @@ fn no_wheels() { filters.push((r"a-0278f343", "albatross")); filters.push((r"-0278f343", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-0278f343") , @r###" success: true @@ -2439,7 +2439,7 @@ fn no_wheels_with_matching_platform() { filters.push((r"a-f1a1f15c", "albatross")); filters.push((r"-f1a1f15c", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-f1a1f15c") , @r###" success: true @@ -2478,7 +2478,7 @@ fn no_sdist_no_wheels_with_matching_platform() { filters.push((r"a-94e293e5", "albatross")); filters.push((r"-94e293e5", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-94e293e5") , @r###" success: false @@ -2518,7 +2518,7 @@ fn no_sdist_no_wheels_with_matching_python() { filters.push((r"a-40fe677d", "albatross")); filters.push((r"-40fe677d", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-40fe677d") , @r###" success: false @@ -2558,7 +2558,7 @@ fn no_sdist_no_wheels_with_matching_abi() { filters.push((r"a-8727a9b9", "albatross")); filters.push((r"-8727a9b9", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-8727a9b9") , @r###" success: false @@ -2598,7 +2598,7 @@ fn no_wheels_no_build() { filters.push((r"a-662cbd94", "albatross")); filters.push((r"-662cbd94", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("--only-binary") .arg("a-662cbd94") .arg("a-662cbd94") @@ -2639,7 +2639,7 @@ fn only_wheels_no_binary() { filters.push((r"a-dd137625", "albatross")); filters.push((r"-dd137625", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("--no-binary") .arg("a-dd137625") .arg("a-dd137625") @@ -2681,7 +2681,7 @@ fn no_build() { filters.push((r"a-9ff1e173", "albatross")); filters.push((r"-9ff1e173", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("--only-binary") .arg("a-9ff1e173") .arg("a-9ff1e173") @@ -2724,7 +2724,7 @@ fn no_binary() { filters.push((r"a-10e961b8", "albatross")); filters.push((r"-10e961b8", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("--no-binary") .arg("a-10e961b8") .arg("a-10e961b8") @@ -2767,7 +2767,7 @@ fn package_only_yanked() { filters.push((r"a-e3de7eb4", "albatross")); filters.push((r"-e3de7eb4", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-e3de7eb4") , @r###" success: false @@ -2809,7 +2809,7 @@ fn package_only_yanked_in_range() { filters.push((r"a-84b3720e", "albatross")); filters.push((r"-84b3720e", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-84b3720e>0.1.0") , @r###" success: false @@ -2855,7 +2855,7 @@ fn requires_package_yanked_and_unyanked_any() { filters.push((r"a-93eac6d7", "albatross")); filters.push((r"-93eac6d7", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-93eac6d7") , @r###" success: true @@ -2901,7 +2901,7 @@ fn package_yanked_specified_mixed_available() { filters.push((r"a-3325916e", "albatross")); filters.push((r"-3325916e", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-3325916e>=0.1.0") , @r###" success: true @@ -2948,7 +2948,7 @@ fn transitive_package_only_yanked() { filters.push((r"b-9ec30fe2", "bluebird")); filters.push((r"-9ec30fe2", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-9ec30fe2") , @r###" success: false @@ -2997,7 +2997,7 @@ fn transitive_package_only_yanked_in_range() { filters.push((r"b-872d714e", "bluebird")); filters.push((r"-872d714e", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-872d714e") , @r###" success: false @@ -3052,7 +3052,7 @@ fn transitive_package_only_yanked_in_range_opt_in() { filters.push((r"b-1bbd5d1b", "bluebird")); filters.push((r"-1bbd5d1b", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-1bbd5d1b") .arg("b-1bbd5d1b==1.0.0") , @r###" @@ -3112,7 +3112,7 @@ fn transitive_yanked_and_unyanked_dependency() { filters.push((r"c-eb1ba5f5", "crow")); filters.push((r"-eb1ba5f5", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-eb1ba5f5") .arg("b-eb1ba5f5") , @r###" @@ -3171,7 +3171,7 @@ fn transitive_yanked_and_unyanked_dependency_opt_in() { filters.push((r"c-f0760ee9", "crow")); filters.push((r"-f0760ee9", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("a-f0760ee9") .arg("b-f0760ee9") .arg("c-f0760ee9==2.0.0") diff --git a/crates/puffin/tests/pip_sync.rs b/crates/uv/tests/pip_sync.rs similarity index 94% rename from crates/puffin/tests/pip_sync.rs rename to crates/uv/tests/pip_sync.rs index 749e01f589f7..12f8379644ac 100644 --- a/crates/puffin/tests/pip_sync.rs +++ b/crates/uv/tests/pip_sync.rs @@ -11,9 +11,9 @@ use indoc::indoc; use url::Url; use common::{ - create_bin_with_executables, create_venv, puffin_snapshot, venv_to_interpreter, INSTA_FILTERS, + create_bin_with_executables, create_venv, uv_snapshot, venv_to_interpreter, INSTA_FILTERS, }; -use puffin_fs::Normalized; +use uv_fs::Normalized; use crate::common::{get_bin, TestContext}; @@ -59,7 +59,7 @@ fn uninstall_command(context: &TestContext) -> Command { #[test] fn missing_pip() { - puffin_snapshot!(Command::new(get_bin()).arg("sync"), @r###" + uv_snapshot!(Command::new(get_bin()).arg("sync"), @r###" success: false exit_code: 2 ----- stdout ----- @@ -67,9 +67,9 @@ fn missing_pip() { ----- stderr ----- error: unrecognized subcommand 'sync' - tip: a similar subcommand exists: 'puffin pip sync' + tip: a similar subcommand exists: 'uv pip sync' - Usage: puffin [OPTIONS] + Usage: uv [OPTIONS] For more information, try '--help'. "###); @@ -81,7 +81,7 @@ fn missing_requirements_txt() { let requirements_txt = context.temp_dir.child("requirements.txt"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: false @@ -102,7 +102,7 @@ fn missing_venv() -> Result<()> { let cache_dir = assert_fs::TempDir::new()?; let venv = temp_dir.child(".venv"); - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("sync") .arg("requirements.txt") @@ -135,7 +135,7 @@ fn install() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -169,7 +169,7 @@ fn install_copy() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--link-mode") .arg("copy") @@ -205,7 +205,7 @@ fn install_hardlink() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--link-mode") .arg("hardlink") @@ -241,7 +241,7 @@ fn install_many() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\ntomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -279,7 +279,7 @@ fn noop() -> Result<()> { .assert() .success(); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -335,7 +335,7 @@ fn link() -> Result<()> { .success(); venv2.assert(predicates::path::is_dir()); - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("sync") .arg("requirements.txt") @@ -379,7 +379,7 @@ fn add_remove() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("tomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -422,7 +422,7 @@ fn install_sequential() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\ntomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -464,7 +464,7 @@ fn upgrade() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("tomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -495,7 +495,7 @@ fn install_url() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -525,7 +525,7 @@ fn install_git_commit() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -555,7 +555,7 @@ fn install_git_tag() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@2.0.0")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -585,7 +585,7 @@ fn install_git_subdirectories() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("example-pkg-a @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_a\nexample-pkg-b @ git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_b")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -617,7 +617,7 @@ fn install_sdist() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("Werkzeug==0.9.6")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -646,7 +646,7 @@ fn install_sdist_url() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("Werkzeug @ https://files.pythonhosted.org/packages/63/69/5702e5eb897d1a144001e21d676676bcb87b88c0862f947509ea95ea54fc/Werkzeug-0.9.6.tar.gz")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -682,7 +682,7 @@ fn install_url_then_install_url() -> Result<()> { .assert() .success(); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -719,7 +719,7 @@ fn install_url_then_install_version() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug==2.0.0")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -756,7 +756,7 @@ fn install_version_then_install_url() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug @ https://files.pythonhosted.org/packages/ff/1d/960bb4017c68674a1cb099534840f18d3def3ce44aed12b5ed8b78e0153e/Werkzeug-2.0.0-py3-none-any.whl")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -779,7 +779,7 @@ fn install_version_then_install_url() -> Result<()> { } /// Test that we select the last 3.8 compatible numpy version instead of trying to compile an -/// incompatible sdist +/// incompatible sdist #[test] fn install_numpy_py38() -> Result<()> { let context = TestContext::new("3.8"); @@ -788,7 +788,7 @@ fn install_numpy_py38() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("numpy")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -817,7 +817,7 @@ fn install_no_index() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--no-index") .arg("--strict"), @r###" @@ -845,7 +845,7 @@ fn install_no_index_cached() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -867,7 +867,7 @@ fn install_no_index_cached() -> Result<()> { .assert() .success(); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--no-index") .arg("--strict"), @r###" @@ -895,7 +895,7 @@ fn warn_on_yanked_version() -> Result<()> { // This version is yanked. requirements_in.write_str("colorama==0.4.2")?; - puffin_snapshot!(INSTA_FILTERS, windows_filters=false, command(&context) + uv_snapshot!(INSTA_FILTERS, windows_filters=false, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -937,7 +937,7 @@ fn install_local_wheel() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -958,7 +958,7 @@ fn install_local_wheel() -> Result<()> { let venv = create_venv(&context.temp_dir, &context.cache_dir, "3.12"); // Reinstall. The wheel should come from the cache, so there shouldn't be a "download". - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -982,7 +982,7 @@ fn install_local_wheel() -> Result<()> { filetime::set_file_mtime(&archive, filetime::FileTime::now()).unwrap(); // Reinstall. The wheel should be "downloaded" again. - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1004,7 +1004,7 @@ fn install_local_wheel() -> Result<()> { filetime::set_file_mtime(&archive, filetime::FileTime::now()).unwrap(); // Reinstall into the same virtual environment. The wheel should be reinstalled. - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1049,7 +1049,7 @@ fn mismatched_version() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: false @@ -1090,7 +1090,7 @@ fn mismatched_name() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: false @@ -1131,7 +1131,7 @@ fn install_local_source_distribution() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1161,7 +1161,7 @@ fn install_local_source_distribution() -> Result<()> { /// Like `pip` and `build`, we should use PEP 517 here and respect the `requires`, but use the /// default build backend. #[test] -#[cfg(unix)] // https://github.com/astral-sh/puffin/issues/1238 +#[cfg(unix)] // https://github.com/astral-sh/uv/issues/1238 fn install_ujson() -> Result<()> { let context = TestContext::new("3.12"); @@ -1169,7 +1169,7 @@ fn install_ujson() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("ujson @ https://files.pythonhosted.org/packages/43/1a/b0a027144aa5c8f4ea654f4afdd634578b450807bb70b9f8bad00d6f6d3c/ujson-5.7.0.tar.gz")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1209,7 +1209,7 @@ fn install_build_system_no_backend() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("build-system-no-backend @ https://files.pythonhosted.org/packages/ec/25/1e531108ca027dc3a3b37d351f4b86d811df4884c6a81cd99e73b8b589f5/build-system-no-backend-0.1.0.tar.gz")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1248,7 +1248,7 @@ fn install_url_source_dist_cached() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1269,7 +1269,7 @@ fn install_url_source_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1289,7 +1289,7 @@ fn install_url_source_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("clean") .arg("tqdm") .arg("--cache-dir") @@ -1305,7 +1305,7 @@ fn install_url_source_dist_cached() -> Result<()> { "### ); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1336,7 +1336,7 @@ fn install_git_source_dist_cached() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1357,7 +1357,7 @@ fn install_git_source_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1385,7 +1385,7 @@ fn install_git_source_dist_cached() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("clean") .arg("werkzeug") .arg("--cache-dir") @@ -1401,7 +1401,7 @@ fn install_git_source_dist_cached() -> Result<()> { "### ); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1431,7 +1431,7 @@ fn install_registry_source_dist_cached() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("future==0.18.3")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1452,7 +1452,7 @@ fn install_registry_source_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1480,7 +1480,7 @@ fn install_registry_source_dist_cached() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("clean") .arg("future") .arg("--cache-dir") @@ -1496,7 +1496,7 @@ fn install_registry_source_dist_cached() -> Result<()> { "### ); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1540,7 +1540,7 @@ fn install_path_source_dist_cached() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1561,7 +1561,7 @@ fn install_path_source_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1589,7 +1589,7 @@ fn install_path_source_dist_cached() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters2, Command::new(get_bin()) + uv_snapshot!(filters2, Command::new(get_bin()) .arg("clean") .arg("wheel") .arg("--cache-dir") @@ -1605,7 +1605,7 @@ fn install_path_source_dist_cached() -> Result<()> { "### ); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1651,7 +1651,7 @@ fn install_path_built_dist_cached() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1672,7 +1672,7 @@ fn install_path_built_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&context.temp_dir, &context.cache_dir, "3.12"); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1703,7 +1703,7 @@ fn install_path_built_dist_cached() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters2, Command::new(get_bin()) + uv_snapshot!(filters2, Command::new(get_bin()) .arg("clean") .arg("tomli") .arg("--cache-dir") @@ -1719,7 +1719,7 @@ fn install_path_built_dist_cached() -> Result<()> { "### ); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1757,7 +1757,7 @@ fn install_url_built_dist_cached() -> Result<()> { } else { INSTA_FILTERS.to_vec() }; - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1778,7 +1778,7 @@ fn install_url_built_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1798,7 +1798,7 @@ fn install_url_built_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("clean") .arg("tqdm") .arg("--cache-dir") @@ -1814,7 +1814,7 @@ fn install_url_built_dist_cached() -> Result<()> { "### ); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" @@ -1844,7 +1844,7 @@ fn duplicate_package_overlap() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\nMarkupSafe==2.1.2")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: false @@ -1869,7 +1869,7 @@ fn duplicate_package_disjoint() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\nMarkupSafe==2.1.2 ; python_version < '3.6'")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1896,7 +1896,7 @@ fn reinstall() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\ntomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1916,7 +1916,7 @@ fn reinstall() -> Result<()> { context.assert_command("import tomli").success(); // Re-run the installation with `--reinstall`. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--reinstall") .arg("--strict"), @r###" @@ -1949,7 +1949,7 @@ fn reinstall_package() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\ntomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -1969,7 +1969,7 @@ fn reinstall_package() -> Result<()> { context.assert_command("import tomli").success(); // Re-run the installation with `--reinstall`. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--reinstall-package") .arg("tomli") @@ -2002,7 +2002,7 @@ fn reinstall_git() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("werkzeug @ git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -2020,7 +2020,7 @@ fn reinstall_git() -> Result<()> { context.assert_command("import werkzeug").success(); // Re-run the installation with `--reinstall`. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--reinstall-package") .arg("WerkZeug") @@ -2051,7 +2051,7 @@ fn refresh() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\ntomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -2075,7 +2075,7 @@ fn refresh() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--refresh") .arg("--strict") @@ -2108,7 +2108,7 @@ fn refresh_package() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("MarkupSafe==2.1.3\ntomli==2.0.1")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: true @@ -2132,7 +2132,7 @@ fn refresh_package() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv(&parent, &context.cache_dir, "3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.txt") .arg("--refresh-package") .arg("tomli") @@ -2196,7 +2196,7 @@ fn sync_editable() -> Result<()> { .collect::>(); // Install the editable packages. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2222,7 +2222,7 @@ fn sync_editable() -> Result<()> { ); // Reinstall the editable packages. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2284,7 +2284,7 @@ fn sync_editable() -> Result<()> { // Don't create a git diff. fs_err::write(python_source_file, python_version_1)?; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2332,7 +2332,7 @@ fn sync_editable_and_registry() -> Result<()> { ]) .copied() .collect::>(); - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2375,7 +2375,7 @@ fn sync_editable_and_registry() -> Result<()> { ]) .copied() .collect::>(); - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2414,7 +2414,7 @@ fn sync_editable_and_registry() -> Result<()> { ]) .copied() .collect::>(); - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2448,7 +2448,7 @@ fn sync_editable_and_registry() -> Result<()> { ]) .copied() .collect::>(); - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("sync") .arg(requirements_txt.path()) @@ -2505,7 +2505,7 @@ fn incompatible_wheel() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--strict"), @r###" success: false @@ -2529,7 +2529,7 @@ fn sync_legacy_sdist_pep_517() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flake8 @ https://files.pythonhosted.org/packages/66/53/3ad4a3b74d609b3b9008a10075c40e7c8909eae60af53623c3888f7a529a/flake8-6.0.0.tar.gz")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.in"), @r###" success: true exit_code: 0 @@ -2554,7 +2554,7 @@ fn sync_legacy_sdist_setuptools() -> Result<()> { let requirements_in = context.temp_dir.child("requirements.in"); requirements_in.write_str("flake8 @ https://files.pythonhosted.org/packages/66/53/3ad4a3b74d609b3b9008a10075c40e7c8909eae60af53623c3888f7a529a/flake8-6.0.0.tar.gz")?; - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.in") .arg("--legacy-setup-py"), @r###" success: true @@ -2592,7 +2592,7 @@ fn find_links() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) .arg("requirements.txt") .arg("--find-links") .arg(project_root.join("scripts/wheels/")), @r###" @@ -2622,7 +2622,7 @@ fn offline() -> Result<()> { requirements_in.write_str("black==23.10.1")?; // Install with `--offline` with an empty cache. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.in") .arg("--offline"), @r###" success: false @@ -2635,7 +2635,7 @@ fn offline() -> Result<()> { ); // Populate the cache. - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.in"), @r###" success: true exit_code: 0 @@ -2652,7 +2652,7 @@ fn offline() -> Result<()> { // Install with `--offline` with a populated cache. let venv = create_venv(&context.temp_dir, &context.cache_dir, "3.12"); - puffin_snapshot!(command(&context) + uv_snapshot!(command(&context) .arg("requirements.in") .arg("--offline") .env("VIRTUAL_ENV", venv.as_os_str()), @r###" diff --git a/crates/puffin/tests/pip_uninstall.rs b/crates/uv/tests/pip_uninstall.rs similarity index 94% rename from crates/puffin/tests/pip_uninstall.rs rename to crates/uv/tests/pip_uninstall.rs index 6936b32ab282..e3832062184c 100644 --- a/crates/puffin/tests/pip_uninstall.rs +++ b/crates/uv/tests/pip_uninstall.rs @@ -3,9 +3,9 @@ use std::process::Command; use anyhow::Result; use assert_cmd::prelude::*; use assert_fs::prelude::*; -use common::{puffin_snapshot, INSTA_FILTERS}; -use puffin_fs::Normalized; +use common::{uv_snapshot, INSTA_FILTERS}; use url::Url; +use uv_fs::Normalized; use crate::common::{get_bin, venv_to_interpreter, TestContext}; @@ -15,7 +15,7 @@ mod common; fn no_arguments() -> Result<()> { let temp_dir = assert_fs::TempDir::new()?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .current_dir(&temp_dir), @r###" @@ -27,7 +27,7 @@ fn no_arguments() -> Result<()> { error: the following required arguments were not provided: |--editable > - Usage: puffin pip uninstall |--editable > + Usage: uv pip uninstall |--editable > For more information, try '--help'. "### @@ -40,7 +40,7 @@ fn no_arguments() -> Result<()> { fn invalid_requirement() -> Result<()> { let temp_dir = assert_fs::TempDir::new()?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("flask==1.0.x") @@ -63,7 +63,7 @@ fn invalid_requirement() -> Result<()> { fn missing_requirements_txt() -> Result<()> { let temp_dir = assert_fs::TempDir::new()?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-r") @@ -89,7 +89,7 @@ fn invalid_requirements_txt_requirement() -> Result<()> { requirements_txt.touch()?; requirements_txt.write_str("flask==1.0.x")?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-r") @@ -113,7 +113,7 @@ fn invalid_requirements_txt_requirement() -> Result<()> { fn missing_pyproject_toml() -> Result<()> { let temp_dir = assert_fs::TempDir::new()?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-r") @@ -139,7 +139,7 @@ fn invalid_pyproject_toml_syntax() -> Result<()> { pyproject_toml.touch()?; pyproject_toml.write_str("123 - 456")?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-r") @@ -169,7 +169,7 @@ fn invalid_pyproject_toml_schema() -> Result<()> { pyproject_toml.touch()?; pyproject_toml.write_str("[project]")?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-r") @@ -204,7 +204,7 @@ dependencies = ["flask==1.0.x"] "#, )?; - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-r") @@ -255,7 +255,7 @@ fn uninstall() -> Result<()> { .assert() .success(); - puffin_snapshot!(Command::new(get_bin()) + uv_snapshot!(Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("MarkupSafe") @@ -341,7 +341,7 @@ fn missing_record() -> Result<()> { .chain(INSTA_FILTERS.to_vec()) .collect(); - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("MarkupSafe") @@ -398,7 +398,7 @@ fn uninstall_editable_by_name() -> Result<()> { .success(); // Uninstall the editable by name. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("poetry-editable") @@ -461,7 +461,7 @@ fn uninstall_editable_by_path() -> Result<()> { .success(); // Uninstall the editable by path. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("-e") @@ -525,7 +525,7 @@ fn uninstall_duplicate_editable() -> Result<()> { .success(); // Uninstall the editable by both path and name. - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("pip") .arg("uninstall") .arg("poetry-editable") diff --git a/crates/puffin/tests/venv.rs b/crates/uv/tests/venv.rs similarity index 93% rename from crates/puffin/tests/venv.rs rename to crates/uv/tests/venv.rs index 77861adcc8f6..79ea1c3f9ae9 100644 --- a/crates/puffin/tests/venv.rs +++ b/crates/uv/tests/venv.rs @@ -5,9 +5,9 @@ use std::process::Command; use anyhow::Result; use assert_fs::prelude::*; -use puffin_fs::Normalized; +use uv_fs::Normalized; -use crate::common::{create_bin_with_executables, get_bin, puffin_snapshot, EXCLUDE_NEWER}; +use crate::common::{create_bin_with_executables, get_bin, uv_snapshot, EXCLUDE_NEWER}; mod common; @@ -27,7 +27,7 @@ fn create_venv() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -59,7 +59,7 @@ fn create_venv() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -101,7 +101,7 @@ fn create_venv_defaults_to_cwd() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg("--python") .arg("3.12") @@ -142,7 +142,7 @@ fn seed() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--seed") @@ -194,7 +194,7 @@ fn create_venv_unknown_python_minor() -> Result<()> { .env("PUFFIN_TEST_PYTHON_PATH", bin) .current_dir(&temp_dir); if cfg!(windows) { - puffin_snapshot!(&mut command, @r###" + uv_snapshot!(&mut command, @r###" success: false exit_code: 1 ----- stdout ----- @@ -204,7 +204,7 @@ fn create_venv_unknown_python_minor() -> Result<()> { "### ); } else { - puffin_snapshot!(&mut command, @r###" + uv_snapshot!(&mut command, @r###" success: false exit_code: 1 ----- stdout ----- @@ -236,7 +236,7 @@ fn create_venv_unknown_python_patch() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -277,7 +277,7 @@ fn create_venv_python_patch() -> Result<()> { (r"interpreter at .+", "interpreter at [PATH]"), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -322,7 +322,7 @@ fn file_exists() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -341,7 +341,7 @@ fn file_exists() -> Result<()> { ----- stderr ----- Using Python [VERSION] interpreter at [PATH] Creating virtualenv at: /home/ferris/project/.venv - puffin::venv::creation + uv::venv::creation × Failed to create virtualenv ╰─▶ File exists at `/home/ferris/project/.venv` @@ -369,7 +369,7 @@ fn empty_dir_exists() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -415,7 +415,7 @@ fn non_empty_dir_exists() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--python") @@ -434,7 +434,7 @@ fn non_empty_dir_exists() -> Result<()> { ----- stderr ----- Using Python [VERSION] interpreter at [PATH] Creating virtualenv at: /home/ferris/project/.venv - puffin::venv::creation + uv::venv::creation × Failed to create virtualenv ╰─▶ The directory `/home/ferris/project/.venv` exists, but it's not a virtualenv @@ -460,7 +460,7 @@ fn virtualenv_compatibility() -> Result<()> { ), (&filter_venv, "/home/ferris/project/.venv"), ]; - puffin_snapshot!(filters, Command::new(get_bin()) + uv_snapshot!(filters, Command::new(get_bin()) .arg("venv") .arg(venv.as_os_str()) .arg("--clear") @@ -477,7 +477,7 @@ fn virtualenv_compatibility() -> Result<()> { ----- stdout ----- ----- stderr ----- - warning: virtualenv's `--clear` has no effect (Puffin always clears the virtual environment). + warning: virtualenv's `--clear` has no effect (uv always clears the virtual environment). Using Python [VERSION] interpreter at [PATH] Creating virtualenv at: /home/ferris/project/.venv "### diff --git a/pyproject.toml b/pyproject.toml index 89e6e4205af0..1dfcd95502cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,9 @@ requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" [project] -name = "puffin-alpha" -version = "0.0.4" -authors = [{ name = "Puffin" }] +name = "uv" +version = "0.1.0rc1" +authors = [{ name = "uv" }] requires-python = ">=3.8" keywords = [] classifiers = [ @@ -20,14 +20,12 @@ classifiers = [ readme = "README.md" [project.urls] -Repository = "https://pypi.org/project/puffin-alpha/" -Documentation = "https://pypi.org/project/puffin-alpha/" -Changelog = "https://pypi.org/project/puffin-alpha/" +Repository = "https://github.com/astral-sh/uv" [tool.maturin] bindings = "bin" -manifest-path = "crates/puffin/Cargo.toml" -module-name = "puffin" +manifest-path = "crates/uv/Cargo.toml" +module-name = "uv" python-source = "python" strip = true include = ["rust-toolchain.toml"] diff --git a/python/puffin/__init__.py b/python/uv/__init__.py similarity index 100% rename from python/puffin/__init__.py rename to python/uv/__init__.py diff --git a/python/puffin/__main__.py b/python/uv/__main__.py similarity index 64% rename from python/puffin/__main__.py rename to python/uv/__main__.py index 136b5d60e74e..5fea6a3e73e9 100644 --- a/python/puffin/__main__.py +++ b/python/uv/__main__.py @@ -3,12 +3,12 @@ import sysconfig -def find_puffin_bin() -> str: - """Return the puffin binary path.""" +def find_uv_bin() -> str: + """Return the uv binary path.""" - puffin_exe = "puffin" + sysconfig.get_config_var("EXE") + uv_exe = "uv" + sysconfig.get_config_var("EXE") - path = os.path.join(sysconfig.get_path("scripts"), puffin_exe) + path = os.path.join(sysconfig.get_path("scripts"), uv_exe) if os.path.isfile(path): return path @@ -21,7 +21,7 @@ def find_puffin_bin() -> str: else: user_scheme = "posix_user" - path = os.path.join(sysconfig.get_path("scripts", scheme=user_scheme), puffin_exe) + path = os.path.join(sysconfig.get_path("scripts", scheme=user_scheme), uv_exe) if os.path.isfile(path): return path @@ -29,11 +29,11 @@ def find_puffin_bin() -> str: if __name__ == "__main__": - puffin = os.fsdecode(find_puffin_bin()) + uv = os.fsdecode(find_uv_bin()) if sys.platform == "win32": import subprocess - completed_process = subprocess.run([puffin, *sys.argv[1:]]) + completed_process = subprocess.run([uv, *sys.argv[1:]]) sys.exit(completed_process.returncode) else: - os.execvp(puffin, [puffin, *sys.argv[1:]]) + os.execvp(uv, [uv, *sys.argv[1:]]) diff --git a/scripts/bench/__main__.py b/scripts/bench/__main__.py index a3ab72c62934..dd7e04dfa7d8 100644 --- a/scripts/bench/__main__.py +++ b/scripts/bench/__main__.py @@ -1,7 +1,7 @@ -"""Benchmark Puffin against other packaging tools. +"""Benchmark uv against other packaging tools. This script assumes that `pip`, `pip-tools`, `virtualenv`, `poetry` and `hyperfine` are -installed, and that a Puffin release builds exists at `./target/release/puffin` +installed, and that a uv release builds exists at `./target/release/uv` (relative to the repository root). This script assumes that Python 3.12 is installed. @@ -9,20 +9,20 @@ To set up the required environment, run: cargo build --release - ./target/release/puffin venv + ./target/release/uv venv source .venv/bin/activate - ./target/release/puffin pip sync ./scripts/bench/requirements.txt + ./target/release/uv pip sync ./scripts/bench/requirements.txt Example usage: - python -m scripts.bench --puffin --pip-compile requirements.in + python -m scripts.bench --uv --pip-compile requirements.in -Multiple versions of Puffin can be benchmarked by specifying the path to the binary for +Multiple versions of uv can be benchmarked by specifying the path to the binary for each build, as in: python -m scripts.bench \ - --puffin-path ./target/release/puffin \ - --puffin-path ./target/release/baseline \ + --uv-path ./target/release/uv \ + --uv-path ./target/release/baseline \ requirements.in """ import abc @@ -769,17 +769,17 @@ def install_warm(self, requirements_file: str, *, cwd: str) -> Command | None: ) -class Puffin(Suite): +class uv(Suite): def __init__(self, *, path: str | None = None) -> Command | None: - """Initialize a Puffin benchmark.""" - self.name = path or "puffin" + """Initialize a uv benchmark.""" + self.name = path or "uv" self.path = path or os.path.join( os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ), "target", "release", - "puffin", + "uv", ) def resolve_cold(self, requirements_file: str, *, cwd: str) -> Command | None: @@ -909,7 +909,7 @@ def install_warm(self, requirements_file: str, *, cwd: str) -> Command | None: def main(): """Run the benchmark.""" parser = argparse.ArgumentParser( - description="Benchmark Puffin against other packaging tools." + description="Benchmark uv against other packaging tools." ) parser.add_argument( "file", @@ -964,8 +964,8 @@ def main(): action="store_true", ) parser.add_argument( - "--puffin", - help="Whether to benchmark Puffin (assumes a Puffin binary exists at `./target/release/puffin`).", + "--uv", + help="Whether to benchmark uv (assumes a uv binary exists at `./target/release/uv`).", action="store_true", ) parser.add_argument( @@ -993,9 +993,9 @@ def main(): action="append", ) parser.add_argument( - "--puffin-path", + "--uv-path", type=str, - help="Path(s) to the Puffin binary to benchmark.", + help="Path(s) to the uv binary to benchmark.", action="append", ) @@ -1025,8 +1025,8 @@ def main(): suites.append(Poetry()) if args.pdm: suites.append(Pdm()) - if args.puffin: - suites.append(Puffin()) + if args.uv: + suites.append(uv()) for path in args.pip_sync_path or []: suites.append(PipSync(path=path)) for path in args.pip_compile_path or []: @@ -1035,8 +1035,8 @@ def main(): suites.append(Poetry(path=path)) for path in args.pdm_path or []: suites.append(Pdm(path=path)) - for path in args.puffin_path or []: - suites.append(Puffin(path=path)) + for path in args.uv_path or []: + suites.append(uv(path=path)) # If no tools were specified, benchmark all tools. if not suites: @@ -1044,7 +1044,7 @@ def main(): PipSync(), PipCompile(), Poetry(), - Puffin(), + uv(), ] # Determine the benchmarks to run, based on user input. If no benchmarks were diff --git a/scripts/bench/requirements.txt b/scripts/bench/requirements.txt index 415c21a48da6..0498ea3ab39e 100644 --- a/scripts/bench/requirements.txt +++ b/scripts/bench/requirements.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.3 via the following command: -# puffin pip compile scripts/bench/requirements.in -o scripts/bench/requirements.txt +# This file was autogenerated by uv v0.0.3 via the following command: +# uv pip compile scripts/bench/requirements.in -o scripts/bench/requirements.txt blinker==1.7.0 # via pdm build==1.0.3 diff --git a/scripts/benchmarks/compile.sh b/scripts/benchmarks/compile.sh index 6a02d26d40a0..70e23fc3063d 100755 --- a/scripts/benchmarks/compile.sh +++ b/scripts/benchmarks/compile.sh @@ -16,12 +16,12 @@ TARGET=${1} # Resolution with a cold cache. ### hyperfine --runs 20 --warmup 3 --prepare "rm -f /tmp/requirements.txt" \ - "./target/release/puffin --no-cache pip-compile ${TARGET} > /tmp/requirements.txt" \ + "./target/release/uv --no-cache pip-compile ${TARGET} > /tmp/requirements.txt" \ "./target/release/main --no-cache pip-compile ${TARGET} > /tmp/requirements.txt" ### # Resolution with a warm cache. ### hyperfine --runs 20 --warmup 3 --prepare "rm -f /tmp/requirements.txt" \ - "./target/release/puffin pip compile ${TARGET} > /tmp/requirements.txt" \ + "./target/release/uv pip compile ${TARGET} > /tmp/requirements.txt" \ "./target/release/main pip-compile ${TARGET} > /tmp/requirements.txt" diff --git a/scripts/benchmarks/sync.sh b/scripts/benchmarks/sync.sh index e39883be16b8..9550341ef2a8 100755 --- a/scripts/benchmarks/sync.sh +++ b/scripts/benchmarks/sync.sh @@ -17,7 +17,7 @@ TARGET=${1} ### hyperfine --runs 20 --warmup 3 \ --prepare "virtualenv --clear .venv" \ - "./target/release/puffin pip sync ${TARGET} --no-cache" \ + "./target/release/uv pip sync ${TARGET} --no-cache" \ --prepare "rm -rf /tmp/site-packages" \ "pip install -r ${TARGET} --target /tmp/site-packages --no-cache-dir --no-deps" @@ -26,7 +26,7 @@ hyperfine --runs 20 --warmup 3 \ ### hyperfine --runs 20 --warmup 3 \ --prepare "virtualenv --clear .venv" \ - "./target/release/puffin pip sync ${TARGET}" \ + "./target/release/uv pip sync ${TARGET}" \ --prepare "rm -rf /tmp/site-packages" \ "pip install -r ${TARGET} --target /tmp/site-packages --no-deps" @@ -35,5 +35,5 @@ hyperfine --runs 20 --warmup 3 \ ### hyperfine --runs 20 --warmup 3 \ --setup "virtualenv --clear .venv && source .venv/bin/activate" \ - "./target/release/puffin pip sync ${TARGET}" \ + "./target/release/uv pip sync ${TARGET}" \ "pip install -r ${TARGET} --no-deps" diff --git a/scripts/benchmarks/uninstall.sh b/scripts/benchmarks/uninstall.sh index f9f652cb6a9b..906ac362c50a 100755 --- a/scripts/benchmarks/uninstall.sh +++ b/scripts/benchmarks/uninstall.sh @@ -13,5 +13,5 @@ set -euxo pipefail TARGET=${1} hyperfine --runs 20 --warmup 3 --prepare "rm -rf .venv && virtualenv .venv && source activate .venv/bin/activate && pip install ${TARGET}" \ - "./target/release/puffin uninstall ${TARGET}" \ + "./target/release/uv uninstall ${TARGET}" \ "pip uninstall -y ${TARGET}" diff --git a/scripts/benchmarks/venv.sh b/scripts/benchmarks/venv.sh index 8ef0cb36a1bd..72f299e84787 100755 --- a/scripts/benchmarks/venv.sh +++ b/scripts/benchmarks/venv.sh @@ -15,7 +15,7 @@ set -euxo pipefail ### hyperfine --runs 20 --warmup 3 \ --prepare "rm -rf .venv" \ - "./target/release/puffin venv" \ + "./target/release/uv venv" \ --prepare "rm -rf .venv" \ "virtualenv --without-pip .venv" \ --prepare "rm -rf .venv" \ @@ -26,7 +26,7 @@ hyperfine --runs 20 --warmup 3 \ ### hyperfine --runs 20 --warmup 3 \ --prepare "rm -rf .venv" \ - "./target/release/puffin venv --seed" \ + "./target/release/uv venv --seed" \ --prepare "rm -rf .venv" \ "virtualenv .venv" \ --prepare "rm -rf .venv" \ diff --git a/scripts/compare_with_pip/compare_with_pip.py b/scripts/compare_with_pip/compare_with_pip.py index 8fa8ccb30e22..3a810b3753c6 100755 --- a/scripts/compare_with_pip/compare_with_pip.py +++ b/scripts/compare_with_pip/compare_with_pip.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 """ -Compare puffin's resolution with pip-compile on a number of requirement sets and python +Compare uv's resolution with pip-compile on a number of requirement sets and python versions. -If the first resolution diverged, we run a second "coerced" try in which puffin gets the +If the first resolution diverged, we run a second "coerced" try in which uv gets the output of pip as additional input to check if it considers this resolution possible. """ import json @@ -56,11 +56,11 @@ def resolve_pip(targets: list[str], pip_compile: Path) -> list[str]: return pip_deps -def resolve_puffin(targets: list[str], venv: Path, profile: str = "dev") -> list[str]: +def resolve_uv(targets: list[str], venv: Path, profile: str = "dev") -> list[str]: target_profile = profile if profile != "dev" else "debug" output = check_output( [ - project_root.joinpath("target").joinpath(target_profile).joinpath("puffin-dev"), + project_root.joinpath("target").joinpath(target_profile).joinpath("uv-dev"), "resolve", "--format", "expanded", @@ -73,11 +73,11 @@ def resolve_puffin(targets: list[str], venv: Path, profile: str = "dev") -> list "VIRTUAL_ENV": venv, }, ) - puffin_deps = [] + uv_deps = [] for line in output.splitlines(): - puffin_deps.append(line.replace(" ", "")) - puffin_deps.sort() - return puffin_deps + uv_deps.append(line.replace(" ", "")) + uv_deps.sort() + return uv_deps def compare_for_python_version( @@ -118,13 +118,13 @@ def compare_for_python_version( start = time.time() try: - puffin_result = resolve_puffin([target], pip_compile_venv, profile=profile) + uv_result = resolve_uv([target], pip_compile_venv, profile=profile) except CalledProcessError as e: - puffin_result = e - puffin_time = time.time() - start + uv_result = e + uv_time = time.time() - start if isinstance(pip_result, CalledProcessError) and isinstance( - puffin_result, CalledProcessError + uv_result, CalledProcessError ): print(f"Both failed {python_major}.{python_minor} {target}") continue @@ -136,59 +136,59 @@ def compare_for_python_version( f"{pip_result}\n---\n{output}\n---" ) continue - elif isinstance(puffin_result, CalledProcessError): + elif isinstance(uv_result, CalledProcessError): # Make the output a bit more readable - output = "\n".join(puffin_result.output.splitlines()[:10]) + output = "\n".join(uv_result.output.splitlines()[:10]) print( - f"Only puffin failed {python_major}.{python_minor} {target}: " - f"{puffin_result}\n---\n{output}\n---" + f"Only uv failed {python_major}.{python_minor} {target}: " + f"{uv_result}\n---\n{output}\n---" ) continue - if pip_result != puffin_result and isinstance(pip_result, list): + if pip_result != uv_result and isinstance(pip_result, list): # Maybe, both resolution are allowed? By adding all constraints from the pip - # resolution we check whether puffin considers this resolution possible - # (vs. there is a bug in puffin where we wouldn't pick those versions) + # resolution we check whether uv considers this resolution possible + # (vs. there is a bug in uv where we wouldn't pick those versions) start = time.time() try: - puffin_result2 = resolve_puffin( + uv_result2 = resolve_uv( [target, *pip_result], pip_compile_venv, profile=profile ) except CalledProcessError as e: - puffin_result2 = e - puffin_time2 = time.time() - start - if puffin_result2 == pip_result: + uv_result2 = e + uv_time2 = time.time() - start + if uv_result2 == pip_result: print( f"Equal (coerced) {python_major}.{python_minor} " - f"(pip: {pip_time:.3}s, puffin: {puffin_time2:.3}s) {target}" + f"(pip: {pip_time:.3}s, uv: {uv_time2:.3}s) {target}" ) continue - if pip_result == puffin_result: + if pip_result == uv_result: print( f"Equal {python_major}.{python_minor} " - f"(pip: {pip_time:.3}s, puffin: {puffin_time:.3}s) {target}" + f"(pip: {pip_time:.3}s, uv: {uv_time:.3}s) {target}" ) else: print( f"Different {python_major}.{python_minor} " - f"(pip: {pip_time:.3}s, puffin: {puffin_time:.3}s) {target}" + f"(pip: {pip_time:.3}s, uv: {uv_time:.3}s) {target}" ) print(f"pip: {pip_result}") - print(f"puffin: {puffin_result}") + print(f"uv: {uv_result}") while True: - if pip_result and puffin_result: - if pip_result[0] == puffin_result[0]: + if pip_result and uv_result: + if pip_result[0] == uv_result[0]: pip_result.pop(0) - puffin_result.pop(0) - elif pip_result[0] < puffin_result[0]: + uv_result.pop(0) + elif pip_result[0] < uv_result[0]: print(f"- {pip_result.pop(0)}") else: - print(f"+ {puffin_result.pop(0)}") + print(f"+ {uv_result.pop(0)}") elif pip_result: print(f"- {pip_result.pop(0)}") - elif puffin_result: - print(f"+ {puffin_result.pop(0)}") + elif uv_result: + print(f"+ {uv_result.pop(0)}") else: break @@ -210,7 +210,7 @@ def main(): else: profile = "dev" - check_call(["cargo", "build", "--bin", "puffin-dev", "--profile", profile]) + check_call(["cargo", "build", "--bin", "uv-dev", "--profile", profile]) if args.python: python_major = int(args.python.split(".")[0]) diff --git a/scripts/requirements/compiled/all-kinds.txt b/scripts/requirements/compiled/all-kinds.txt index ae9db650079b..0b9bd6131e35 100644 --- a/scripts/requirements/compiled/all-kinds.txt +++ b/scripts/requirements/compiled/all-kinds.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/all-kinds.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/all-kinds.in annotated-types==0.6.0 # via pydantic asgiref==3.7.2 diff --git a/scripts/requirements/compiled/black.txt b/scripts/requirements/compiled/black.txt index 7e0091fb01b2..b2669709021f 100644 --- a/scripts/requirements/compiled/black.txt +++ b/scripts/requirements/compiled/black.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/black.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/black.in black==23.12.1 click==8.1.7 # via black diff --git a/scripts/requirements/compiled/boto3.txt b/scripts/requirements/compiled/boto3.txt index 9ce07d4b6b3c..b1e6456d0785 100644 --- a/scripts/requirements/compiled/boto3.txt +++ b/scripts/requirements/compiled/boto3.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/boto3.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/boto3.in boto3==1.7.84 botocore==1.10.84 # via diff --git a/scripts/requirements/compiled/dtlssocket.txt b/scripts/requirements/compiled/dtlssocket.txt index e60389c5c010..574ded42dc6e 100644 --- a/scripts/requirements/compiled/dtlssocket.txt +++ b/scripts/requirements/compiled/dtlssocket.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/dtlssocket.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/dtlssocket.in cython==0.29.37 # via dtlssocket dtlssocket==0.1.16 diff --git a/scripts/requirements/compiled/flyte.txt b/scripts/requirements/compiled/flyte.txt index 07086180745f..5df81ae325a9 100644 --- a/scripts/requirements/compiled/flyte.txt +++ b/scripts/requirements/compiled/flyte.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/flyte.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/flyte.in absl-py==2.0.0 # via # tensorboard diff --git a/scripts/requirements/compiled/jupyter.txt b/scripts/requirements/compiled/jupyter.txt index 27979f380796..98e3c09cfe07 100644 --- a/scripts/requirements/compiled/jupyter.txt +++ b/scripts/requirements/compiled/jupyter.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.3 via the following command: -# puffin pip compile scripts/requirements/jupyter.in +# This file was autogenerated by uv v0.0.3 via the following command: +# uv pip compile scripts/requirements/jupyter.in anyio==4.2.0 # via jupyter-server argon2-cffi==23.1.0 diff --git a/scripts/requirements/compiled/pdm_2193.txt b/scripts/requirements/compiled/pdm_2193.txt index 7b919684c6bd..e8f48ee0e92a 100644 --- a/scripts/requirements/compiled/pdm_2193.txt +++ b/scripts/requirements/compiled/pdm_2193.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/pdm_2193.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/pdm_2193.in certifi==2023.11.17 # via requests charset-normalizer==3.3.2 diff --git a/scripts/requirements/compiled/scispacy.txt b/scripts/requirements/compiled/scispacy.txt index 6641dded4bd2..0358e705bbcc 100644 --- a/scripts/requirements/compiled/scispacy.txt +++ b/scripts/requirements/compiled/scispacy.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/scispacy.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/scispacy.in annotated-types==0.6.0 # via pydantic black==23.12.1 diff --git a/scripts/requirements/compiled/trio.txt b/scripts/requirements/compiled/trio.txt index baeb07396c4b..94fa5708c793 100644 --- a/scripts/requirements/compiled/trio.txt +++ b/scripts/requirements/compiled/trio.txt @@ -1,5 +1,5 @@ -# This file was autogenerated by Puffin v0.0.1 via the following command: -# puffin pip compile scripts/requirements/trio.in +# This file was autogenerated by uv v0.0.1 via the following command: +# uv pip compile scripts/requirements/trio.in alabaster==0.7.15 # via sphinx attrs==23.2.0 diff --git a/scripts/scenarios/templates/compile.mustache b/scripts/scenarios/templates/compile.mustache index c0a65b174e9c..0f4750f6149b 100644 --- a/scripts/scenarios/templates/compile.mustache +++ b/scripts/scenarios/templates/compile.mustache @@ -13,7 +13,7 @@ use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileWriteStr, PathChild}; use predicates::prelude::predicate; -use common::{create_bin_with_executables, get_bin, puffin_snapshot, TestContext, INSTA_FILTERS}; +use common::{create_bin_with_executables, get_bin, uv_snapshot, TestContext, INSTA_FILTERS}; mod common; @@ -71,7 +71,7 @@ fn {{module_name}}() -> Result<()> { {{#expected.explanation_lines}} // {{.}} {{/expected.explanation_lines}} - let output = puffin_snapshot!(filters, command(&context, python_versions) + let output = uv_snapshot!(filters, command(&context, python_versions) {{#resolver_options.prereleases}} .arg("--prerelease=allow") {{/resolver_options.prereleases}} diff --git a/scripts/scenarios/templates/install.mustache b/scripts/scenarios/templates/install.mustache index 3b621825e9d8..cbcae68f48a7 100644 --- a/scripts/scenarios/templates/install.mustache +++ b/scripts/scenarios/templates/install.mustache @@ -13,7 +13,7 @@ use assert_cmd::prelude::*; use common::{venv_to_interpreter, INSTA_FILTERS}; -use crate::common::{get_bin, puffin_snapshot, TestContext}; +use crate::common::{get_bin, uv_snapshot, TestContext}; mod common; @@ -81,7 +81,7 @@ fn {{module_name}}() { {{/packages}} filters.push((r"-{{version}}", "")); - puffin_snapshot!(filters, command(&context) + uv_snapshot!(filters, command(&context) {{#resolver_options.prereleases}} .arg("--prerelease=allow") {{/resolver_options.prereleases}} diff --git a/scripts/scenarios/update.py b/scripts/scenarios/update.py index 8015a2f4ba8c..ef788c978550 100755 --- a/scripts/scenarios/update.py +++ b/scripts/scenarios/update.py @@ -22,7 +22,7 @@ $ packse build scenarios/* $ packse publish dist/* --index-url http://localhost:3141/packages/local --anonymous - Override the default PyPI index for Puffin and update the scenarios + Override the default PyPI index for uv and update the scenarios $ PUFFIN_INDEX_URL="http://localhost:3141/packages/all/+simple" ./scripts/scenarios/update.py @@ -53,7 +53,7 @@ PACKSE = TOOL_ROOT / "packse-scenarios" REQUIREMENTS = TOOL_ROOT / "requirements.txt" PROJECT_ROOT = TOOL_ROOT.parent.parent -TESTS = PROJECT_ROOT / "crates" / "puffin" / "tests" +TESTS = PROJECT_ROOT / "crates" / "uv" / "tests" INSTALL_TESTS = TESTS / "pip_install_scenarios.rs" COMPILE_TESTS = TESTS / "pip_compile_scenarios.rs"