Introducing PDM For Dependency Management, Task Running, and Environment Management #315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, project dependencies and tasks such as running the server through bash files, and items such as virtual environments are managed manually. This can get a bit messy and daunting to newcomers and non-technical contributors.
This is where PDM or other python build tools can help. After installing Python and installing PDM, users will be
pdm sync
to automatically create a virtual environment (.venv
), activate it, and pull all the dependencies and install them for the project and can even runpdm sync --group insiders
to get the insider dependencies as well assuming they have access to it. They can also runpdm run serve
(orpdm run serve-insiders
) to start up the servers (basically aliasingmkdocs serve
) along with with different run commands that allow you do start the server in insider mode, build the side, and more. And all of it can be managed either through the command line or through thepyproject.toml
file at the base of the project. Therefore, it mostly takes care about handling dependencies, commands, and managing the virtual environment, and more.Wanted to submit this in draft to propose this as a idea and wanted to gauge how yall feel about it before I update the documentation and onboarding stuff and add it to this PR. Let me know if you have any concerns or questions and I will try my best to answer them.
I chose PDM over other options bc its the most full fledged option, with all the tools that would be useful to us while not being too heavy. But there are other options like uv, poetry, or hatch, but they all are either overkill or are missing features that would be useful.
Also the lock file keeps track of all the package versions and makes sure you are getting the right package version by creating a hash of the package. But I cannot currently add the mkdocs material insiders package fork to the lock as I don't have access to it. So if someone who does have access could run
pdm lock
to add it to the lock file and commit it, that would be much appreaciated!