This is a template for setting up a new machine learning project. It includes automation features to make sure our code style is clean and unit testing.
So here is our set of tools to set up:
poetry
: Sort out virtual environments for good, all your project definitions inpyproject.toml
.black
: You can have any code style until it is black. Stop worrying about formatting your code.ruff
: New blazing fast linter, anything that black doesn't care about will be fixed here.pytest
: To unit test your code.pre-commit-hooks
: Automate all of the above and forget about them.GitHub Actions
: Run these on the remote as well, just to be sure.
pip install virtualenv
virtualenv .venv
source .venv/bin/activate
pip install -r requirements.txt
Once poetry
is installed, you can install the project dependencies by running:
poetry add black ruff pytest pre-commit
- Note: Make sure you either fork this repo or create a new repo with the same structure and copy the
.pre-commit-config.yaml
file to the root of your project.
pre-commit install
Feel free to create your own python scripts and run them using the following command:
poetry run python <python_script.py>