ancient-ghost-18695
01/10/2024, 4:17 PMpdm.backend build system with a dynamic build version from scm through pants package :: ?
On our current project, we've been trying to use git tags to automatically setup build versions, i.e. with the following tag subproject/X.Y.Z , PDM can automatically fetch the tag version using pdm build to produce the corresponding distribution dist/subproject-X.Y.Z-py3-none-any.whl.
However, through pants package :: , the backend doesn't seem to have access to those git tags. Has anyone else experienced this ? Is there a way to include those tags into the packaging process ?happy-kitchen-89482
01/10/2024, 6:39 PMhappy-kitchen-89482
01/10/2024, 6:39 PM[subprocess-environment]) that will cause PDM to find the git root?happy-kitchen-89482
01/10/2024, 6:40 PMancient-ghost-18695
01/10/2024, 10:21 PMPDM_BUILD_SCM_VERSION=X.Y.Z ; I'll check [subprocess-environment] next. Thanks for the idea !happy-kitchen-89482
01/11/2024, 3:45 PMhappy-kitchen-89482
01/11/2024, 3:45 PMgit binary in the PATH (or this may already be available, it depends)ancient-ghost-18695
01/11/2024, 4:30 PMtag_regex ( see repro )
Havent had the time to dwelve into PDM's implementation yet however so it may or may not depend on the git tag command; it could probably just be a simple glob search into .git/refs/tags folder
However this backend does not requires to run PDM in the project's root folder; it does resolve the current git repository from the closest parent folder automatically.happy-kitchen-89482
01/11/2024, 10:59 PMhappy-kitchen-89482
01/11/2024, 11:00 PM