This package is a template for a python package. This project uses uv for package management. We will follow the same naming conventions. For example, there is a difference between a library (package) project and an application project. This is a library (package) project.
It contains the following parts :
-
The Python package (python_package_template): contains the code for the project. It can be used by users by pip installing the wheel and is maintained by the maintainers.
-
Autogenerated documentation: Docs made using MkDocs.
- (Author) Amine Djeghri
Engineering tools:
- Use UV to manage packages
- pre-commit hooks: use
ruff
to ensure the code quality &detect-secrets
to scan the secrets in the code. - Logging using loguru (with colors)
- Pytest for unit tests
- Dockerized project (Dockerfile & docker-compose): for the evaluation pipeline.
- Make commands to handle everything for you: install, run, test
CI/CD & Maintenance tools:
- CI/CD pipelines:
.github/workflows
for GitHub and.gitlab-ci.yml
for GitLab - Local CI/CD pipelines: GitHub Actions using
github act
and local GitLab CI usinggitlab-ci-local
Documentation tools:
- Wiki creation and setup of documentation website using Mkdocs
- GitHub Pages deployment using mkdocs gh-deploy plugin
Upcoming features:
- optimize caching in CI/CD
- Pull requests templates
- deploy gh pages in actions
The following files are used in the contribution pipeline:
.env.example
: example of the .env file..env
: contains the environment variables used by the app.Makefile
: contains the commands to run the app locally.Dockerfile
: the dockerfile used to build the project inside a container. It uses the Makefile commands to run the app..pre-commit-config.yaml
: pre-commit hooks configuration filepyproject.toml
: contains the pytest, ruff & other configurations.src/python_package_tempalte/utils.py
: logger using logguru and settings using pydantic. the frontend..github/workflows/**.yml
: GitHub actions configuration files..gitlab-ci.yml
: Gitlab CI configuration files..gitignore
: contains the files to ignore in the project.
- Ubuntu 22.04 or MacOS
- Python 3.11
Use pip or uv pip to install the package :
pip install "dist/dist/python_package_template-0.1.0-py3-none-any.whl"
# or
uv pip install "dist/dist/python_package_template-0.1.0-py3-none-any.whl"
from python_package_template.example import hello
hello()
# Output: 2025-01-05 08:05:38.143 | INFO | python_package_template.example:hello:5 - Hello world
You can check the documentation (website), or the notebook.ipynb
.
Check the CONTRIBUTING.md file for installation instructions
Check the CONTRIBUTING.md file for more information.