From 377dbd2791f244cab5d49b761c803a495a66d7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Gince?= <50332514+JeremieGince@users.noreply.github.com> Date: Wed, 12 Feb 2025 17:50:16 -0500 Subject: [PATCH 1/2] Update change_project_attributes.py --- change_project_name.py => change_project_attributes.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename change_project_name.py => change_project_attributes.py (100%) diff --git a/change_project_name.py b/change_project_attributes.py similarity index 100% rename from change_project_name.py rename to change_project_attributes.py From 0284e9115806d441b5c12e9a02e52f85c96586b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Gince?= <50332514+JeremieGince@users.noreply.github.com> Date: Wed, 12 Feb 2025 17:50:18 -0500 Subject: [PATCH 2/2] Update README.md --- README.md | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a28b4c..eaf9caa 100644 --- a/README.md +++ b/README.md @@ -1 +1,128 @@ -# PythonProject-Template \ No newline at end of file +# PythonProject-Template + +[![Star on GitHub](https://img.shields.io/github/stars/JeremieGince/PythonProject-Template.svg?style=social)](https://github.com/JeremieGince/PythonProject-Template/stargazers) +[![GitHub forks](https://img.shields.io/github/forks/JeremieGince/PythonProject-Template?style=social)](https://github.com/JeremieGince/PythonProject-Template/network/members) +[![Python 3.6](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-310/) +[![downloads](https://img.shields.io/pypi/dm/MatchCake)](https://pypi.org/project/MatchCake) +[![PyPI version](https://img.shields.io/pypi/v/MatchCake)](https://pypi.org/project/MatchCake) +[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE) + +![Tests Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/tests.yml/badge.svg) +![Dist Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/build_dist.yml/badge.svg) +![Doc Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/docs.yml/badge.svg) +![Publish Workflow](https://github.com/JeremieGince/PythonProject-Template/actions/workflows/publish.yml/badge.svg) +![Code coverage](https://raw.githubusercontent.com/JeremieGince/PythonProject-Template/coverage-badge/coverage.svg) + +# Description + +This is a template for a Python project. +It includes a basic project structure, a Dockerfile, a requirements.txt file a README.md file, etc. +The goal of this template is to provide a starting point for a Python project. Once you have cloned this repository, +you can start by changing the `attributes` of the project using the `change_project_attributes.py` script with +the following command: +```bash +python change_project_attributes.py --help +``` + +Then you can start developing your project by adding your code to the `src` directory. + + +The project is constituted by the following parts: + +- **.github**: This directory contains the GitHub Actions workflows that are responsible for + - running the tests: `.github/workflows/tests.yml` + - build the distribution: `.github/workflows/build_dist.yml` + - build the documentation: `.github/workflows/docs.yml` +- **data**: This directory will contain the data that will be used and generated by the project. +- **dist**: This directory will contain the distribution of the project. +- **docs**: This directory will contain the documentation of the project. +- **images**: This directory will contain the images that will be used in the README.md file or in the documentation. +- **sphinx**: This directory contains the configuration of the Sphinx documentation. +- **src**: This directory will contain the source code of the project. This is where you will add your own sauce. +- **tests**: This directory will contain the tests of the project. +- **docker_files**: This directory contains the scripts that will help you build the docker image and run the + project in a container. +- *Dockerfile*: This file is responsible for building the docker image of the project. +- *.gitattributes*: This file is responsible for setting the git attributes of the project. +- *.gitignore*: This file is responsible for ignoring the files that you don't want to commit to the repository. + A basic one is already provided and should be enough for most of the projects. +- *requirements.txt*: This file is responsible for listing the dependencies of the project. +- *pyproject.toml*: This file is responsible for listing the dependencies of the project and the + configuration of the project. +- *README.md*: This file is responsible for providing information about the project. + A basic structure is provided after this little introduction. +- *change_project_attributes.py*: This script is responsible for changing the attributes of the project. + Feel free to remove it once you used it. +- *setup.py*: This file is responsible for setting up the project. +- *LICENSE*: This file is responsible for providing the license of the project. +- *run_pytests.py*: This script is used by the github actions to run the tests. + +# README TEMPLATE + +## Installation +### Development Dependencies + +With `python` and `pip` installed, run the following commands to install the dependencies: +```bash +python -m venv .venv +source .venv/bin/activate +pip install -r requirements.txt +``` + +With `poetry` installed, run the following commands to install the dependencies: +```bash +python -m venv .venv +source .venv/bin/activate +poetry install +``` + +## Scripting Usage +To run a single training, you can run the following command: +```bash +python -m +``` +and to know the parameters you can use the help command: +```bash +python -m --help +``` + +### Deployment +You will need to install Docker to run the trainings in a container. +You can install Docker by following the instructions [here](https://docs.docker.com/get-docker/). + +To build the docker image of the project you can run the following command: +```bash +docker build -t :latest . +``` + +The container can be run in two different modes: + +- **release**: This mode is responsible for running the __main__.py of the current package. +- **it**: This is a development mode that is responsible for running the container in the interactive mode. + +To run a mode `` you can run the following command: +```bash +docker run --name - --detach --rm --volume=://data -e "MODE=" :latest +``` +where `` is the absolute path in your local machine where you want to store the data generated by the phase. +The `` is the root directory of the project. + +There is another way you can do all of this. You can use the `docker_files/build_image_and_run.py` script. This script +will build the image and run the mode you want. You can run the script with the following command: +```bash +python docker_files/build_image_and_run.py --mode= +``` + + +## References + + +## License + + +## Acknowledgements + + +## Citation +``` +``` \ No newline at end of file