uv/crates
Charlie Marsh 9a92a3ad37
Apply advisory locks when building source distributions (#3525)
## Summary

I don't love this, but it turns out that setuptools is not robust to
parallel builds: https://github.com/pypa/setuptools/issues/3119. As a
result, if you run uv from multiple processes, and they each attempt to
build the same source distribution, you can hit failures.

This PR applies an advisory lock to the source distribution directory.
We apply it unconditionally, even if we ultimately find something in the
cache and _don't_ do a build, which helps ensure that we only build the
distribution once (and wait for that build to complete) rather than
kicking off builds from each thread.

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

## Test Plan

Ran:

```sh
#!/bin/bash
make_venv(){
    target/debug/uv venv $1
    source $1/bin/activate
    target/debug/uv pip install opentracing --no-deps --verbose
}

for i in {1..8}
do
   make_venv ./$1/$i &
done
```
2024-05-13 10:42:20 -04:00
..
bench Get cargo shear passing (#3533) 2024-05-13 01:43:45 +00:00
cache-key Avoid panic for file url (#3306) 2024-04-29 16:39:16 +02:00
distribution-filename require serde and rkyv everywhere; remove optional serde and rkyv features (#3345) 2024-05-03 10:21:03 -04:00
distribution-types Make Directory its own distribution kind (#3519) 2024-05-13 10:03:14 -04:00
install-wheel-rs Apply normcase to line from easy-install.pth (#3451) 2024-05-08 10:40:21 +02:00
once-map once-map: avoid hard-coding Arc (#3242) 2024-04-24 11:11:46 -04:00
pep440-rs Fix a few typos found by codespell (#3543) 2024-05-13 11:55:10 +00:00
pep508-rs Remove unused dependencies (#3527) 2024-05-11 13:33:49 -04:00
platform-tags Update Rust to v1.78 (#3361) 2024-05-03 20:07:13 +00:00
pypi-types Use Metadata10 to parse PKG-INFO of legacy editable (#3450) 2024-05-08 10:58:18 +02:00
requirements-txt Remove unused dependencies (#3527) 2024-05-11 13:33:49 -04:00
uv Apply advisory locks when building source distributions (#3525) 2024-05-13 10:42:20 -04:00
uv-auth Update pre-commit dependencies (#3391) 2024-05-06 02:18:51 +00:00
uv-build Avoid keyword arguments for PEP 517 build hooks (#3517) 2024-05-10 17:15:08 -04:00
uv-cache Apply advisory locks when building source distributions (#3525) 2024-05-13 10:42:20 -04:00
uv-client Fix a few typos found by codespell (#3543) 2024-05-13 11:55:10 +00:00
uv-configuration Remove unused dependencies (#3527) 2024-05-11 13:33:49 -04:00
uv-dev Consolidate concurrency limits (#3493) 2024-05-10 12:43:08 -04:00
uv-dispatch Get cargo shear passing (#3533) 2024-05-13 01:43:45 +00:00
uv-distribution Apply advisory locks when building source distributions (#3525) 2024-05-13 10:42:20 -04:00
uv-extract Remove unused seek methods (#3526) 2024-05-11 17:31:32 +00:00
uv-fs Get cargo shear passing (#3533) 2024-05-13 01:43:45 +00:00
uv-git Fix a few typos found by codespell (#3543) 2024-05-13 11:55:10 +00:00
uv-installer Make Directory its own distribution kind (#3519) 2024-05-13 10:03:14 -04:00
uv-interpreter Create virtualenv if it doesn't exist in project API (#3499) 2024-05-10 14:10:13 +00:00
uv-normalize Improve JSON Schema and add export script (#3461) 2024-05-08 16:15:16 +00:00
uv-requirements Make Directory its own distribution kind (#3519) 2024-05-13 10:03:14 -04:00
uv-resolver Make Directory its own distribution kind (#3519) 2024-05-13 10:03:14 -04:00
uv-trampoline Use c-string literals and update trampolines (#2590) 2024-03-21 15:36:00 +00:00
uv-types Remove unused dependencies (#3527) 2024-05-11 13:33:49 -04:00
uv-version Bump version to v0.1.42 (#3472) 2024-05-08 17:47:16 -04:00
uv-virtualenv Update activate_this.py to use runpy instead of exec in the docstring (#3442) 2024-05-13 01:21:24 +00:00
uv-warnings Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
uv-workspace Consolidate concurrency limits (#3493) 2024-05-10 12:43:08 -04:00
README.md Rename uv-traits and split into separate modules (#2674) 2024-03-26 15:39:43 -05:00

Crates

bench

Functionality for benchmarking uv.

cache-key

Generic functionality for caching paths, URLs, and other resources across platforms.

distribution-filename

Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.

distribution-types

Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.

install-wheel-rs

Install built distributions (wheels) into a virtual environment.]

once-map

A waitmap-like concurrent hash map for executing tasks exactly once.

pep440-rs

Utilities for interacting with Python version numbers and specifiers.

pep508-rs

Utilities for interacting with PEP 508 dependency specifiers.

platform-host

Functionality for detecting the current platform (operating system, architecture, etc.).

platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

uv

Command-line interface for the uv package manager.

uv-build

A PEP 517-compatible build frontend for uv.

uv-cache

Functionality for caching Python packages and associated metadata.

uv-client

Client for interacting with PyPI-compatible HTTP APIs.

uv-dev

Development utilities for uv.

uv-dispatch

A centralized struct for resolving and building source distributions in isolated environments. Implements the traits defined in uv-types.

uv-distribution

Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.

uv-extract

Utilities for extracting files from archives.

uv-fs

Utilities for interacting with the filesystem.

uv-git

Functionality for interacting with Git repositories.

uv-installer

Functionality for installing Python packages into a virtual environment.

uv-interpreter

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

uv-package

Types and functionality for working with Python packages, e.g., parsing wheel files.

uv-requirements

Utilities for reading package requirements from pyproject.toml and requirements.txt files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-types

Shared traits for uv, to avoid circular dependencies.

pypi-types

General-purpose type definitions for types used in PyPI-compatible APIs.

uv-virtualenv

A venv replacement to create virtual environments in Rust.

uv-warnings

User-facing warnings for uv.

requirements-txt

Functionality for parsing requirements.txt files.