PDM, as described, is a modern Python package and dependency manager supporting the latest PEP standards. But it is more than a package manager. It boosts your development workflow in various aspects. The most significant benefit is it installs and manages packages in a similar way to npm that doesn’t need to create a virtualenv at all!
PDM should be installed as described in the Installation instructions.
Once PDM is installed and configured, the project should be initialized
by running the following command. This will ask a series of questions,
where the defaults are usually safe, and produce a file called
pyproject.toml
.
pdm init
DVC is built to make ML models shareable and reproducible. It is designed to handle large files, data sets, machine learning models, and metrics as well as code.
As we are using PDM for managing python dependencies of the project, we
are able to add DVC by running pdm add dvc
. This will add it to the
pyproject.toml
file and install it into the environment.
To add DVC to the project, we need to do a one time initialization by
running pdm run dvc init
. This will generate a .dvc
directory which
stores it’s internal
files
as well as a files to DVC what files it should ignore.
nbdev is a notebook-driven development platform. Simply write notebooks with lightweight markup and get high-quality documentation, tests, continuous integration, and packaging for free!
As we are using nbdev for creating documentation automatically, we are
able to add nbdev by running pdm add nbdev
. This will add it to the
pyproject.toml
file and install it into the environment.
To add nbdev to the project, we need to do a one time initialzation by
running pdm run nbdev_new
. This will create a settings.ini
file with
project settings, a .github/workflows
directory containing workflows
for package building and documentation deploying, and a nbs
directory
containing jupyter notebooks for project files. These notebooks will be
deployed as documentation pages using Quarto
If you are using nbdev for documentation only without the package creation feature you can follow these steps: 1. Remove library files
rm setup.py .github/workflows/test.yaml nbs/00_core.ipynb
- Remove you library folder (this will be the
lib_path
field insettings.ini
)
rm -rf <lib_path>