Skip to content

A medium complexity template for create CLI or python package.

Notifications You must be signed in to change notification settings

Dashstrom/python-template

Repository files navigation

Python template

Mypy Ruff Python : 3.8 3.9 3.10 3.11 3.12 License : MIT CI : Tests

Description

A medium complexity template for create CLI or python package.

Your gratitude warms my heart 💖

If you like this project or use it in your own project. Please, share it and add a little star for me ⭐

Tools used

  • Commitizen A tool to create committing rules for projects.
  • Cookiecutter A cross-platform command-line utility that creates projects.
  • Doctest Executes tests in docstrings
  • Editorconfig Configuration file format for defining coding styles in shared projects.
  • Git Git is the most widely used version control system.
  • Github Actions Automate and execute your software development workflows right in your repository.
  • Mypy Optional static typing for Python.
  • Poetry Python packaging and dependency management made easy.
  • Poe the Poet A task runner that works well with poetry.
  • Pre-commit A framework for managing and maintaining multi-language pre-commit hooks.
  • Pytest Framework making it easy to write small tests, yet scales to support complex functional testing.
  • Ruff An extremely fast Python linter, written in Rust.
  • Sphinx with read the docs theme Sphinx makes it easy to create intelligent and beautiful documentation.

Prerequisite

First, you will need to install a version of python higher or equal to 3.8 and Visual Studio Code.

You need to install pipx, cookiecutter and poetry with the following commands:

pip install --user pipx
pipx ensurepath
pipx install cookiecutter poetry

You will also need to install git following the official guide.

Installation

First you need to create your repository as follows:

cookiecutter --accept-hooks yes gh:Dashstrom/python-template

Configuration

Enable GitHub pages

Go to https://github.com/GITHUB_USERNAME/PROJECT_NAME/settings/pages and change branch for GitHub Pages:

Configure GitHub Pages

Add description, website and tag

Go to https://github.com/GITHUB_USERNAME/PROJECT_NAME and follow instructions:

Configure GitHub

Enable publish on PyPI

Create a PyPI account and go to bottom of page https://pypi.org/manage/account/publishing

Configure PyPI

Testing

python tests/test_template.py