Skip to content

Commit a455ce9

Browse files
committed
docs: list supported sdist formats
1 parent aa3297a commit a455ce9

File tree

8 files changed

+44
-30
lines changed

8 files changed

+44
-30
lines changed

crates/uv-cli/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3562,7 +3562,7 @@ pub struct IndexArgs {
35623562
/// indexes.
35633563
///
35643564
/// If a path, the target must be a directory that contains packages as wheel files (`.whl`) or
3565-
/// source distributions (`.tar.gz` or `.zip`) at the top level.
3565+
/// source distributions (usually `.tar.gz` or `.zip`) at the top level.
35663566
///
35673567
/// If a URL, the page must contain a flat list of links to package files adhering to the
35683568
/// formats described above.

crates/uv-settings/src/settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ pub struct ResolverInstallerOptions {
318318
/// indexes.
319319
///
320320
/// If a path, the target must be a directory that contains packages as wheel files (`.whl`) or
321-
/// source distributions (`.tar.gz` or `.zip`) at the top level.
321+
/// source distributions (usually `.tar.gz` or `.zip`) at the top level.
322322
///
323323
/// If a URL, the page must contain a flat list of links to package files adhering to the
324324
/// formats described above.
@@ -705,7 +705,7 @@ pub struct PipOptions {
705705
/// indexes.
706706
///
707707
/// If a path, the target must be a directory that contains packages as wheel files (`.whl`) or
708-
/// source distributions (`.tar.gz` or `.zip`) at the top level.
708+
/// source distributions (usually `.tar.gz` or `.zip`) at the top level.
709709
///
710710
/// If a URL, the page must contain a flat list of links to package files adhering to the
711711
/// formats described above.

docs/concepts/dependencies.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ A `subdirectory` may be specified if the package isn't in the repository root.
128128
### URL
129129

130130
To add a URL source, provide a `https://` URL to either a wheel (ending in `.whl`) or a source
131-
distribution (ending in `.zip` or `.tar.gz`).
131+
distribution (usually ending in `.tar.gz` or `.zip`,
132+
see [here](../concepts/resolution.md#source-distribution) for all supported formats).
132133

133134
For example:
134135

@@ -149,13 +150,14 @@ httpx = { url = "https://files.pythonhosted.org/packages/5c/2d/3da5bdf4408b8b280
149150
```
150151

151152
URL dependencies can also be manually added or edited in the `pyproject.toml` with the
152-
`{ url = <url> }` syntax. A `subdirectory` may be specified if the if the source distribution isn't
153-
in the archive root.
153+
`{ url = <url> }` syntax. A `subdirectory` may be specified if the source distribution isn't in the
154+
archive root.
154155

155156
### Path
156157

157-
To add a path source, provide the path of a wheel (ending in `.whl`), a source distribution (ending
158-
in `.zip` or `.tar.gz`), or a directory containing a `pyproject.toml`.
158+
To add a path source, provide the path of a wheel (ending in `.whl`), a source distribution (usually
159+
ending in `.tar.gz` or `.zip`, see [here](../concepts/resolution.md#source-distribution) for all
160+
supported formats), or a directory containing a `pyproject.toml`.
159161

160162
For example:
161163

docs/concepts/projects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@ To distribute your project to others (e.g., to upload it to an index like PyPI),
560560
build it into a distributable format.
561561

562562
Python projects are typically distributed as both source distributions (sdists) and binary
563-
distributions (wheels). The former is a `.tar.gz` file containing the project's source code along
564-
with some additional metadata, while the latter is a `.whl` file containing pre-built artifacts that
565-
can be installed directly.
563+
distributions (wheels). The former is usually a `.tar.gz` or `.zip` file containing the project's
564+
source code along with some additional metadata, while the latter is a `.whl` file containing
565+
pre-built artifacts that can be installed directly.
566566

567567
`uv build` can be used to build both source distributions and binary distributions for your project.
568568
By default, `uv build` will build the project in the current directory, and place the built

docs/concepts/resolution.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@ To ensure reproducibility, messages for unsatisfiable resolutions will not menti
296296
distributions were excluded due to the `--exclude-newer` flag — newer distributions will be treated
297297
as if they do not exist.
298298

299+
## Source distribution
300+
301+
Most packages publish their source distributions as gzip tarball (`.tar.gz`) or zip (`.zip`)
302+
archives, but while less common, other formats exist. uv supports the following formats and
303+
extensions when reading and extracting source distributions:
304+
305+
- bzip2 tarball (`.tar.bz2`)
306+
- gzip tarball (`.tar.gz`)
307+
- xz tarball (`.tar.xz`)
308+
- zip (`.zip`)
309+
- zstd tarball (`.tar.zst`)
310+
299311
## Learn more
300312

301313
For more details about the internals of the resolver, see the

docs/reference/cli.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ uv run [OPTIONS] <COMMAND>
136136
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
137137
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
138138

139-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
139+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
140140

141141
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
142142

@@ -610,7 +610,7 @@ uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>
610610
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
611611
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
612612

613-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
613+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
614614

615615
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
616616

@@ -910,7 +910,7 @@ uv remove [OPTIONS] <PACKAGES>...
910910
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
911911
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
912912

913-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
913+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
914914

915915
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
916916

@@ -1198,7 +1198,7 @@ uv sync [OPTIONS]
11981198
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
11991199
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
12001200

1201-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
1201+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
12021202

12031203
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
12041204

@@ -1479,7 +1479,7 @@ uv lock [OPTIONS]
14791479
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
14801480
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
14811481

1482-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
1482+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
14831483

14841484
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
14851485

@@ -1742,7 +1742,7 @@ uv export [OPTIONS]
17421742
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
17431743
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
17441744

1745-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
1745+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
17461746

17471747
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
17481748

@@ -2028,7 +2028,7 @@ uv tree [OPTIONS]
20282028
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
20292029
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
20302030

2031-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
2031+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
20322032

20332033
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
20342034

@@ -2383,7 +2383,7 @@ uv tool run [OPTIONS] [COMMAND]
23832383
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
23842384
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
23852385

2386-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
2386+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
23872387

23882388
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
23892389

@@ -2651,7 +2651,7 @@ uv tool install [OPTIONS] <PACKAGE>
26512651
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
26522652
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
26532653

2654-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
2654+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
26552655

26562656
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
26572657

@@ -2919,7 +2919,7 @@ uv tool upgrade [OPTIONS] <NAME>...
29192919
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
29202920
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
29212921

2922-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
2922+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
29232923

29242924
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
29252925

@@ -4302,7 +4302,7 @@ uv pip compile [OPTIONS] <SRC_FILE>...
43024302
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
43034303
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
43044304

4305-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
4305+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
43064306

43074307
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
43084308

@@ -4674,7 +4674,7 @@ uv pip sync [OPTIONS] <SRC_FILE>...
46744674
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
46754675
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
46764676

4677-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
4677+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
46784678

46794679
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
46804680

@@ -5000,7 +5000,7 @@ uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITAB
50005000
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
50015001
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
50025002

5003-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
5003+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
50045004

50055005
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
50065006

@@ -6057,7 +6057,7 @@ uv venv [OPTIONS] [PATH]
60576057
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
60586058
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
60596059

6060-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
6060+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
60616061

60626062
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
60636063

@@ -6282,7 +6282,7 @@ uv build [OPTIONS] [SRC]
62826282
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p>
62836283
</dd><dt><code>--find-links</code>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
62846284

6285-
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (<code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
6285+
<p>If a path, the target must be a directory that contains packages as wheel files (<code>.whl</code>) or source distributions (usually <code>.tar.gz</code> or <code>.zip</code>) at the top level.</p>
62866286

62876287
<p>If a URL, the page must contain a flat list of links to package files adhering to the formats described above.</p>
62886288

docs/reference/settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ Locations to search for candidate distributions, in addition to those found in t
370370
indexes.
371371

372372
If a path, the target must be a directory that contains packages as wheel files (`.whl`) or
373-
source distributions (`.tar.gz` or `.zip`) at the top level.
373+
source distributions (usually `.tar.gz` or `.zip`) at the top level.
374374

375375
If a URL, the page must contain a flat list of links to package files adhering to the
376376
formats described above.
@@ -1662,7 +1662,7 @@ Locations to search for candidate distributions, in addition to those found in t
16621662
indexes.
16631663

16641664
If a path, the target must be a directory that contains packages as wheel files (`.whl`) or
1665-
source distributions (`.tar.gz` or `.zip`) at the top level.
1665+
source distributions (usually `.tar.gz` or `.zip`) at the top level.
16661666

16671667
If a URL, the page must contain a flat list of links to package files adhering to the
16681668
formats described above.

uv.schema.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)