Skip to content

Commit 8930817

Browse files
committed
Merge branch 'main' of github.com:pdm-project/pdm-backend
2 parents ba98c85 + 596f1dc commit 8930817

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ repos:
1111
- --py38-plus
1212

1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: 'v0.3.5'
14+
rev: 'v0.4.3'
1515
hooks:
1616
- id: ruff
1717
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
1818
- id: ruff-format
1919

2020
- repo: https://github.com/pre-commit/mirrors-mypy
21-
rev: v1.9.0
21+
rev: v1.10.0
2222
hooks:
2323
- id: mypy
2424
exclude: ^(src/pdm/backend/_vendor|tests|scripts)

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:

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ def hg_parse_version(root: StrPath, config: Config) -> SCMVersion | None:
287287
root,
288288
)
289289
tag: str | None
290-
tag, node, branch = output.rsplit("-", 2)
290+
try:
291+
tag, node, branch = output.rsplit("-", 2)
292+
except ValueError:
293+
return None # unpacking failed, unexpected hg repo
291294
# If no tag exists passes the tag filter.
292295
if tag == "null":
293296
tag = None

0 commit comments

Comments
 (0)