@@ -271,6 +271,7 @@ def from_file(
271271 name : str | os .PathLike [str ] = "pyproject.toml" ,
272272 dist_name : str | None = None ,
273273 missing_file_ok : bool = False ,
274+ missing_section_ok : bool = False ,
274275 ** kwargs : Any ,
275276 ) -> Configuration :
276277 """
@@ -279,10 +280,20 @@ def from_file(
279280 not installed or the file has invalid format or does
280281 not contain setuptools_scm configuration (either via
281282 _ [tool.setuptools_scm] section or build-system.requires).
283+
284+ Parameters:
285+ - name: path to pyproject.toml
286+ - dist_name: name of the distribution
287+ - missing_file_ok: if True, do not raise an error if the file is not found
288+ - missing_section_ok: if True, do not raise an error if the section is not found
289+ (workaround for not walking the dependency graph when figuring out if setuptools_scm is a dependency)
290+ - **kwargs: additional keyword arguments to pass to the Configuration constructor
282291 """
283292
284293 try :
285- pyproject_data = _read_pyproject (Path (name ))
294+ pyproject_data = _read_pyproject (
295+ Path (name ), missing_section_ok = missing_section_ok
296+ )
286297 except FileNotFoundError :
287298 if missing_file_ok :
288299 log .warning ("File %s not found, using empty configuration" , name )
0 commit comments