Skip to main content

Yet another modern Python Package (pypi) with emphasis in CI/CD and automation

Project description

Cookiecutter Python Package

Python Package (pypi) Cookiecutter, with emphasis on CI/CD and automation.

GitHub Workflow Status (branch) Read the Docs (version) Production Version PyPI - Wheel Supported Python versions GitHub commits since tagged version (branch) GitHub commits since latest release (by SemVer)

Features

  1. Fresh Python Package Project Generation, “packaged” with a Test Suite and a CI Pipeline (see Quickstart)

  2. Python Package Template (source code at src/cookiecutter_python/) implemented as a Cookiecutter

  3. Tested on python versions 3.6, 2.7, 3.8, 3.9 and 3.10, for both “Linux” and “MacOS” platforms (see Test Workflow on CI)

You can check the Biskotaki Python Package Project, which was entirely generated using this Python Package Template:

Source Code hosted on Github at https://github.com/boromir674/biskotaki
Python Package hosted on pypi.org at https://pypi.org/project/biskotaki/
CI Pipeline hosted on Github Actions at https://github.com/boromir674/biskotaki/actions

Generated Python Package Features

  1. Test Suite using pytest

  2. Parallel Execution of Unit Tests, on multiple cpu’s

  3. Automation, using tox

    1. Code Coverage measuring

    2. Build Command, using the build python package

    3. Pypi Deploy Command, supporting upload to both pypi.org and test.pypi.org servers

    4. Type Check Command, using mypy

  4. CI Pipeline, running on Github Actions

    1. Job Matrix, spanning different platform’s and python version’s

      1. Platforms: ubuntu-latest, macos-latest

      2. Python Interpreters: 3.6, 3.7, 3.8, 3.9, 3.10

    2. Parallel Job execution, generated from the matrix, that runs the Test Suite

Quickstart

Prerequisites

You need to have Cookiecutter installed. Check the Cookiecutter documentation pages for more on Cookiecutter.

Usage

Open a console/terminal and run:

git clone git@github.com:boromir674/cookiecutter-python-package.git
cookiecutter cookiecutter-python-package/src/cookiecutter_python

Now, you should have generated a new Project for a Python Package, based on the Template!

Just ‘enter’ (cd into) the newly created directory, ie cd <my-great-python-package>.

Develop your package’s Source Code (business logic) inside src/my_great_python_package dir :)
Develop your package’s Test Suite (ie unit-tests, integration tests) inside tests dir :-)

Try Running the Test Suite!

tox

Read the Documentation’s Use Cases section for more on how to leverage your generated Python Package features.

License

  • Free software: Affero GNU General Public License v3.0

Notes

Currently, since the actual cookiecutter template does not reside on the root directory of the repository (but rather in src/cookiecutter_python), ‘cloning’ the repository locally is required at first.

This was demonstrated in the Quickstart section, as well.

For more complex use cases, you can modify the Template and also leverage all of cookiecutter’s features, according to your needs.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cookiecutter_python-0.8.1.tar.gz (42.6 kB view hashes)

Uploaded Source

Built Distribution

cookiecutter_python-0.8.1-py3-none-any.whl (37.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page