generated from pdm-project/pdm
-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Hi.
I'm trying to wrap my head around pdm, pdm-backend and, more generally, how the hooks works and how are they actually connected.
At the moment my goal is to understand how I can leverage pdm to create a python file with the scm version. I have looked at Writing dynamic version to file and at Lifecycle and Hooks but I have some questions:
- let's say that I set up correctly
dynamic = ["version"]
,source = "scm"
, andwrite_to = "foo/_version.py"
in the appropriatepyproject.toml
tables. What cli command(s) will trigger the creation of the file? is there an explicit way? - During the initializazion, I have set
distribution = false
(because I'm writing a application that is meant to be used internally and deployed via dockerfile where I just copy the sources) - is this choice relevant? - Can you confirm I do need to set
pdm-backend
asbuild-backend
? or is it apdm
feature that may work withsetuptools
or any other backend? - What happens if in my git repository there is no tag (at all, or that matches the
tag_regex
)? I haven't see any log/warning/error during my tests - What is the rule to "choose" an appropriate tag, assuming there are more than one that matches?
- On
pdm-backend/src/pdm/backend/hooks/version/__init__.py
Lines 88 to 94 in 940d129
def resolve_version_from_scm( self, context: Context, write_to: str | None = None, write_template: str = "{}\n", tag_regex: str | None = None, ) -> str: hooks.version
module, but I haven't found any reference to it in the docs. Is that related to the pdm hooks?
I'm having these doubts because I have a project that I've recently migrated to pdm, and I'm new to it, and I want to be sure to understand how it works
Metadata
Metadata
Assignees
Labels
No labels