Skip to content

staticdev/cookiecutter-hypermodern-python

 
 

Repository files navigation

Logo

cookiecutter-hypermodern-python

Tests

Cookiecutter template for a Python package based on the Hypermodern Python article series.

Usage

cookiecutter https://github.com/cjolowicz/cookiecutter-hypermodern-python

Features

The template supports Python 3.6, 3.7, and 3.8.

The linter suite uses the following tools and Flake8 plugins:

Quickstart

Requirements

Install Poetry:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Install Nox:

pip install --user --upgrade nox

Install the latest Cookiecutter:

pip install --user --upgrade cookiecutter

It is also recommended to use pyenv to set up Python 3.6, 3.7, and 3.8.

Creating a project

Generate a Python project:

cookiecutter https://github.com/cjolowicz/cookiecutter-hypermodern-python

Change to the root directory of your new project.

Local testing

Run the full test suite:

nox

List the available Nox sessions:

nox --list-sessions

External Services

PyPI

  1. Sign up at PyPI.
  2. Go to the Account Settings on PyPI, generate an API token, and copy it.
  3. Go to the repository settings on GitHub, and add a secret named PYPI_TOKEN with the token you just copied.

TestPyPI

  1. Sign up at TestPyPI.
  2. Go to the Account Settings on TestPyPI, generate an API token, and copy it.
  3. Go to the repository settings on GitHub, and add a secret named TEST_PYPI_TOKEN with the token you just copied.

Codecov

  1. Sign up at Codecov, and install their GitHub app.
  2. Add your repository to Codecov.

Read the Docs

  1. Sign up at Read the Docs.
  2. Import your GitHub repository, using the button Import a Project.

Releasing

  1. Bump the version using poetry version. Push to GitHub.
  2. Publish a GitHub Release.
  3. GitHub Action triggers the PyPI upload.

Release notes are pre-filled with titles and authors of merged pull requests.

Use labels to group the pull requests into sections:

Label Section
breaking 💥 Breaking Changes
bug 🪲 Fixes
build 📦 Build System and Dependencies
ci 👷 Continuous Integration
documentation 📚 Documentation
enhancement 🚀 Features
performance 🐎 Performance
refactoring 🔨 Refactoring
removal 🔥 Removals and Deprecations
style 💄 Style
testing 🚨 Testing

GitHub creates the bug, enhancement, and documentation labels for you. Create the remaining labels on the Issues tab of your GitHub repository.

Caveats

When upgrading Sphinx or its extensions using Poetry, also update the requirements located in docs/requirements.txt for Read the Docs.

Guide

The project setup is described in detail in the Hypermodern Python article series:

You can also read the articles on my blog.

About

Hypermodern Python Cookiecutter

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%