2.4 KiB
Development
This project is managed using UV, a fast Python package and project manager. Install the latest version of UV before continuing. Development requires Python 3.11 to 3.14.
Set up
Starting from Zero? Not sure where to begin? Here are the steps to set up this Python project using UV. Note that UV installation instructions should be followed from the UV Docs: https://docs.astral.sh/uv/getting-started/installation/
-
Clone the Repository:
git clone https://github.com/unshackle-dl/unshackle cd unshackle -
Install the Project with UV:
uv syncThis creates a Virtual environment and then installs all project dependencies and executables into the Virtual environment. Your System Python environment is not affected at all.
-
Run commands in the Virtual environment:
uv run unshackleNote:
- UV automatically manages the virtual environment for you - no need to manually activate it
- You can use
uv runto prefix any command you wish to run under the Virtual environment - For example:
uv run unshackle --helpto run the main application - JetBrains PyCharm and Visual Studio Code will automatically detect the UV-managed virtual environment
- For more information, see: https://docs.astral.sh/uv/concepts/projects/
-
Install the pre-commit hooks, which check each commit:
uv run pre-commit install
Checks
CI runs these checks on each pull request and on each push to dev and main. Run them before you open a pull request.
-
Install the test dependencies.
uv syncalone installs only thedevgroup:uv sync --all-groups -
Run the unit tests. The markers skip the tests that need a live server or the network:
uv run pytest -n auto --dist worksteal -m "not live and not slow" -
Run the linters, the type check and the security lint:
uv run ruff check . uv run ruff format --check . uv run isort --check-only unshackle tests --skip-glob "*/services/*" uv run mypy unshackle uv run bandit -q -c pyproject.toml -r unshackle --severity-level medium --confidence-level medium
To get a coverage report, run the tests with the coverage option:
uv run pytest -n auto --dist worksteal -m "not live and not slow" --cov