A step-by-step guide to get productive with this Python project template.
- Python 3.10-3.13 (3.11 recommended)
- Git
- uv (recommended) or poetry
uv is a blazing-fast Python package manager written in Rust.
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Verify
uv --versionpip install poetry
poetry --version# Clone the template
git clone https://github.com/SongshGeo/project_template.git my-project
cd my-project
# Optional: reset git history
rm -rf .git
git initmake configure-project
# or run directly
python scripts/configure_project.pyThe script asks for:
- Project name (e.g.,
my-awesome-project) - Project description (e.g.,
An awesome Python project)
What it does:
- Update
pyproject.toml[project]and[tool.poetry] - Update
.github/workflows/release-please.yml - Create
README.md - Clear
CHANGELOG.md
Example output:
Project name: my-awesome-project
Project description: An awesome Python project
✓ Updated pyproject.toml
✓ Updated .github/workflows/release-please.yml
✨ Project configuration completed!
# All extras (dev + docs)
uv sync --all-extras
# Dev only
uv sync --devpoetry installpre-commit install
pre-commit run --all-files# Using Makefile
make test
# Or directly
uv run pytest
poetry run pytestTest report:
make reportsrc/
├── core/ # Core logic
└── api/ # API layer
tests/
├── conftest.py # pytest config
├── test_configure_project.py # config script tests
└── test_*.py # other tests
tests/test_configure_project.pyverifies the config script.
Run tests:
make test
# or
uv run pytest- Add code under
src/ - Add matching tests under
tests/ - Run tests
Example test:
# tests/test_my_module.py
def test_my_function():
"""Test my function."""
from src.my_module import my_function
assert my_function() == expected_valueUsing uv:
uv add numpy pandas # runtime deps
uv add --dev pytest-cov # dev deps
uv add --dev mkdocs # docs depsUsing poetry:
poetry add numpy pandas
poetry add --group dev pytest-covuv run python src/your_script.py
poetry run python src/your_script.py
# Or activate virtual env
uv shell
poetry shellmake tox # Python 3.10-3.13
make tox-e pyversion=py311 # specific version
make tox-list # list envspre-commit run --all-files
pre-commit run black --all-files
pre-commit run flake8 --all-files
pre-commit run interrogate --all-filesblack .
ruff format .
flake8 src/
mypy src/
interrogate src/- Read Tooling
- See Configuration
- Review Development Guide
- Check Deployment
uv is faster (Rust). poetry is mature. The template supports both.
- uv:
.venvby default - poetry: manages its own venv
Check paths:
uv info
poetry env infoEdit tox.ini envlist:
envlist = py310, py311, py312, py313uv run mkdocs serve
uv run mkdocs buildDocs output to site/.
See Deployment for the PyPI section.