Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrian-fuertes/cookiecutter
Cookiecutter template for Python development
https://github.com/adrian-fuertes/cookiecutter
cookiecutter cookiecutter-template python
Last synced: 19 days ago
JSON representation
Cookiecutter template for Python development
- Host: GitHub
- URL: https://github.com/adrian-fuertes/cookiecutter
- Owner: adrian-fuertes
- Created: 2023-01-02T19:33:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-02T22:42:13.000Z (about 2 years ago)
- Last Synced: 2024-11-05T22:42:33.591Z (2 months ago)
- Topics: cookiecutter, cookiecutter-template, python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python project template
My Python development project template 😄
## Template usage
To get started, install [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/)
```sh
brew install cookiecutter
```Then create a new project from the cookiecutter template
```sh
cookiecutter gh:adrian-fuertes/cookiecutter
```
A project folder with the inputed name will be created in your current working directory
## Project usage### Installation
Install [Poetry](https://python-poetry.org)
```sh
curl -sSL https://install.python-poetry.org | python3 -
```Install the package and other dependencies
```sh
poetry install
```Install [pre-commit](https://pre-commit.com)
```sh
brew install pre-commit
```### Dependencies
- Poetry is used to manage code dependencies. Poetry, alongside other tool's configs, is managed through the `pyproject.toml` file
- During development, use `poetry add dependency` to add package dependencies. Use `poetry add dependency --group dev` development dependencies.### Testing
- [Pytest](https://docs.pytest.org/en/7.2.x/) and [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) are used for testing.
- Add tests to `/tests` and execute `pytest --cov=.` to run them and assess coverage
- Pytest arguments are defined in `pyproject.toml` and pytest-cov settings are defined in `.coveragerc`
- Required testing coverage is **95%**
- Tests will run on pull requests and when pushing to `main` using Github Workflows### Formatting
- Formatting is handled by [black](https://github.com/psf/black), with black's parameters set in `pyproject.toml`
- Line length is set to `80` characters
- [isort](https://pycqa.github.io/isort/) is used to sort file imports, with its parameters being defined in `pyproject.toml`
- Staged code is automatically formatted using pre-commit Git hooks### Linting
- Code linting is handled by [flake8](https://flake8.pycqa.org/en/latest/), with its arguments being defined in `.flake8`
- [Pylint](https://pylint.pycqa.org/en/latest/) is exclusively used to enforce [W0511](https://pylint.pycqa.org/en/latest/user_guide/messages/warning/fixme.html) (this behavior is defined in the pre-commit hook that enforces it)
- [MyPy](https://mypy.readthedocs.io/en/stable/) is used for type checking, with its parameters being defined in `pyproject.toml`
- Flake8, Pylint and MyPy run on the pre-commit hook