Skip to content

Commit 5ace8a3

Browse files
committed
fix: fix pdm and poetry detection based on build backend
1 parent caaa9f1 commit 5ace8a3

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

pdm.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ pr = "onepm:pr"
3131
pun = "onepm:pun"
3232
pa = "onepm:pa"
3333

34-
[project.optional-dependencies]
3534
[tool.pdm]
36-
version = {use_scm = true}
35+
version = {source = "scm"}
36+
3737
[tool.pdm.dev-dependencies]
3838
test = [
3939
"pytest>=7.1.2",

src/onepm/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ def determine_package_manager() -> str:
3232
return "pip"
3333
with open(pyproject_file, "rb") as f:
3434
pyproject_data = tomllib.load(f)
35-
if "pdm" in pyproject_data.get("tool", {}):
35+
build_backend = pyproject_data.get("build-system", {}).get("build-backend", "")
36+
if "pdm" in pyproject_data.get("tool", {}) or "pdm" in build_backend:
3637
return "pdm"
37-
if "poetry" in pyproject_data.get("tool", {}):
38+
if "poetry" in pyproject_data.get("tool", {}) or "poetry" in build_backend:
3839
return "poetry"
3940
return "pip"
4041

0 commit comments

Comments
 (0)