Skip to content

Commit d02675f

Browse files
committed
- Fix handling of tool section during pyproject.toml generation
1 parent f4e3edb commit d02675f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Change log
44
2.0 (unreleased)
55
----------------
66

7+
- Fix handling of ``tool`` section during ``pyproject.toml`` generation.
8+
79
- Add support for Python 3.14.
810

911
- Drop support for Python 3.9.

src/zope/meta/config_package.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ def pyproject_toml(self):
646646

647647
# Capture some pre-transformation data
648648
old_requires = toml_doc.get('build-system', {}).get('requires', [])
649+
old_tools = toml_doc.get('tool', {})
649650

650651
# Apply template-dependent defaults
651652
toml_defaults = self.render_with_meta(
@@ -669,6 +670,12 @@ def pyproject_toml(self):
669670
[old_requires.remove(x) for x in wheel_requirement]
670671
toml_doc['build-system']['requires'].extend(old_requires)
671672

673+
# Fix up tool sections because the call to ``update`` above will
674+
# replace the entire ``tool`` mapping...
675+
for k, v in old_tools.items():
676+
if k != 'coverage': # `coverage` settings are handled by template
677+
toml_doc['tool'][k] = v
678+
672679
# Update coverage-related data
673680
coverage = toml_doc['tool']['coverage']
674681
add_cfg = self.meta_cfg['coverage-run'].get('additional-config', [])

0 commit comments

Comments
 (0)