A Python project based on pyproject-template
Project description
pyprojecttest
A Python project based on pyproject-template
Features
- Modern tooling:
uvfor deps,rufffor format/lint,mypyin strict mode - CI/CD ready: GitHub Actions for checks, coverage upload, and releases
- Release automation: hatch-vcs + commitizen-driven tagging and changelog
Installation
pip install pyprojecttest
Quick Start
from pyprojecttest import greet
# Example usage
message = greet("Python")
print(message) # Output: Hello, Python!
Documentation
📚 Full documentation is available in the docs/ directory
Build and view locally:
doit docs_serve # Opens at http://127.0.0.1:8000
Key documentation files:
- Installation Guide - Setup instructions
- Usage Guide - Development workflows and commands
- API Reference - Complete API documentation
- Extensions Guide - Optional tools and extensions
Development Setup
Prerequisites
- Python 3.12+
- uv - Fast Python package installer
- direnv - Automatic environment variable loading (optional but recommended)
Quick Start
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone repository
git clone https://github.com/endavis/pyprojecttest.git
cd pyprojecttest
# Create virtual environment and install dependencies
uv sync --all-extras --dev
# Install pre-commit hooks
doit pre_commit_install
# Optional: Install direnv for automatic environment management
# macOS:
brew install direnv
# Linux (using doit helper):
doit install_direnv
# Hook direnv into your shell (one-time setup)
# Bash:
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
source ~/.bashrc
# Zsh:
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc
source ~/.zshrc
# Allow direnv to load .envrc
direnv allow
# Optional: Create .envrc.local for personal overrides
cp .envrc.local.example .envrc.local
Versioning & Releases
This project uses automated versioning and releases powered by commitizen and hatch-vcs.
- Single Source of Truth: The Git tag is the definitive version.
pyproject.tomland_version.pyare generated at build time from tags (no manual edits). - Versioning Scheme:
- Production: Standard SemVer (e.g.,
v1.0.0). - Development: SemVer Pre-release (e.g.,
v1.0.0-alpha.1,v1.0.0-beta.0).
- Production: Standard SemVer (e.g.,
Creating a Release
Production Release (PyPI):
doit release
This automated task will:
- Calculate the next version based on conventional commits.
- Update
CHANGELOG.md, merging any pre-release entries (commitizen--merge-prerelease). - Create a git tag (e.g.,
v1.0.0). - Push commits and tags to GitHub, triggering the
releaseworkflow.
Development/Pre-release (TestPyPI):
doit release_dev # Defaults to alpha
doit release_dev --type beta # Specify type (alpha, beta, rc)
This automated task will:
- Bump the version to the next pre-release (e.g.,
v1.0.0-alpha.1). - Update
CHANGELOG.mdfor the prerelease. - Create a prerelease git tag (e.g.,
v1.0.0-alpha.1). - Push to GitHub, triggering the
testpypiworkflow.
Environment Variables
This project uses direnv for automatic environment management. After setup:
.envrc(committed) contains project defaults and is loaded automatically.envrc.local(git-ignored) is for personal overrides and credentials- Environment variables are set automatically when you enter the project directory
- Virtual environment is activated automatically
Manual Setup (without direnv)
If you prefer not to use direnv:
# Create virtual environment and activate it
uv venv
source .venv/bin/activate
# Set environment variables manually
export UV_CACHE_DIR="$(pwd)/tmp/.uv_cache"
# Install dependencies
uv sync --all-extras --dev
Available Tasks
View all available tasks:
doit list
Quick Commands
# Testing
doit test # Run tests (parallel execution with pytest-xdist)
doit coverage # Run tests with coverage report
# Code Quality
doit format # Format code with ruff
doit lint # Run linting
doit type_check # Run type checking with mypy
doit check # Run ALL checks (format, lint, type check, test)
# Security
doit security # Run security scan with bandit
doit audit # Run dependency vulnerability audit
doit spell_check # Check for typos with codespell
doit licenses # Check licenses of dependencies
# Code Formatting
doit fmt_pyproject # Format pyproject.toml with pyproject-fmt
# Version Management (Commitizen)
doit commit # Interactive commit with conventional format
doit release # Production release (commitizen-driven)
doit release_dev # Pre-release/TestPyPI (commitizen-driven)
# Documentation
doit docs_serve # Serve docs locally with live reload
doit docs_build # Build documentation site
doit docs_deploy # Deploy docs to GitHub Pages
# Maintenance
doit cleanup # Clean build artifacts and caches
doit update_deps # Update dependencies and run tests
See the Usage Guide for comprehensive documentation of all development workflows.
Running Tests
# Run all tests (parallel execution - fast!)
doit test
# Run with coverage
doit coverage
# View coverage report
open tmp/htmlcov/index.html
# Advanced: Run specific test directly
uv run pytest tests/test_example.py::test_version -v
Code Quality
This project includes comprehensive tooling:
Core Tools
- uv - Fast Python package installer and dependency manager
- ruff - Extremely fast Python linter and formatter
- mypy - Static type checker with strict mode
- pytest - Testing framework with parallel execution (pytest-xdist)
Quality & Security
- bandit - Security vulnerability scanner
- codespell - Spell checker for code and documentation
- pip-audit - Dependency vulnerability auditor
- pip-licenses - License compliance checker
- pre-commit - Git hooks for automated quality checks
- pyproject-fmt - Keep pyproject.toml formatted and organized
- commitizen - Enforce conventional commit message standards
Documentation
- MkDocs - Documentation site generator
- mkdocs-material - Material Design theme for MkDocs
Run all quality checks:
doit check
Pre-commit Hooks
Install hooks to run checks automatically before each commit:
doit pre_commit_install
Hooks include:
- Code formatting (ruff)
- Type checking (mypy)
- Security scanning (bandit)
- Spell checking (codespell)
- YAML/TOML validation
- Trailing whitespace removal
- Private key detection
AI Agent Support
This template is designed primarily for Claude Code, which is the only agent that ships the full slash-command workflow (plan → implement → finalize → close-issue). Gemini CLI is supported in a narrower role as a second-opinion planner/reviewer inside Claude-orchestrated dual-agent commands, and Codex CLI is supported as a standalone alternative without slash commands. Support for additional primary agents is planned.
Requirements
Important: GitHub CLI (
gh) is required for AI-assisted workflows.Many
doittasks useghfor issue creation, PR management, and repository operations. Install and authenticate before using AI agents:# Install (macOS) brew install gh # Install (Linux) - see https://github.com/cli/cli/blob/trunk/docs/install_linux.md # Authenticate gh auth login
Features
- AGENTS.md - Instructions and protocols for AI agents
- Dangerous command blocking - Hooks prevent destructive operations (force push to main, branch deletion, etc.)
- Workflow automation -
doit issueanddoit prfor GitHub operations
See AI Agent Setup and AI Command Blocking for details.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and checks (
doit check) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CHANGELOG.md for release history.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Add acknowledgments here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyprojecttest-0.1.0.tar.gz.
File metadata
- Download URL: pyprojecttest-0.1.0.tar.gz
- Upload date:
- Size: 361.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01a5f8bb3af0cebd9754cb55e22594ff76d3d91683a22e2a01fda5eabae69231
|
|
| MD5 |
4bd37bc8d11506d707e99ba08a962061
|
|
| BLAKE2b-256 |
e44cdb8d1f9df72f05d720f72054c2ecfc8eb65f49f715d0d106d7ff6eb47924
|
Provenance
The following attestation bundles were made for pyprojecttest-0.1.0.tar.gz:
Publisher:
release.yml on endavis/pyprojecttest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyprojecttest-0.1.0.tar.gz -
Subject digest:
01a5f8bb3af0cebd9754cb55e22594ff76d3d91683a22e2a01fda5eabae69231 - Sigstore transparency entry: 1364547403
- Sigstore integration time:
-
Permalink:
endavis/pyprojecttest@72ae1f2398e53c4fbe537154b8072818db7a1417 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/endavis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@72ae1f2398e53c4fbe537154b8072818db7a1417 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyprojecttest-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyprojecttest-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef8f645576565c99a0fcdbf7a389a4a010f7b067c70da6181360e22eb54004d
|
|
| MD5 |
2b73d1b6b60250f2f3b5b4ece1607886
|
|
| BLAKE2b-256 |
de4231c073645f99b6e3be143ae02ef6115e5d4fa7d353ed13dfb1b5f6982f90
|
Provenance
The following attestation bundles were made for pyprojecttest-0.1.0-py3-none-any.whl:
Publisher:
release.yml on endavis/pyprojecttest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyprojecttest-0.1.0-py3-none-any.whl -
Subject digest:
9ef8f645576565c99a0fcdbf7a389a4a010f7b067c70da6181360e22eb54004d - Sigstore transparency entry: 1364547430
- Sigstore integration time:
-
Permalink:
endavis/pyprojecttest@72ae1f2398e53c4fbe537154b8072818db7a1417 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/endavis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@72ae1f2398e53c4fbe537154b8072818db7a1417 -
Trigger Event:
push
-
Statement type: