Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 0/4] install-qa-check.d/60distutils-use-setuptools future-proof and fixes
Date: Sun, 18 Apr 2021 12:35:08
Message-Id: 20210418123454.35060-1-mgorny@gentoo.org
1 Hi,
2
3 This patchset introduces three changes to the DISTUTILS_USE_SETUPTOOLS
4 check:
5
6 1. Packages that do not install .egg-info (i.e. do not use distutils)
7 will now be required to use DISTUTILS_USE_SETUPTOOLS=no to avoid
8 unnecessary dep on setuptools. Previously, they were ignored.
9
10 2. Another class of entry points, 'gui_scripts' are now supported
11 besides 'console_scripts'.
12
13 3. The check has been relaxed to allow both 'bdepend' and 'rdepend'
14 for packages with entry points, the former being the new
15 recommendation.
16
17
18 Explanation:
19
20 Originally, runner scripts using entry points were implemented using
21 setuptools' pkg_resources package. Therefore, the check originally
22 enforced RDEPEND on dev-python/setuptools (i.e. pkg_resources provider)
23 whenever appropriate entry points were used.
24
25 However, modern versions of setuptools use either of three options,
26 in order of preference: importlib.metadata (built-in since Python 3.8),
27 importlib_metadata (backport) or pkg_resources. This means that for
28 Python 3.8+, no additional dependency is necessary, and for Python 3.7
29 it could be either dev-python/importlib_metadata
30 or dev-python/setuptools.
31
32 Since the removal of Python 3.7 was not that far away, we didn't update
33 the check before and assumed that the overdependence on setuptools
34 is acceptable. Now that it is getting really close, it is time to start
35 updating packages for it.
36
37 However, I don't think it's a good idea to suddenly make the check start
38 complaining about all the DISTUTILS_USE_SETUPTOOLS values that were
39 correct before, or for ago to start filing thousands of bugs about it.
40 For this reason, the check will now run in 'relaxed' mode that allows
41 both old (rdepend) and new (bdepend) value for entry point use.
42
43 Developers who want to start updating their packages early will be able
44 to set DISTUTILS_STRICT_ENTRY_POINTS=1 in their make.conf, and start
45 updating the variable on version bumps.
46
47 The new value is not 100% strictly correct until we actually remove
48 Python 3.7 (i.e. until 2021-06-01) but it shouldn't cause any real
49 issues.
50
51 --
52 Best regards,
53 Michał Górny
54
55
56 Michał Górny (4):
57 install-qa-check.d: Make DUS check distinguish entry points
58 install-qa-check.d: Extend DUS check to handle no egg-info
59 install-qa-check.d: Future-proof entry point values for DUS
60 install-qa-check.d: Make DUS aware of gui_scripts
61
62 .../60distutils-use-setuptools | 37 ++++++++++++-------
63 1 file changed, 24 insertions(+), 13 deletions(-)
64
65 --
66 2.31.1

Replies