This is a template repository for Python CLI projects.
It uses Poetry for dependency management and includes pre-configured tools such as black, flake8, mypy, pylint, pytest, and others, for formatting, linting, testing, and documentation management. The project also includes security tools like trivy and bandit.
The pyproject.toml file contains various configurations like project metadata, dependencies, build system, and commands for release and documentation management.
To have more details, check the Documentation
- Project Management
- ✅ Poetry
- ✅ Script to manage project metadata (Name, Version, Description, etc)
- ✅ Script to Upgrade all dependencies
- ✅ Script to clean all temporary files
- Code Formatting
- Code Linting
- Testing
- Security
- Automation commands
- ✅ Taskipy
- PyPI
- ✅ Scripts to build and publish to PyPI
- Docker
- ✅ Scripts to build and publish to Docker Hub
- Documentation
- ✅ MkDocs
- ✅ MkDocs Material Theme
- ✅ MkDocs Versioning with mike
- ✅ Scripts to generate SBOM (Software Bill of Materials)
- ✅ Scripts to generate requirements.txt
- CI/CD
- ✅ GitHub Actions to do CI/CD
This project uses Taskipy to automate common development tasks.
All tasks are defined in the pypoject.toml
file.
Almost all tools used in this project uses pyproject.toml
to store their configurations.
List of preset tasks:
pre-commit Run all pre-commit tasks
pre-release Run all pre-release tasks
----------- ----------------------------------------
info Show project info
meta Update project properties
upgrade Upgrade all dependencies
sec Run all security checks
format Run all formaters
lint Run all linters
bom Generate BOM
req Generate requirements.txt
test Run all tests
pypi-build Build package for PyPI
pypi-auth Authenticate to PyPI
pypi-pub Publish package to PyPI
docker-list List docker images
docker-build Build docker image
docker-sec-scan Scan a docker image looking for vulenrabilities
docker-auth Authenticate to Docker Hub
docker-latest Tag a docker image as latest
docker-pub Publish docker image to Docker Hub
docs Run docs server
docs-list List docs versions
docs-build Add a new version to docs
docs-delete Delete a version of the docs
docs-latest Set the latest Version.
docs-purge Purge all versions of the docs.
docs-pub Publish documentation to the doc branch on GitHub.
clean Clean all generated files
You must install manually the following tools:
Be sure you have installed all the requirements and that you on the desired python Version, you can check it with:
python --version
# Clone the repository
git clone https://github.com/brunobotelhobr/My-Template=Python.git
# Check the python version, you must use the version that the project will use.
python -V
# Install the dependencies
pip install poetry
poetry shell
poetry install
# Check the taskipi commands:
task --list
# Update projetct metadata
task meta
# Clone the repository
git clone
# Check the python version, you must use the version that the project will use.
python -V
# Install the dependencies
pip install poetry
poetry shell
poetry install
# Check the taskipi commands:
task --list
# Create a new branch
git checkout -b <branch-name>
# Check for lint errors
task format
task lint
# Check for security errors
task sec
# Update the meta
task meta
task bom
task req
# Add the changes
git add .
git commit -m "feat: add a new feature"
git push origin <branch-name>
- How add a Dev Package
poetry add --dev <package-name>
- How add a Prod Package
poetry add <package-name>
- How add a Package with extras
poetry add <package-name> -E <extras>
- How remove a Package
poetry remove <package-name>
We invite you to contribute to this repository and help us make it even better. Whether it's bug fixes, new features, or documentation improvements, we welcome all contributions. Please read our documentation for guidelines on how to contribute. Happy coding!
check the Documentation for more details.