This is a template for a python project using rye
as a package manager.
Rye is a comprehensive project and package management solution for Python. Docs can be found here. The dependencies are managed via the pyproject.toml
file.
- Add a [development] dependency:
rye add [--dev] <package_name>
- Add an optional dependency, e.g., for an interface:
rye add --optional interface streamlit
- Remove a dependency:
rye remove <package_name>
- Sync virtual environment with last settings (default is to sync normal and dev, but no optional dependencies):
rye sync
- When you want to change the last settings pass the
--reset
--no-dev
excludes the development dependencies- To install optional features use the
--feature
flag:rye sync --features interface
- To self update run:
rye self update
Check whether your code is properly tested: coverage .
Check whether your code is used: vulture . [--min-confidence <int>]
Lint your code: pylint .
I acutally don't know if this is much different from rye fmt
and rye lint, but I usually use (with the alias
ru`):
- Formatting:
ruff format
- Linting and fixing:
ruff check --fix