summaryrefslogtreecommitdiff
path: root/setuptools/config
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-22 18:44:24 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-03-22 18:44:24 +0000
commit88e613772ad54a97b8fedf3a4ebebf5a9d2678de (patch)
treee533c121c00255bd9bd067160b4fa5df08a3f8af /setuptools/config
parentbb01ab7c7470dc9ccd5c7196e727a8046ef88250 (diff)
downloadpython-setuptools-git-88e613772ad54a97b8fedf3a4ebebf5a9d2678de.tar.gz
Use better variable naming
Diffstat (limited to 'setuptools/config')
-rw-r--r--setuptools/config/pyprojecttoml.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py
index e0a8946f..bc76b111 100644
--- a/setuptools/config/pyprojecttoml.py
+++ b/setuptools/config/pyprojecttoml.py
@@ -87,11 +87,12 @@ def read_configuration(
asdict = load_file(filepath) or {}
project_table = asdict.get("project", {})
- tool_table = asdict.get("tool", {}).get("setuptools", {})
- if not asdict or not (project_table or tool_table):
+ tool_table = asdict.get("tool", {})
+ setuptools_table = tool_table.get("setuptools", {})
+ if not asdict or not (project_table or setuptools_table):
return {} # User is not using pyproject to configure setuptools
- # TODO: Remove once the future stabilizes
+ # TODO: Remove once the feature stabilizes
msg = (
"Support for project metadata in `pyproject.toml` is still experimental "
"and may be removed (or change) in future releases."
@@ -102,12 +103,14 @@ def read_configuration(
# the default would be an improvement.
# `ini2toml` backfills include_package_data=False when nothing is explicitly given,
# therefore setting a default here is backwards compatible.
- tool_table.setdefault("include-package-data", True)
- asdict.setdefault("tool", {})["setuptools"] = tool_table # persist changes
+ setuptools_table.setdefault("include-package-data", True)
+ # Persist changes:
+ asdict["tool"] = tool_table
+ tool_table["setuptools"] = setuptools_table
with _ignore_errors(ignore_option_errors):
# Don't complain about unrelated errors (e.g. tools not using the "tool" table)
- subset = {"project": project_table, "tool": {"setuptools": tool_table}}
+ subset = {"project": project_table, "tool": {"setuptools": setuptools_table}}
validate(subset, filepath)
if expand: