a versatile cookiecutter template for python projects
-
Install
cookiecutter
:pip install cookiecutter
-
Generate a Python package structure using
cookiecutter-dinkin-flicka
:cookiecutter https://github.com/luizdesuo/cookiecutter-dinkin-flicka.git
Enter the settings:
- project_name
- friendly_name
- package_short_description
- python_version
- package_version
- copyright_year
- author
- github_user
- license
- MIT
- Apache License 2.0
- GNU General Public License v3.0
- BSD 3-Clause
- Proprietary
- None
- development_status
- Development Status :: 1 - Planning
- Development Status :: 2 - Pre-Alpha
- Development Status :: 3 - Alpha
- Development Status :: 4 - Beta
- Development Status :: 5 - Production/Stable
- Development Status :: 6 - Mature
- Development Status :: 7 - Inactive
- None
- data_version_control: include dvc, pandas, pyjanitor and pandera
- false
- true
- defensive_programming: include icontract, hypothesis, icontract-hypothesis
- false
- trueee
- publish: include pypi and testpypi publishing into github workflow
in addition to readthedocs mentions into documentation
- false
- true
The project structure will look similar to that shown below:
project-name
├── bandit.yml
├── codecov.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── .cookiecutter.json
├── .darglint
├── docs
│ ├── codeofconduct.md
│ ├── conf.py
│ ├── contributing.md
│ ├── index.md
│ ├── license.md
│ ├── requirements.txt
│ └── usage.md
├── .editorconfig
├── .flake8
├── .gitattributes
├── .github
│ ├── dependabot.yml
│ └── workflows
│ └── release.yml
├── .gitignore
├── LICENSE
├── noxfile.py
├── .pre-commit-config.yaml
├── pyproject.toml
├── README.md
├── .readthedocs.yml
├── src
│ └── project_name
│ ├── __init__.py
│ ├── __main__.py
│ ├── project_name.py
│ └── py.typed
└── tests
├── __init__.py
├── test_main.py
└── test_project_name.py
After changing directory to project-name folder, install the project with:
poetry install
Start version control tracking:
git init
git add .
git commit -m "initial package setup"
Install the pre-commit hooks:
poetry run pre-commit install
Update the pre-commit hooks' versions:
poetry run pre-commit autoupdate
Finally, add to version control:
git add .pre-commit-config.yaml
And, commit:
git commit -m "build: update pre-commit hooks versions"
Setting on github:
graph LR
A[Settings] --> B[Actions]
B --> C[General]
C --> D[Workflow<br>permissions]
D --> E[Read and write<br>permissions]
E --> F[Save]
The python-semantic-release tool do the automated bumping based on the angular commit style
- build/chore: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs)
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- test: Adding missing tests or correcting existing tests
- pre-commit hooks:
- bandit
- darglint
- pycln
- check-added-large-files
- check-ast
- check-byte-order-marker
- check-builtin-literals
- check-case-conflict
- check-docstring-first
- check-json
- check-merge-conflict
- check-symlinks
- check-toml
- check-vcs-permalinks
- check-xml
- check-yaml
- debug-statements
- destroyed-symlinks
- detect-private-key
- end-of-file-fixer
- file-contents-sorter
- fix-byte-order-marker
- fix-encoding-pragma
- forbid-new-submodules
- mixed-line-ending
- requirements-txt-fixer
- sort-simple-yaml
- trailing-whitespace
- prettier
- pyupgrade
- isort
- docformatter
- black
- blacken-docs
- flake8
- flake8-bugbear
- flake8-docstrings
- flake8-rst-docstrings
- pep8-naming
- mypy
- click
- python-semantic-release
- nox
- pytest
- pytest-cov
- safety
- typeguard
- xdoctest
- pygments
- jupyter
- myst-parser
- sphinx-autobuild
- sphinx-autoapi
- sphinx-copybutton
- furo
- sphinx-click
- sphinx
- sphinxcontrib-mermaid
Contributions are very welcome. To learn more, see the Contributor Guide.
Distributed under the terms of the MIT license, Dinkin Flicka is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.
This project was generated from Dinkin Flicka Cookiecutter template.
Dinkin Flicka Cookiecutter was based on Hypermodern Python article series and Python Packages book.