Skip to content

Commit

Permalink
Link to Dependency specifiers instead of PEP 508 (#8411)
Browse files Browse the repository at this point in the history
The canonical source is
https://packaging.python.org/en/latest/specifications/dependency-specifiers/,
not PEP 508 anymore, so we should link there and use the new name.
  • Loading branch information
konstin authored Oct 21, 2024
1 parent 40f842d commit 0dd4d01
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
4 changes: 3 additions & 1 deletion crates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Utilities for interacting with Python version numbers and specifiers.

## [uv-pep508-rs](./uv-pep508)

Utilities for interacting with [PEP 508](https://peps.python.org/pep-0508/) dependency specifiers.
Utilities for parsing and evaluating
[dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/),
previously known as [PEP 508](https://peps.python.org/pep-0508/).

## [uv-platform-tags](./uv-platform-tags)

Expand Down
4 changes: 2 additions & 2 deletions crates/uv-pep508/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![Crates.io](https://img.shields.io/crates/v/pep508_rs.svg?logo=rust&style=flat-square)](https://crates.io/crates/pep508_rs)
[![PyPI](https://img.shields.io/pypi/v/pep508_rs.svg?logo=python&style=flat-square)](https://pypi.org/project/pep508_rs)

A library for python
A library for
[dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/),
better known as [PEP 508](https://peps.python.org/pep-0508/).
previously known as [PEP 508](https://peps.python.org/pep-0508/).

## Usage

Expand Down
4 changes: 2 additions & 2 deletions crates/uv-pep508/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! A library for python [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/)
//! better known as [PEP 508](https://peps.python.org/pep-0508/)
//! A library for [dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/)
//! previously known as [PEP 508](https://peps.python.org/pep-0508/)
//!
//! ## Usage
//!
Expand Down
22 changes: 13 additions & 9 deletions docs/concepts/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ bird-feeder = { path = "./packages/bird-feeder" }
## Project dependencies

The `project.dependencies` table represents the dependencies that are used when uploading to PyPI or
building a wheel. Individual dependencies are specified using [PEP 508](#pep-508) syntax, and the
table follows the [PEP 621](https://packaging.python.org/en/latest/specifications/pyproject-toml/)
standard.
building a wheel. Individual dependencies are specified using
[dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/)
syntax, and the table follows the
[PEP 621](https://packaging.python.org/en/latest/specifications/pyproject-toml/) standard.

`project.dependencies` defines the list of packages that are required for the project, along with
the version constraints that should be used when installing them. Each entry includes a dependency
Expand Down Expand Up @@ -248,8 +249,8 @@ members = [
### Platform-specific sources

You can limit a source to a given platform or Python version by providing
[PEP 508](https://peps.python.org/pep-0508/#environment-markers)-compatible environment markers for
the source.
[dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/)-compatible
environment markers for the source.

For example, to pull `httpx` from GitHub, but only on macOS, use the following:

Expand Down Expand Up @@ -320,7 +321,8 @@ installation of Excel parsers and `matplotlib` unless someone explicitly require
requested with the `package[<extra>]` syntax, e.g., `pandas[plot, excel]`.

Optional dependencies are specified in `[project.optional-dependencies]`, a TOML table that maps
from extra name to its dependencies, following [PEP 508](#pep-508) syntax.
from extra name to its dependencies, following
[dependency specifiers](#dependency-specifiers-pep-508) syntax.

Optional dependencies can have entries in `tool.uv.sources` the same as normal dependencies.

Expand Down Expand Up @@ -437,10 +439,12 @@ Or, to opt-out of using an editable dependency in a workspace:
$ uv add --no-editable ./path/foo
```

## PEP 508
## Dependency specifiers (PEP 508)

[PEP 508](https://peps.python.org/pep-0508/) defines a syntax for dependency specification. It is
composed of, in order:
uv uses
[dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/),
previously known as [PEP 508](https://peps.python.org/pep-0508/). A dependency specifier is composed
of, in order:

- The dependency name
- The extras you want (optional)
Expand Down

0 comments on commit 0dd4d01

Please sign in to comment.