An open API service indexing awesome lists of open source software.

https://github.com/engineervix/cookiecutter-pyproject

A simple Cookiecutter template to quickly bootstrap a new python project
https://github.com/engineervix/cookiecutter-pyproject

cookiecutter cookiecutter-template python

Last synced: 12 months ago
JSON representation

A simple Cookiecutter template to quickly bootstrap a new python project

Awesome Lists containing this project

README

          

Welcome to cookiecutter-pyproject 👋




python3


CircleCI


Coverage Status


pre-commit


Maintenance


Maintainability Rating


License: MIT




Requirements Status



security: bandit


Commitizen friendly


Conventional Commits


Twitter: engineervix

> A simple Cookiecutter template to quickly bootstrap a new python project

## Features

- Always up-to-date dependencies with the help of [dependabot](https://dependabot.com/)
- Python 3.6+
- Testing using [`pytest`](https://docs.pytest.org/en/stable/)
- Uses [pip-tools](https://github.com/jazzband/pip-tools) for dependency management
- Continuous Integration options: [Gitlab CI](https://docs.gitlab.com/ee/ci/) or [Circle CI](https://circleci.com/)
- Pre-commit hooks via [pre-commit](https://pre-commit.com/).
- [Conventional commits](https://www.conventionalcommits.org/) courtesy of the [Commitizen tool](https://github.com/commitizen-tools/commitizen), which is also useful for:
- Bumping versions automatically using [semantic versioning](https://semver.org/) based on the commits
- Generating a changelog using [Keep a changelog](https://keepachangelog.com/)
- Code formatting using [black](https://github.com/psf/black)
- Linting using [flake8](https://flake8.pycqa.org/en/latest/)
- Choice of various licenses
- Optional CLI using [Click](https://click.palletsprojects.com/) or [argparse](https://docs.python.org/3/library/argparse.html)
- Generates a simple [VSCode](https://code.visualstudio.com/) `settings.json` (Just change the `python.pythonPath`)

## Getting started

Ensure that you have [cookiecutter](https://github.com/audreyr/cookiecutter) installed on your computer:

```sh
pip install -U cookiecutter
```

Bootstrap your new python project:

```sh
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, then
- `pip-compile requirements.in` to generate an updated `requirements.txt` file
- `pip-sync` to update your virtual environment to reflect exactly what's in the `requirements.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](https://circleci.com/) account. Optionally register your repo with [dependabot](https://app.dependabot.com/), [requires.io](https://requires.io), [coveralls](https://coveralls.io), [codeclimate](https://codeclimate.com/) and [deepsource](https://deepsource.io/) (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:

```sh
pytest -vv --cov-config=.coveragerc --cov=. --cov-report term-missing
```

## Author

👤 **Victor Miti**

* Twitter: [@engineervix](https://twitter.com/engineervix)
* Github: [@engineervix](https://github.com/engineervix)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/engineervix/cookiecutter-pyproject/issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2020 [Victor Miti](https://github.com/engineervix).

This project is [MIT](https://github.com/engineervix/cookiecutter-pyproject/LICENSE) licensed.

## Credits

Inspired by:

- [audreyfeldroy/cookiecutter-pypackage](https://github.com/audreyfeldroy/cookiecutter-pypackage)
- [wemake-services/wemake-python-package](https://github.com/wemake-services/wemake-python-package)
- [sourcery-ai/python-best-practices-cookiecutter](https://github.com/sourcery-ai/python-best-practices-cookiecutter)
- [ionelmc/cookiecutter-pylibrary](https://github.com/ionelmc/cookiecutter-pylibrary)
- [cjolowicz/cookiecutter-hypermodern-python](https://github.com/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](https://github.com/features/actions), [AppVeyor](https://www.appveyor.com/) and perhaps [Travis CI](https://travis-ci.org/)
- [ ] Add [packaging](https://packaging.python.org/guides/distributing-packages-using-setuptools/) options
- [ ] Include options for [coveralls](https://coveralls.io), [codeclimate](https://codeclimate.com/) and [deepsource](https://deepsource.io/) in Gitlab CI.
- [ ] Working with [dependabot](https://dependabot.com/) on Gitlab
- [ ] `Makefile` to automate some boring tasks and encapsulate long commands

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_