Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 6.65 KB

README.md

File metadata and controls

57 lines (45 loc) · 6.65 KB

ATTENTATION: This repository is archived. It has been moved to: https://github.com/prescriptiveanalytics/python-package-template

Poetry Cookiecutter

A simple Cookiecutter template for scaffolding Python packages and apps. The goal is to provide sane defaults for any application.

Batteries Included

  • Packaging and dependency management with Poetry
  • Ready to use CUDA DEVCONTAINER with devcontainers
  • Task running with Poe the Poet
    • Pre defined tasks
    • Code formatting with Black, isort
    • Code linting with Ruff
    • Tests and test coverage with Pytest
  • Scaffolding updates with Cookiecutter and Cruft
  • Documentation generation with Mkdocs and mkdocstrings
  • Installing from and publishing to RISCs private PyPI
  • Simple Gitignore for working with Python / PyCharm / VSCode / ...
  • Default EditorConfig for Python and miscellaneous files
  • Uses Google-style docstrings or NumPy-style
  • Ready to use Docker images as a base CI/CD
  • Cross-platform support for Linux, macOS (Apple silicon and Intel), and Windows

Planned

Usage

Creating a new Python project

  1. Install Cruft and Cookiecutter
  2. Run:
    cruft create -f https://gitdma.risc-software.at/common/python-package-template
  3. Install the environment with poetry install and create a container using docker build -f Dockerfile-test .
  4. [Optional] Update your project template by running cruft update

Parameters

Parameter Description
package_name
"My Awesome Proect"
The name of the package. Will be slugified to snake_case for importing and kebab-case for installing.
package_description
"A single sentence description"
A single-line description of the package.
package_url
"https://gitdma.risc-software.at//<package_name>"
The URL to the package's repository.
author_name
"Sonja Sunshine"
The full name of the primary author of the package.
author_email
"[email protected]"
The email address of the primary author of the package.
python_version
"3.11"
The minimum Python version that the package requires.
docstring_style
["Google", "Numpy"]
Whether to use and validate NumPy-style or Google-style docstrings.

Supported Poe Tasks

  • precommit Runs formatting, linting, and import sorting
  • check Checks if formatting, linting and import sorting are corrcet
  • test Runs all unit tests and doctests
  • docs Serves documentation in the docs folder, also generates API docs from docstrings