summaryrefslogtreecommitdiff
path: root/setuptools/dist.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-05 16:10:48 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-09 15:07:57 +0000
commita283eb486afc5bf335af4e40d305a8a5779aa843 (patch)
treee3274bf0888addb7065e4f1c322a4a034acf322c /setuptools/dist.py
parent7ff3dc10dc763a24cc9c3b44e713167b0485a340 (diff)
downloadpython-setuptools-git-a283eb486afc5bf335af4e40d305a8a5779aa843.tar.gz
Fix wrong order when partitioning TOML config files
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r--setuptools/dist.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py
index 4743eeed..8c995aca 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -818,11 +818,13 @@ class Distribution(_Distribution):
and loads configuration.
"""
tomlfiles = []
+ standard_project_metadata = Path(self.src_root or os.curdir, "pyproject.toml")
if filenames is not None:
- tomlfiles, other = partition(lambda f: Path(f).suffix == ".toml", filenames)
- filenames = other
- elif os.path.exists("pyproject.toml"):
- tomlfiles = ["pyproject.toml"]
+ parts = partition(lambda f: Path(f).suffix == ".toml", filenames)
+ filenames = list(parts[0]) # 1st element => predicate is False
+ tomlfiles = list(parts[1]) # 2nd element => predicate is True
+ elif standard_project_metadata.exists():
+ tomlfiles = [standard_project_metadata]
self._parse_config_files(filenames=filenames)