Simple bash script to generate the python project template I use.
- bash
- curl
- git
Linux OS often have these requirements by default.
$ git clone
$ mkdir $HOME/.config/pyproject_template
$ cp files/* $HOME/.config/pyproject_template
$ . /path/to/the/script/pyproject.sh your_project_name
Author name: your name
Author email: your email
License: your license
your_project_name setup is done.
The next time you use the template, only the fourth step is needed.
.
├── .flake8
├── .git
│ ├── ...
│ ├── hooks
│ │ ├── ...
│ │ ├── pre-commit
│ │ └── ...
│ └── ...
├── .github
│ └── workflows
│ ├── publish_docs.yml
│ ├── publish_pypi.yml
│ ├── test_suite.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── docker-compose.yml
├── docs
├── mkdocs.yml
├── your_project_name
│ └── __init__.py
├── pyproject.toml
├── scripts
│ ├── format.sh
│ ├── preview_docs.sh
│ ├── publish.sh
│ ├── publish_docs.sh
│ └── test.sh
└── test
├── __init__.py
└── conftest.py
The files are defined with basic settings and, when necessary, point to the correct project folder.
This template has a Docker container development environment and is designed to build CI/CD on GitHub Actions.
I use the GitHub “Scripts to Rule Them All” pattern. So there are basic scripts for the whole development process and these scripts must be called either locally or automatically in CI/CD. To call them locally, I use a Makefile to wrap all the commands together.
- black (config in pyproject.toml)
- isort (config in pyproject.toml)
- pydocstyle (config in pyproject.toml)
- flake8 (config in .flake8)
- pytest
- pytest-cov
- mkdocs-material