Skip to content

Working through the Effective Python book in a test-driven manner.

Notifications You must be signed in to change notification settings

lhayhurst/effectivepy

Repository files navigation

README

Build Status

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.

Useful docs

As documentation, four basic documents are provided:

  1. this README.md,
  2. project GUIDELINES.md that all developers who work on the project agree to uphold,
  3. an ARCHITECTURE.md document helps developers load the project big picture into their mental model, and finally
  4. a COOKBOOK.md document that answers commonly asked questions/gives useful recipes.

Getting Started

  1. Install python3. The first article in the series linked above should get you started (he recommends pyenv).
  2. Install poetry; see the project homepage or this article.
  3. Clone this repo.
  4. 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.

Configuration

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 your tests. 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.

If Forking this project

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 leaving src/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

About

Working through the Effective Python book in a test-driven manner.

Topics

Resources

Stars

Watchers

Forks