-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the dependency specifiers specification into the reference section
- Loading branch information
Showing
3 changed files
with
37 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Dependency specifiers | ||
|
||
uv uses | ||
[dependency specifiers](https://packaging.python.org/en/latest/specifications/dependency-specifiers/), | ||
originally standardized in [PEP 508](https://peps.python.org/pep-0508/). A dependency specifier is | ||
composed of, in order: | ||
|
||
- The dependency name | ||
- The extras you want (optional) | ||
- The version specifier | ||
- An environment marker (optional) | ||
|
||
The version specifiers are comma separated and added together, e.g., `foo >=1.2.3,<2,!=1.4.0` is | ||
interpreted as "a version of `foo` that's at least 1.2.3, but less than 2, and not 1.4.0". | ||
|
||
Specifiers are padded with trailing zeros if required, so `foo ==2` matches foo 2.0.0, too. | ||
|
||
A star can be used for the last digit with equals, e.g. `foo ==2.1.*` will accept any release from | ||
the 2.1 series. Similarly, `~=` matches where the last digit is equal or higher, e.g., `foo ~=1.2` | ||
is equal to `foo >=1.2,<2`, and `foo ~=1.2.3` is equal to `foo >=1.2.3,<1.3`. | ||
|
||
Extras are comma-separated in square bracket between name and version, e.g., | ||
`pandas[excel,plot] ==2.2`. Whitespace between extra names is ignored. | ||
|
||
Some dependencies are only required in specific environments, e.g., a specific Python version or | ||
operating system. For example to install the `importlib-metadata` backport for the | ||
`importlib.metadata` module, use `importlib-metadata >=7.1.0,<8; python_version < '3.10'`. To | ||
install `colorama` on Windows (but omit it on other platforms), use | ||
`colorama >=0.4.6,<5; platform_system == "Windows"`. | ||
|
||
Markers are combined with `and`, `or`, and parentheses, e.g., | ||
`aiohttp >=3.7.4,<4; (sys_platform != 'win32' or implementation_name != 'pypy') and python_version >= '3.10'`. | ||
Note that versions within markers must be quoted, while versions _outside_ of markers must _not_ be | ||
quoted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters