Write lockfile before calling the "post_lock" hook #1224
Labels
⭐ enhancement
Improvements for existing features
💝 good first issue
Good for newcomers
❓ help wanted
Extra attention is needed
Is your feature request related to a problem? Please describe.
First, thanks for the nice work with PDM. 😄
I've been trying to come up with a way to
pdm export
a requirements.txt file every time an update to the lockfile happens. As some vulnerability scanning services and other CI tools do not yet support parsing/reading/interpreting pdm.lock files, this would allow us to adopt the PDM without compromising other parts of the workflow.At first, we thought using PDM lifecycle hooks functionality would suffice. Something like
Unfortunately, that did not work, as the
post_lock
hook is called before the lockfile is written to the disk (snippet below)pdm/pdm/cli/actions.py
Lines 120 to 125 in 7d9c0f3
Describe the solution you'd like
Having the lockfile written to the disk before calling the
post_lock
hook would enable this functionality and make PDM's adoption easier for workflows that rely, at some point, on the standard requirements.txt file. 😃The text was updated successfully, but these errors were encountered: