Skip to content

Commit

Permalink
fix: Treat PDM_BUILD_SCM_VERSION empty string as unset (#238)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryukinix authored May 28, 2024
1 parent f7606bc commit 596f1dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pdm/backend/hooks/version/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def resolve_version_from_scm(
version_format: str | None = None,
fallback_version: str | None = None,
) -> str:
if "PDM_BUILD_SCM_VERSION" in os.environ:
if os.environ.get("PDM_BUILD_SCM_VERSION"):
version = os.environ["PDM_BUILD_SCM_VERSION"]
else:
if version_format is not None:
Expand Down

0 comments on commit 596f1dc

Please sign in to comment.