Awesome
<h1 align="center">Welcome to cookiecutter-pyproject 👋</h1> <p> <a href="https://python3statement.org/#sections50-why" target="_blank"> <img alt="python3" src="https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-brightgreen.svg" /> </a> <a href="https://circleci.com/gh/engineervix/cookiecutter-pyproject/tree/master" target="_blank"> <img alt="CircleCI" src="https://circleci.com/gh/engineervix/cookiecutter-pyproject/tree/master.svg?style=svg" /> </a> <a href="https://coveralls.io/github/engineervix/cookiecutter-pyproject?branch=master" target="_blank"> <img alt="Coverage Status" src="https://coveralls.io/repos/github/engineervix/cookiecutter-pyproject/badge.svg?branch=master" /> </a> <a href="https://github.com/pre-commit/pre-commit" target="_blank"> <img alt="pre-commit" src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white" /> </a> <a href="https://github.com/engineervix/cookiecutter-pyproject/graphs/commit-activity" target="_blank"> <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /> </a> <a href="https://sonarcloud.io/dashboard?id=engineervix_cookiecutter-pyproject" target="_blank"> <img alt="Maintainability Rating" src="https://sonarcloud.io/api/project_badges/measure?project=engineervix_cookiecutter-pyproject&metric=sqale_rating" /> </a> <a href="https://github.com/engineervix/cookiecutter-pyproject/LICENSE" target="_blank"> <img alt="License: MIT" src="https://img.shields.io/github/license/engineervix/cookiecutter-pyproject" /> </a> </p> <p> <a href="https://requires.io/github/engineervix/cookiecutter-pyproject/requirements/?branch=master" target="_blank"> <img alt="Requirements Status" src="https://requires.io/github/engineervix/cookiecutter-pyproject/requirements.svg?branch=master" /> </a> <!-- <a href="https://dependabot.com/" target="_blank"> <img alt="dependabot" src="https://badgen.net/dependabot/engineervix/cookiecutter-pyproject/?icon=dependabot" /> </a> --> <a href="https://github.com/PyCQA/bandit" target="_blank"> <img alt="security: bandit" src="https://img.shields.io/badge/security-bandit-informational.svg" /> </a> <a href="http://commitizen.github.io/cz-cli/" target="_blank"> <img alt="Commitizen friendly" src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg" /> </a> <a href="https://conventionalcommits.org" target="_blank"> <img alt="Conventional Commits" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-informational.svg" /> </a> <a href="https://twitter.com/engineervix" target="_blank"> <img alt="Twitter: engineervix" src="https://img.shields.io/twitter/follow/engineervix.svg?style=social" /> </a> </p>A simple Cookiecutter template to quickly bootstrap a new python project
Features
- Always up-to-date dependencies with the help of dependabot
- Python 3.6+
- Testing using
pytest
- Uses pip-tools for dependency management
- Continuous Integration options: Gitlab CI or Circle CI
- Pre-commit hooks via pre-commit.
- Conventional commits courtesy of the Commitizen tool, which is also useful for:
- Bumping versions automatically using semantic versioning based on the commits
- Generating a changelog using Keep a changelog
- Code formatting using black
- Linting using flake8
- Choice of various licenses
- Optional CLI using Click or argparse
- Generates a simple VSCode
settings.json
(Just change thepython.pythonPath
)
Getting started
Ensure that you have cookiecutter installed on your computer:
pip install -U cookiecutter
Bootstrap your new python project:
cookiecutter https://github.com/engineervix/cookiecutter-pyproject.git
You'll be prompted for some values, such as project_name, project_slug, email, license, etc.
Once you're done, cd
into your the new project folder created above, and you're ready to roll :sunglasses:!
Other steps
- Create a virtual environment for your project
- Install project dependencies:
pip install -r requirements.txt
pre-commit install
pre-commit install --hook-type commit-msg
- add any additional requirements in the
requirements.in
file, thenpip-compile requirements.in
to generate an updatedrequirements.txt
filepip-sync
to update your virtual environment to reflect exactly what's in therequirements.txt
file.
It goes without saying that you'll want to create a repo for your new project. If you're using Circle CI, ensure that you add your repo to your CircleCI account. Optionally register your repo with dependabot, requires.io, coveralls, codeclimate and deepsource (Don't forget to add the Code Climate, Coveralls and Deepsource Environment Variables to your Project's Settings in your CircleCI Dashboard). If you don't want to use any of these services
- remove them (coveralls, codeclimate and deepsource) from the CircleCI configuration file
- remove the respective badges in your project's
README.md
file
Tests
Simply run pytest
. For more detailed output, including test coverage:
pytest -vv --cov-config=.coveragerc --cov=. --cov-report term-missing
Author
👤 Victor Miti
- Twitter: @engineervix
- Github: @engineervix
🤝 Contributing
Contributions, issues and feature requests are welcome!<br />Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2020 Victor Miti.<br /> This project is MIT licensed.
Credits
Inspired by:
- audreyfeldroy/cookiecutter-pypackage
- wemake-services/wemake-python-package
- sourcery-ai/python-best-practices-cookiecutter
- ionelmc/cookiecutter-pylibrary
- cjolowicz/cookiecutter-hypermodern-python
FAQs
- Why create another python Cookiecutter when there's already so many excellent ones (like the ones above)?
I agree that there are several excellent python project cookiecutters out there. In fact, I wouldn't have written this version without the others (especially the ones in the Credits section above)! I am already used to a particular workflow, and I wanted a Cookiecutter that mirrors my workflow. None of the existing Cookiecutters were an exact fit, so I decided to write my own!
TODO
- Add other CI options: Github Actions, AppVeyor and perhaps Travis CI
- Add packaging options
- Include options for coveralls, codeclimate and deepsource in Gitlab CI.
- Working with dependabot on Gitlab
-
Makefile
to automate some boring tasks and encapsulate long commands
This README was generated with ❤️ by readme-md-generator