2024-08-22 03:34:10 +05:30
|
|
|
# uv
|
|
|
|
|
|
|
|
> A fast Python package and project manager.
|
2024-10-04 21:14:41 +02:00
|
|
|
> Some subcommands such as `tool` and `python` have their own usage documentation.
|
2024-08-22 03:34:10 +05:30
|
|
|
> More information: <https://docs.astral.sh/uv/reference/cli>.
|
|
|
|
|
|
|
|
- Create a new Python project in the current directory:
|
|
|
|
|
|
|
|
`uv init`
|
|
|
|
|
2025-01-22 14:10:36 +01:00
|
|
|
- Create a new Python project at the specified path:
|
2024-08-22 03:34:10 +05:30
|
|
|
|
2025-01-22 14:10:36 +01:00
|
|
|
`uv init {{path/to/directory}}`
|
2024-08-22 03:34:10 +05:30
|
|
|
|
2025-01-22 14:10:36 +01:00
|
|
|
- Add a new dependency to the project:
|
2024-08-22 03:34:10 +05:30
|
|
|
|
|
|
|
`uv add {{package}}`
|
|
|
|
|
2025-01-22 14:10:36 +01:00
|
|
|
- Remove a dependency from the project:
|
2024-08-22 03:34:10 +05:30
|
|
|
|
|
|
|
`uv remove {{package}}`
|
|
|
|
|
|
|
|
- Run a script in the project's environment:
|
|
|
|
|
|
|
|
`uv run {{path/to/script.py}}`
|
|
|
|
|
|
|
|
- Run a command in the project's environment:
|
|
|
|
|
|
|
|
`uv run {{command}}`
|
|
|
|
|
|
|
|
- Update a project's environment from `pyproject.toml`:
|
|
|
|
|
|
|
|
`uv sync`
|
|
|
|
|
|
|
|
- Create a lock file for the project's dependencies:
|
|
|
|
|
|
|
|
`uv lock`
|