18
18
_ROOT = "root"
19
19
20
20
21
+ DEFAULT_PYPROJECT_PATH = Path ("pyproject.toml" )
22
+ DEFAULT_TOOL_NAME = "setuptools_scm"
23
+
24
+
21
25
@dataclass
22
26
class PyProjectData :
23
27
path : Path
@@ -50,8 +54,8 @@ def for_testing(
50
54
project ["dynamic" ] = ["version" ]
51
55
52
56
return cls (
53
- path = Path ( "pyproject.toml" ) ,
54
- tool_name = "setuptools_scm" ,
57
+ path = DEFAULT_PYPROJECT_PATH ,
58
+ tool_name = DEFAULT_TOOL_NAME ,
55
59
project = project ,
56
60
section = {},
57
61
is_required = is_required ,
@@ -60,7 +64,9 @@ def for_testing(
60
64
)
61
65
62
66
@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 :
64
70
return cls (
65
71
path = path ,
66
72
tool_name = tool_name ,
@@ -125,8 +131,8 @@ def has_build_package(
125
131
126
132
127
133
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 ,
130
136
canonical_build_package_name : str = "setuptools-scm" ,
131
137
_given_result : _t .GivenPyProjectResult = None ,
132
138
) -> PyProjectData :
0 commit comments