Mailing List Archive

[PATCH 0/4] install-qa-check.d/60distutils-use-setuptools future-proof and fixes
Hi,

This patchset introduces three changes to the DISTUTILS_USE_SETUPTOOLS
check:

1. Packages that do not install .egg-info (i.e. do not use distutils)
will now be required to use DISTUTILS_USE_SETUPTOOLS=no to avoid
unnecessary dep on setuptools. Previously, they were ignored.

2. Another class of entry points, 'gui_scripts' are now supported
besides 'console_scripts'.

3. The check has been relaxed to allow both 'bdepend' and 'rdepend'
for packages with entry points, the former being the new
recommendation.


Explanation:

Originally, runner scripts using entry points were implemented using
setuptools' pkg_resources package. Therefore, the check originally
enforced RDEPEND on dev-python/setuptools (i.e. pkg_resources provider)
whenever appropriate entry points were used.

However, modern versions of setuptools use either of three options,
in order of preference: importlib.metadata (built-in since Python 3.8),
importlib_metadata (backport) or pkg_resources. This means that for
Python 3.8+, no additional dependency is necessary, and for Python 3.7
it could be either dev-python/importlib_metadata
or dev-python/setuptools.

Since the removal of Python 3.7 was not that far away, we didn't update
the check before and assumed that the overdependence on setuptools
is acceptable. Now that it is getting really close, it is time to start
updating packages for it.

However, I don't think it's a good idea to suddenly make the check start
complaining about all the DISTUTILS_USE_SETUPTOOLS values that were
correct before, or for ago to start filing thousands of bugs about it.
For this reason, the check will now run in 'relaxed' mode that allows
both old (rdepend) and new (bdepend) value for entry point use.

Developers who want to start updating their packages early will be able
to set DISTUTILS_STRICT_ENTRY_POINTS=1 in their make.conf, and start
updating the variable on version bumps.

The new value is not 100% strictly correct until we actually remove
Python 3.7 (i.e. until 2021-06-01) but it shouldn't cause any real
issues.

--
Best regards,
Micha? Górny


Micha? Górny (4):
install-qa-check.d: Make DUS check distinguish entry points
install-qa-check.d: Extend DUS check to handle no egg-info
install-qa-check.d: Future-proof entry point values for DUS
install-qa-check.d: Make DUS aware of gui_scripts

.../60distutils-use-setuptools | 37 ++++++++++++-------
1 file changed, 24 insertions(+), 13 deletions(-)

--
2.31.1