All Projects → browniebroke → cookiecutter-pypackage

browniebroke / cookiecutter-pypackage

Licence: MIT License
A cookiecutter template for Python package with heavy use of Github actions

Programming Languages

python
139335 projects - #7 most used programming language
Batchfile
5799 projects
Makefile
30231 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cookiecutter-pypackage

FastAPI-template
Feature rich robust FastAPI template.
Stars: ✭ 660 (+3373.68%)
Mutual labels:  cookiecutter, cookiecutter-template
python-lib
Opinionated cookiecutter template for creating a new Python library
Stars: ✭ 75 (+294.74%)
Mutual labels:  pypi, cookiecutter-template
cookiecutter-homeassistant-custom-component
Cookiecutter template for Home Assistant custom component
Stars: ✭ 37 (+94.74%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiecutter-python-cli
A cookiecutter template for creating a Python CLI application using click
Stars: ✭ 65 (+242.11%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiecutter-qt-app
A cookiecutter to create Qt applications, with translations and packaging
Stars: ✭ 29 (+52.63%)
Mutual labels:  cookiecutter, cookiecutter-template
python-template
Netherlands eScience Center Python Template
Stars: ✭ 136 (+615.79%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiecutter-modern-datascience
Start a data science project with modern tools
Stars: ✭ 136 (+615.79%)
Mutual labels:  cookiecutter, cookiecutter-template
Cookiecutter Data Science
A logical, reasonably standardized, but flexible project structure for doing and sharing data science work.
Stars: ✭ 5,271 (+27642.11%)
Mutual labels:  cookiecutter, cookiecutter-template
qt-qml-project-template-with-ci
Template for a Qt/QML application with batteries included: GitHub C.I. for your QML app; automated gui testing with Xvfb; automatic code-format checks and more. Compiles for Desktop and Mobile (Linux, Mac, Windows, and Android).
Stars: ✭ 33 (+73.68%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiecutter-modern-pypackage
Cookiecutter template for a modern Python package.
Stars: ✭ 97 (+410.53%)
Mutual labels:  cookiecutter, cookiecutter-template
Sailboat
🐍 A quick and easy way to distribute your Python projects!
Stars: ✭ 137 (+621.05%)
Mutual labels:  package, pypi
fastapi-starter
A FastAPI based low code starter: Async SQLAlchemy, Postgres, React-Admin, pytest and cypress
Stars: ✭ 97 (+410.53%)
Mutual labels:  cookiecutter, cookiecutter-template
Edualgo
A simple python package having modules of different algorithms to use in educational purposes.
Stars: ✭ 76 (+300%)
Mutual labels:  package, pypi
theme-cookiecutter
A cookiecutter template to help you make new JupyterLab theme extensions
Stars: ✭ 47 (+147.37%)
Mutual labels:  cookiecutter, cookiecutter-template
Try
Dead simple CLI tool to try Python packages - It's never been easier! 📦
Stars: ✭ 588 (+2994.74%)
Mutual labels:  package, pypi
cookiecutter-go
boilerplate, golang project starter tool, support go-zero/go-micro/gin
Stars: ✭ 63 (+231.58%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiedozer
📱 Cookiecutter for i18n Kivy Apps
Stars: ✭ 48 (+152.63%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiecutter-homeassistant-component
A cookiecutter project template for generating the structure for a new custom component.
Stars: ✭ 22 (+15.79%)
Mutual labels:  cookiecutter, cookiecutter-template
cookiecutter-pyms
Cookiecutter template for a Python microservice.
Stars: ✭ 49 (+157.89%)
Mutual labels:  cookiecutter, cookiecutter-template
at-python-template
The official Python Project Template of Alexander Thamm GmbH
Stars: ✭ 34 (+78.95%)
Mutual labels:  cookiecutter, cookiecutter-template

Cookiecutter PyPackage

CI Status Cookiecutter template badge

Cookiecutter template for a Python Package.

Features

Usage

Generate a new project with:

cookiecutter https://github.com/browniebroke/cookiecutter-pypackage

This will prompt you for a few questions and create new directory with the name you used as project slug.

Start developing

The project uses Poetry for dependencies management and packaging. Make sure you have it installed in your development machine. To install the development dependencies in a virtual environment, type:

poetry install

This will also generate a poetry.lock file, you should track this file in version control. To execute the test suite, call pytest inside Poetry's virtual environment via poetry run:

poetry run pytest

Check out the Poetry documentation for more information on the available commands.

GitHub Actions

When you first push to GitHub, it'll start a ci GitHub workflow that you can see in the "Actions" tab of your repository. This workflow runs a couple of jobs:

  • The test job will run your test suite with Pytest against all Python version from 3.7 to 3.9
  • A few things will run in the lint job:
    • black in check mode
    • isort in check mode
    • flake8
    • pyupgrade for Python 3.7+

A labels workflow will also run and synchronise the GitHub labels based on the .github/labels.toml file.

Secrets

The workflows need a few secrets to be setup in your GitHub repository:

  • PYPI_TOKEN to publish releases to PyPI. This one should be created as release environment secret.
  • GH_PAT a personal access token (PAT) with the repo scope for opening pull requests and updating the repository topics. This is used by the hacktoberfest workflow.
  • CODECOV_TOKEN to upload coverage data to codecov.io in the Test workflow (optional for public repos).

If you have the GitHub CLI installed and chose to set up GitHub, they will be created with a dummy value.

Automated release

By following the conventional commits specification, we're able to completely automate versioning and releasing to PyPI. This is handled by the semantic-release.yml workflow. It is triggered manually by default, but can be configured to run on every push to your main branch.

Here is an overview of its features:

  • Check the commit log since the last release, and determine the next version to be released.
  • If no significant change detected, stop here (e.g. just dependencies update).
  • Otherwise, bump the version in code locations specified in setup.cfg.
  • Update the CHANGELOG.md file.
  • Commit changes.
  • Create a git tag.
  • Push to GitHub.
  • Create a release in GitHub with the changes as release notes.
  • Build the source and binary distribution (wheel).
  • Upload the sources to PyPI and attach them to the Github release.

For more details, check out the conventional commits website and Python semantic release Github action.

Pre-commit

The project comes with the config for pre-commit. If you're not familiar with it, follow their documentation on how to install it and set it up.

Documentation

The project assumes that the documentation will be hosted on Read the Docs and written in Markdown with the MyST parser for Sphinx.

To enable it, you might need to go into your dashboard and import the project from Github. Everything else should work out of the box.

Dependencies update

The project dependencies are kept up to date with Renovate which requires the Github app to be installed.

The main advantage of Renovate over Dependabot is the auto-merge option, which is configured to automatically merge minor/patch updates with all the CI checks passing. It supports a variety of package managers, including Poetry, GitHub actions and pre-commit hooks which are used by default.

All contributors

This is a specification that help you highlight every open source contribution in your README. This is easy to maintain as it comes with a GitHub bot to do the updates for you, so more manual updates on the contributors file.

If you never used it before, you will have to install the Github app and give it access to your repo.

Contributors

Thanks goes to these wonderful people (emoji key):


Bruno Alla

💻 🤔 📖

Jeff Tsay

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].