This guide covers the essential steps to get up and running with a project generated by cookiecutter-robust-python. Perfect for developers who want to start coding with the core workflows immediately.
For detailed tool explanations and project philosophy, see the full documentation.
Make sure you have these installed:
- Python 3.10+ (or your chosen template version).
- Git.
- uv: Our chosen dependency manager. Install it {uv-install}
officially<>. - Docker or Podman: If you plan to work with containers (most web apps will need this). Install {docker-install}
Docker<>or {podman-install}Podman<>.
Navigate to the directory you want to create your new project in.
cd ~/path/to/my/reposGenerate your project from the template:
uvx cruft create https://github.com/robust-python/cookiecutter-robust-python.gitFollow the prompts to customize your project.
Navigate to your new project directory:
cd your-project-slugSet up the virtual environment and install dependencies:
uvx nox -s setup-venvThis sets up a virtual environment with uv and installs all development dependencies.
Set up automated checks that run before you commit code:
uvx nox -s pre-commit -- installNow, git commit will automatically run code formatting and basic linting checks on staged files.
Run quality checks and tests using the nox sessions:
uvx nox -s lint-python # Run Ruff linting
uvx nox -s typecheck # Run Basedpyright type checking
uvx nox -s security-python # Run Bandit and pip-audit
uvx nox -s tests-python # Run pytest with coverageThese commands run in isolated environments with the proper Python versions as defined in noxfile.py.
Build and serve the project documentation locally:
uvx nox -s docs # Build and serve with live reload
uvx nox -s build-docs # Build only (static files)The docs session builds and serves documentation with automatic reload on changes.
- Start writing your code in the
src/directory! - Add and remove dependencies using
uv add <package>anduv remove <package>. - If building a web application, explore the
Dockerfileandcompose.yaml(Application Container Building, Container Orchestration). - Set up CI/CD using the example workflow files (e.g., in
.github/workflows/).
For detailed information on any of these tools or workflows, navigate through the template's full documentation.