summaryrefslogtreecommitdiff
path: root/setuptools/config/pyprojecttoml.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-27 16:57:26 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-27 17:07:48 +0100
commit603bb9852f3a6a53c97beaccc9f58dc47771a486 (patch)
treecd341f56a70f4551d583ece22d70e087630f3ac7 /setuptools/config/pyprojecttoml.py
parent2304d9992b74c3080955563cac24af0670db652b (diff)
downloadpython-setuptools-git-603bb9852f3a6a53c97beaccc9f58dc47771a486.tar.gz
Fix previous detection of empty arrays
Diffstat (limited to 'setuptools/config/pyprojecttoml.py')
-rw-r--r--setuptools/config/pyprojecttoml.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py
index 0ee1b8f9..e20d71d2 100644
--- a/setuptools/config/pyprojecttoml.py
+++ b/setuptools/config/pyprojecttoml.py
@@ -282,11 +282,12 @@ class _ConfigExpander:
)
# `None` indicates there is nothing in `tool.setuptools.dynamic` but the value
# might have already been set by setup.py/extensions, so avoid overwriting.
- self.project_cfg.update({k: v for k, v in obtained_dynamic.items() if v})
+ updates = {k: v for k, v in obtained_dynamic.items() if v is not None}
+ self.project_cfg.update(updates)
def _ensure_previously_set(self, dist: "Distribution", field: str):
previous = _PREVIOUSLY_DEFINED[field](dist)
- if not previous and not self.ignore_option_errors:
+ if previous is None and not self.ignore_option_errors:
msg = (
f"No configuration found for dynamic {field!r}.\n"
"Some dynamic fields need to be specified via `tool.setuptools.dynamic`"