Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pdm-project/pdm-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Jun 17, 2024
2 parents ba98c85 + 596f1dc commit 8930817
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ repos:
- --py38-plus

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

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.10.0
hooks:
- id: mypy
exclude: ^(src/pdm/backend/_vendor|tests|scripts)
Expand Down
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
5 changes: 4 additions & 1 deletion src/pdm/backend/hooks/version/scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ def hg_parse_version(root: StrPath, config: Config) -> SCMVersion | None:
root,
)
tag: str | None
tag, node, branch = output.rsplit("-", 2)
try:
tag, node, branch = output.rsplit("-", 2)
except ValueError:
return None # unpacking failed, unexpected hg repo
# If no tag exists passes the tag filter.
if tag == "null":
tag = None
Expand Down

0 comments on commit 8930817

Please sign in to comment.