Skip to content

Commit f1ccfef

Browse files
chore: pyproject_reading: add constants
1 parent 02cf5b0 commit f1ccfef

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/setuptools_scm/_integration/pyproject_reading.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
_ROOT = "root"
1919

2020

21+
DEFAULT_PYPROJECT_PATH = Path("pyproject.toml")
22+
DEFAULT_TOOL_NAME = "setuptools_scm"
23+
24+
2125
@dataclass
2226
class PyProjectData:
2327
path: Path
@@ -50,8 +54,8 @@ def for_testing(
5054
project["dynamic"] = ["version"]
5155

5256
return cls(
53-
path=Path("pyproject.toml"),
54-
tool_name="setuptools_scm",
57+
path=DEFAULT_PYPROJECT_PATH,
58+
tool_name=DEFAULT_TOOL_NAME,
5559
project=project,
5660
section={},
5761
is_required=is_required,
@@ -60,7 +64,9 @@ def for_testing(
6064
)
6165

6266
@classmethod
63-
def empty(cls, path: Path, tool_name: str) -> PyProjectData:
67+
def empty(
68+
cls, path: Path = DEFAULT_PYPROJECT_PATH, tool_name: str = DEFAULT_TOOL_NAME
69+
) -> PyProjectData:
6470
return cls(
6571
path=path,
6672
tool_name=tool_name,
@@ -125,8 +131,8 @@ def has_build_package(
125131

126132

127133
def read_pyproject(
128-
path: Path = Path("pyproject.toml"),
129-
tool_name: str = "setuptools_scm",
134+
path: Path = DEFAULT_PYPROJECT_PATH,
135+
tool_name: str = DEFAULT_TOOL_NAME,
130136
canonical_build_package_name: str = "setuptools-scm",
131137
_given_result: _t.GivenPyProjectResult = None,
132138
) -> PyProjectData:

0 commit comments

Comments
 (0)