Giter VIP home page Giter VIP logo

cookiecutter-hatch-pypackage's Introduction

Cookiecutter Hatch PyPackage

Cookiecutter template for a cutting-edge Python package: Hatch, ruff, mypy, GitHub Actions and more!

Details License - MIT GitHub Sponsors
Features Hatch project linting - Ruff types - mypy test - pytest Github Actions linting - precommit docs - mkdocs

โœจ Features

  • Lightweight starter
  • Hatch package management
  • hatch-vcs: determine the package version automatically from git tags, e.g. v0.9
  • Linting and formatting with ruff which replaces isort, flake8, black, etc.
  • Type checking with mypy
  • Check unused, missing and transitive dependencies with deptry
  • Unit tests with pytest with optional asyncio setup.
  • Automate and standardize testing with Hatch-env-matrices
  • Documentation with Material for MkDocs and docstring reference support with mkdocstrings.
  • Ready-to-use GitHub Actions pipelines with dependabot, release-drafter, labeler, publish to PYPI workflows, publish to test PYPI workflows & more.
  • hatch-pip-compile: experimental support for lock-files,
  • pyproject.toml: all package, build and tool configuration in one file,
  • coverage: tool for measuring code coverage of Python programs with pytest integration,
  • pre-commit: pre-commit git hooks that make your life easier,
  • Markdown: instead of reStructuredText, Markdown is used consistently for all text files,
  • EditorConfig: maintain consistent coding styles for multiple developers,
  • src-layout: the actual Python package is kept under a src folder avoiding many common errors.

๐Ÿ’ซ Quickstart

Generate the project:

This project will use pipx to install hatch in an isolated enviroment. Make sure you have pipx installed before running the following command.

cookiecutter https://github.com/Aviksaikat/cookiecutter-hatch-pypackage

The generator will automatically call hatch env create & git init at the end.

Then, for the GitHub Actions pipelines to work correctly, you should:

  • Enable the GitHub repository in Codecov.
  • Set CODECOV_TOKEN in your GitHub repository secrets. You can find in the Codecov settings of the corresponding project.
  • Enable GitHub Pages using the GitHub Actions source.
  • Option to publish to Test PyPI for testing.
  • Configure the Trusted Publisher method on PyPI: it's a modern and secure method to push your package to PyPI.

With cruft

cruft is a layer above Cookiecutter allowing you to update your project from the template after it has been generated.

cruft create https://github.com/Aviksaikat/cookiecutter-hatch-pypackage

Demo

License

This project is licensed under the terms of the MIT license.

cookiecutter-hatch-pypackage's People

Contributors

aviksaikat avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

cookiecutter-hatch-pypackage's Issues

Error at Contributing

Error

WARNING - mkdocs_autorefs: contributing.md: Could not find cross-reference target '[^contrib1]'

Add option to set `uv` as package manager

Add the option to set uv as the package manager. The configuration will look like this. May conflict with the lock file settings. Might have to remove it.

[tool.hatch.envs.default]
dependencies = [
...
]
installer = "uv" # or "pip"

Fix jekyll syntax

Change the docs syntax from this

{% raw %} {% include-markdown "../LICENSE" %} {% endraw %}

to this

--8<-- LICENSE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.