This project is a make-friendly, Github Actions CI/CD batteries included starter Python project that combines Poetry and Nox. It is partially inspired by Claudio Jolowicz's Hypermodern Python article series.
I am using it to work through the second edition of Brett Slatkin's Effective Python book. See the tests, which contain pytest files broken out by chapter and item.
As documentation, four basic documents are provided:
- this README.md,
- project GUIDELINES.md that all developers who work on the project agree to uphold,
- an ARCHITECTURE.md document helps developers load the project big picture into their mental model, and finally
- a COOKBOOK.md document that answers commonly asked questions/gives useful recipes.
- Install python3. The first article in the series linked above should get you started (he recommends
pyenv
). - Install
poetry
; see the project homepage or this article. - Clone this repo.
- Build the project. If you prefer make, you can run:
make deps
This will run poetry install
and poetry run nox --install-only
. You can run make help
to see more make targets. Alternatively, you can just run poetry
's CLI; see the Makefile's make targets for inspiration.
make clean
Will clean out your install.
This file has some standard config files:
- The overall project is configured via a PEP518 pyproject.toml file. If you fork this repo, you should probably change it. It contains the black settings, the project dependencies, a pytest configuration, and a
- the .gitignore contains obvious gitignores.
- the noxfile.py contains nox targets for running
safety
and yourtests
. It uses the nox-poetry project for nox-poetry integration. - The .flake8 has a minimal flake8 configuration.
- The mypy.ini has a minimal mypy configuration.
Here's a checklist of things to change if you fork this project.
- Blow away
src/effectivepy
, or leave it in place if you find it useful, and make a new package,src/yourpackage
. - In the .flake8 file, swap out
effectivepy
for your project name. - In pyproject.toml, replace the project name with your project
- Replace the
repository
url - Replace the
source
list, or add your own in leavingsrc/effectivepy
around - Re-wrote or updated the project's README.md
- Re-wrote or updated the project's GUIDELINES.md
- Re-wrote or updated the project's COOKBOOK.md
- Re-wrote or updated the project's ARCHITECTURE.md