A copier template for scaffolding Python packages and apps (FastAPI and Gradio) using Poetry as package manager and Development Containers as reproducible development environment.
This template is a loose port of the Radix Poetry Cookiecutter and comes with the same LICENSE.
Check out the following demos for examples of scaffolded projects using this template:
- FastAPI App with GitHub Actions: poetry-copier-fastapi-demo
- Python Package with GitHub Actions: poetry-copier-package-demo
- FastAPI App with GitLab CI/CD: poetry-copier-fastapi-demo-gitlab
- Python Package GitLab CI/CD: poetry-copier-package-demo-gitlab
- 🐳 Reproducible Docker based development environments with Docker Compose and Development Containers
- 🤝 Integrated support for VSCode with VSCode Dev Containers and GitHub Codespaces
- 🐍 Scaffold a Python package or a FastAPI app with Pydantic V2, Django app, Streamlit app or Gradio app to demo Machine Learning models
- 📦 Dependency management with Poetry
- 🏃 Task running with Poe the Poet
- ✍️ Code formatting with Ruff
- ✅ Code linting with Pre-commit, Mypy, and Ruff
- 🧪 Test coverage with Coverage.py and Pytest
- ♻️ Continuous integration with GitHub Actions or GitLab CI/CD
- 🧰 Dependency updates with Dependabot (only with GitHub Actions)
- 🚧 Interactive scaffolding and updates with Copier
- Install the latest copier in your Python environment (please use python>=3.8):
pip install "copier>=9.2.0"
- Create a new repository and clone it locally.
- Run copier in your cloned directory:
copier copy --vcs-ref=v0.4.1 git@github.com:lukin0110/poetry-copier.git .
copier update --vcs-ref=HEAD --defaults
More information on how to update a project and resolve conflicts can be found in the Copier documentation.
This template aims to provide a minimal, but fully functional, project structure for any python project. Focus on what matters: coding!
Setting up a project can be tedious and requires a lot of "plumbing" to get CI/CD
right, to get pyproject.toml
right, to get the Dockerfile
right, etc.
The use of Docker in conjunction with Development Containers are key in this template to provide a smooth development experience. It's possible to develop without a Development Container and use Poetry with virtual environments straight away, however this template is optimized to provide a working development environment with development containers.
Note
This template is not a good fit if you don't want to work with Docker and/or Development Containers.
- Reduce project setup
- Provide dev/prod parity
- IDE idependent. However, with a strong focus on VSCode since it integrates nicely with GitHub, Development Containers and GitHub Copilot
- Provide a minimal workable setup
- Don't enforce application or package architecture
- Include the usual suspects of every project: CI/CD, linting, testing, package manager, development container, etc
👷🏼 Troubleshooting: docs/troubleshooting.md
🎨 Technical design: docs/design.md
🛠️ Open an issue if you have any questions or suggestions