Skip to content

Commit 446e979

Browse files
committed
- Print out a warning if a setuptools install time dependency is found
1 parent 16011fe commit 446e979

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGES.rst

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

7+
- Print out a warning if a ``setuptools`` install time dependency is found
8+
when runing the the ``config-package`` and ``setup-to-pyproject`` scripts.
9+
710
- Change ``c-code`` GitHub Actions publishing step to use
811
PyPI's "Trusted Publishing".
912
(`#198 <https://github.com/zopefoundation/meta/issues/198>`_)

src/zope/meta/config_package.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,14 @@ def pyproject_toml(self):
605605
old_requires = toml_doc.get('build-system', {}).get('requires', [])
606606
old_tools = toml_doc.get('tool', {})
607607

608+
# Do some sanity checking
609+
project_settings = toml_doc.get('project', {})
610+
for install_dependency in project_settings.get('dependencies', []):
611+
if install_dependency.startswith('setuptools'):
612+
print('XXX Found "setuptools" as install time dependency.')
613+
print('XXX Please check if it is really needed!')
614+
break
615+
608616
# Apply template-dependent defaults
609617
toml_defaults = self.render_with_meta(
610618
'pyproject_defaults.toml.j2',

src/zope/meta/setup_to_pyproject.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ def setup_args_to_toml_dict(setup_py_path, setup_kwargs):
239239

240240
install_reqs = setup_kwargs.pop('install_requires', [])
241241
if install_reqs:
242+
for dependency in install_reqs:
243+
if dependency.startswith('setuptools'):
244+
print('XXX Found "setuptools" as install time dependency.')
245+
print('XXX Please check if it is really needed!')
246+
break
242247
p_data['dependencies'] = install_reqs
243248

244249
keywords = setup_kwargs.pop('keywords', '')

0 commit comments

Comments
 (0)