A ready to go project structure with
- Python, version 3.12 or above.
- Poetry package/dependency manager.
- Multi-stage
Dockerfile
for containerizing this poetry project. - Configured
pre-commit
checks. - Configured logging: handlers (non-blocking queue handler, file-based handler and stderr) and formatters (simple and JSON).
- Business logic is intended to go into the package called
/app
.
Depending on your setup, some steps might not be necessary
- Set python version to be used for the project with
poetry env use [path/to/python/executable]
- Install virtual environment and project dependencies with
poetry install
- Start the application through a pre-defined poetry script with
poetry run start
.
Depending on your setup, some steps might not be necessary
- Initialize git repository with
git init
- Add dependencies with
poetry add [depencency-name]
- Add dependencies to a specified group (e.g. dev dependencies) with
poetry add [depencency-name] --group [group-name]
- Configure pre-commit hooks with
poetry run pre-commit install
- Attention, if you can (and want to) use a GPU locally, run
poetry install --with gpu
. This would install a CUDA-enabled version of PyTorch. Adjust as necessary.
- Attention, if you can (and want to) use a GPU locally, run
- Run pre-commit hooks once on all files with
poetry run pre-commit run --all-files
- Run tests with
poetry run pytest