1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-10 11:33:33 +02:00

uv-{build,cache,export,publish,self}: add pages (#16906)

Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
This commit is contained in:
Meinard Francisco 2025-06-21 06:44:05 +08:00 committed by GitHub
parent 97ed6362c0
commit 595818316a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 164 additions and 0 deletions

36
pages/common/uv-build.md Normal file
View file

@ -0,0 +1,36 @@
# uv build
> Build Python packages into source distributions and wheels.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-build>.
- Build a package in the current directory:
`uv build`
- Build a package from a specific directory:
`uv build {{path/to/directory}}`
- Build only a wheel (skip source distribution):
`uv build --wheel`
- Build only a source distribution (skip wheel):
`uv build --sdist`
- Build and output to a specific directory:
`uv build {{[-o|--out-dir]}} {{path/to/output}}`
- Build a specific package in a workspace:
`uv build --package {{package_name}}`
- Build all packages in the workspace:
`uv build {{[--all|--all-packages]}}`
- Build with a specific Python interpreter:
`uv build {{[-p|--python]}} {{python3.11}}`

32
pages/common/uv-cache.md Normal file
View file

@ -0,0 +1,32 @@
# uv cache
> Manage `uv`'s global cache directory.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-cache>.
- Show the cache directory path:
`uv cache dir`
- Clean the entire cache (removes all cached packages and environments):
`uv cache clean`
- Clean the cache for specific packages:
`uv cache clean {{package1 package2 ...}}`
- Prune all unreachable objects from the cache:
`uv cache prune`
- Prune cache optimized for CI environments like GitHub Actions:
`uv cache prune --ci`
- Use a specific cache directory:
`uv cache clean --cache-dir {{path/to/cache}}`
- Clean cache with verbose output:
`uv cache clean {{[-v|--verbose]}}`

36
pages/common/uv-export.md Normal file
View file

@ -0,0 +1,36 @@
# uv export
> Export the project's lockfile to an alternate format.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-export>.
- Export dependencies to a `requirements.txt` file:
`uv export --format requirements-txt {{[-o|--output-file]}} {{requirements.txt}}`
- Export dependencies to `pylock.toml` format:
`uv export --format pylock.toml`
- Export only production dependencies (exclude dev dependencies):
`uv export --no-dev`
- Export including a specific optional dependency group:
`uv export --extra {{group_name}}`
- Export including all optional dependencies:
`uv export --all-extras`
- Export including a specific dependency group:
`uv export --group {{group_name}}`
- Export without hashes:
`uv export --no-hashes`
- Export dependencies for a specific package in the workspace:
`uv export --package {{package_name}}`

View file

@ -0,0 +1,28 @@
# uv publish
> Upload distributions to an index.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-publish>.
- Publish packages from `dist/` directory (default behavior):
`uv publish`
- Publish to a specific repository URL:
`uv publish --publish-url {{https://upload.pypi.org/legacy/}}`
- Publish using a specific username and password:
`uv publish {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}}`
- Publish using an API token:
`uv publish {{[-t|--token]}} {{your_api_token}}`
- Publish specific distribution files:
`uv publish {{path/to/dist/*.whl}} {{path/to/dist/*.tar.gz}}`
- Publish to TestPyPI for testing:
`uv publish --publish-url https://test.pypi.org/legacy/`

32
pages/common/uv-self.md Normal file
View file

@ -0,0 +1,32 @@
# uv self
> Manage the `uv` executable itself.
> More information: <https://docs.astral.sh/uv/reference/cli/#uv-self>.
- Update `uv` to the latest version:
`uv self update`
- Update `uv` to a specific version:
`uv self update {{0.4.0}}`
- Check for available `uv` updates without installing:
`uv self update --dry-run`
- Update `uv` with verbose output:
`uv self update {{[-v|--verbose]}}`
- Display the current `uv` version:
`uv self version`
- Display only the version number:
`uv self version --short`
- Display version information in JSON format:
`uv self version --output-format json`