GithubHelp home page GithubHelp logo

dldevinc / cookiecutter-pypackage Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 80 KB

Cookiecutter template for a Python package.

License: BSD 3-Clause "New" or "Revised" License

Python 44.23% HTML 0.16% JavaScript 55.61%

cookiecutter-pypackage's Introduction

Cookiecutter PyPackage

Cookiecutter template for a Python package.

Features

  • Testing setup with pytest
  • Measuring code coverage with pytest-cov
  • Tox testing
  • isort and prettier pre-commit hooks for formatting
  • Flake8 and MyPy pre-commit hooks for linting
  • Auto-release to PyPI when you push a new tag to master
  • Simple Django app for testing purposes (optional)

Quickstart

Install the latest Cookiecutter

pip install -U cookiecutter

Install pre-commit framework

pip install -U pre-commit

Install Tox and Twine (optionally)

sudo apt-get -y install tox twine

Generate a Python package project:

cookiecutter https://github.com/dldevinc/cookiecutter-pypackage.git

Then:

  • Create a virtual environment.
python3 -m venv --prompt="env" .venv
  • Install the requirements into a virtualenv
pip install -r requirements.txt
  • Write some code.
  • Install pre-commit hooks (optionally):
pre-commit install
  • ... or run formatters and linters manualy:
pre-commit run -a
  • Test your code:
tox -s
  • Analyze code coverage:
pytest --cov
  • Create a GitHub repo.
  • Register your project with PyPI.
python3 setup.py sdist bdist_wheel
twine upload --skip-existing dist/*
  • Create a new PyPI API token and save it as GitHub repository secret named PYPI_PASSWORD.
  • Release your package by pushing a new tag to master.

cookiecutter-pypackage's People

Contributors

pix666 avatar

Watchers

James Cloos avatar  avatar  avatar

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.