Skip to content

Commit 596f1dc

Browse files
authored
fix: Treat PDM_BUILD_SCM_VERSION empty string as unset (#238)
Doesn't makes sense to have a empty version, make easier to treat PDM_BUILD_SCM_VERSION as empty string when you don't have tag information, and instead, use fallback_version.
1 parent f7606bc commit 596f1dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pdm/backend/hooks/version/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def resolve_version_from_scm(
7979
version_format: str | None = None,
8080
fallback_version: str | None = None,
8181
) -> str:
82-
if "PDM_BUILD_SCM_VERSION" in os.environ:
82+
if os.environ.get("PDM_BUILD_SCM_VERSION"):
8383
version = os.environ["PDM_BUILD_SCM_VERSION"]
8484
else:
8585
if version_format is not None:

0 commit comments

Comments
 (0)