Skip to content

JJ11teen/python-package-template

Repository files navigation

A repo template for python packages

Features

  • Python 3.10 (but easy to change)
  • Uses setup.cfg & pyproject.toml (not setup.py)
  • Unlicense
  • VS Code development container definitions
  • Configures black & isort to run on save in vscode
  • Includes a github action which runs tests on PRs against main branch
  • Includes (somewhat opinionated) tests template
  • Includes a trivial <package>.__version__ property

Checklist

  1. Add project details to setup.cfg

  2. Update line 3 of src/package_name/__init__.py to include your package name

  3. Rename the src/package_name directory to src/<your actual package name>

  4. Change the LICENSE if you want to. https://choosealicense.com/

  5. [Optional] If you want your minimum supported python version to differ from 3.11:

    1. Update your package definition: Line 22 of setup.cfg
    2. Configure black to lint properly: Line 10 of pyproject.toml
    3. Uncomment tests workflow to test relevent versions: Line 13 of .github/workflows/tests.yaml
    4. Update devcontainer image to use new version: Line 5 of .devcontainer/Dockerfile
  6. Build your dev container & reopen your IDE

  7. Install your package in editable mode & start working: pip install -e .[tests]

  8. Don't forget to rewrite this README.md

About

A flexible repository template for modern python packages

Topics

Resources

License

Stars

Watchers

Forks