A modern Python monorepo template using uv for fast dependency management and workspace organization.
This project uses a uv workspace structure:
.
├── apps/
│ └── sample-app/ # Sample application package (rename this)
│ ├── src/ # Source code
│ ├── tests/ # Tests
│ └── pyproject.toml # Package configuration
├── .cline/ # Cline AI assistant configuration
│ ├── specs/ # Project specifications and documentation
│ └── workspace_rules/ # Workspace-specific rules for Cline
├── .github/
│ └── workflows/ # GitHub Actions workflows
├── pyproject.toml # Workspace configuration
├── release-please-config.json # Release Please configuration
├── .release-please-manifest.json # Release Please manifest
└── README.md # This file
- Python 3.11+
- uv package manager
Before using this template, you'll need to replace the following placeholder values:
-
Project Name: Replace
sample-appthroughout the codebase with your actual project name:- Directory name:
apps/sample-app/→apps/your-project-name/ - Package name in
apps/sample-app/pyproject.toml - Import statements in source code
- Script entry points
- Directory name:
-
Template Placeholders: Replace any remaining template placeholders:
{{project_name}}in configuration files- Author information in
pyproject.tomlfiles - Repository URLs and descriptions
-
Package Structure: Update the package structure in
apps/sample-app/src/sample_app/to match your project name
- Clone the repository:
git clone <repository-url>
cd your-project-name- Install dependencies using uv:
uv sync- Install pre-commit hooks:
uv run pre-commit install# Run the sample app (update command after renaming)
uv run python -m sample_app
# Or use the script entry point
uv run sample-app# Run all tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=src --cov-report=html
# Run tests for a specific app
uv run pytest apps/sample-app/tests/# Format code
uv run ruff format
# Lint code
uv run ruff check
# Fix linting issues automatically
uv run ruff check --fix
# Run pre-commit hooks
uv run pre-commit run --all-filesThis template includes a .cline/ directory for enhanced AI-assisted development:
.cline/specs/: Store project specifications, requirements, and documentation that help Cline understand your project context.cline/workspace_rules/: Define workspace-specific rules and patterns for Cline to follow
To use with Cline:
- Install the Cline VS Code extension
- Add your project specifications to
.cline/specs/ - Configure workspace rules in
.cline/workspace_rules/
- Create a new branch for your feature/fix
- Make your changes
- Run tests and ensure they pass
- Run code quality checks
- Commit your changes (pre-commit hooks will run automatically)
- Push your branch and create a pull request
To add a new application to the workspace:
- Create a new directory under
apps/:
mkdir apps/new-app-
Create a
pyproject.tomlfile following the pattern inapps/sample-app/pyproject.toml -
Set up the source structure:
mkdir -p apps/new-app/src/new_app
mkdir -p apps/new-app/tests- The workspace will automatically detect the new app after running
uv sync
This project uses Release Please for automated releases:
- Releases are triggered by merging to the
mainbranch - Version bumps are determined by conventional commit messages
- Changelog is automatically generated
- GitHub releases are created automatically
Use conventional commit messages for automatic version bumping:
feat:- New features (minor version bump)fix:- Bug fixes (patch version bump)feat!:orfix!:- Breaking changes (major version bump)docs:,style:,refactor:,test:,chore:- No version bump
- Fast dependency management with uv
- Monorepo structure for multiple related packages
- Pre-commit hooks for code quality
- Automated testing with pytest and coverage
- Code formatting with ruff
- Automated releases with Release Please
- AI assistant integration with Cline configuration
- GitHub Actions workflows for CI/CD
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass and code quality checks pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.