Goal of this course/zoomcamp is to practice best practices of putting machine learning in production
Poetry is Python Package Management tool that helps managing package dependencies.
-
Install poetry as described in the Poetry installation section
-
Install packages based on defined versions in either
pyproject.toml
orpoetry.lock
. If you are interested to know details , please check Installing Dependencies section.poetry install
-
Activate the poetry environment
source {path_to_venv}/bin/activate
-
To add new packages to the poetry environment. Check the official documentation if you are unsure of usage
poetry add <package-name><condition><version>
Pre-Commit allows to run hooks on every commit automatically to point out issues such as missing semicolons, trailing whitespaces, etc.
-
Install pre-commit as described in the installation section
-
Pre-Commit configuration file is already configured in
.pre-commit-config.yaml
-
Running Pre-Commit on the repository, can be done in two different approach
3.1. Run on each commit, in that case, the hook scripts would not allow you to push your changes in GitHub and inform your code success after each commit. For enabling that you need to initiate that once on the repository level as following
pre-commit install
3.2. Run agains each file, allow you freedom to run hooks when you want, in that case there is no guarantee that each commit fits the coding standards that you defined in precommit configuration. But you can run against all of the files, whenever you want.
pre-commit run --all-files