These instructions are intended to get you started managing dependencies with PDM. Consult the PDM documentation for more detailed help.
-
To add/update/remove a package, use a Linux machine. The
pdm.lock
file is usually compatible across operating systems, but in some casespdm
can generate a lock file that is only compatible with the operating system family used to generate it. Ours should always be compatible with Linux. -
Start a new branch from
main
(git checkout main && git checkout -b {branch-name}
), or if you are already on a branch, get the latest changes from themain
to avoid merge conflicts withpdm.lock
(git merge main
). -
Synchronize the current installed dependencies with the lock file.
pdm sync
- Update
pyproject.toml
andpdm.lock
. This will install/update/uninstall the package from your current virtual environment.
# Add package(s) to pyproject.toml and install them
pdm add {package-name}
# Remove packages from pyproject.toml
pdm remove {package-name}
# Update all packages according to pyproject.toml
pdm update
# Update one package
pdm update {package-name}
-
Test and commit your changes to
pyproject.toml
andpdm.lock
. -
Make a pull request on Github with your changes and (after approval) merge it.
-
A Github action will make a second pull request to update all three
requirements/{platform}/requirements.txt
files based on your changes. This second PR must be merged before any further changes are made topdm.lock
.