This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author acue
Recipients acue, dstufft, eric.araujo
Date 2019-11-06.05:02:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Even though this involves 'setuptools', I write this issue here because of the tight coupling of 'distutils' and 'setuptools' e.g. by the passed 'self' parameter.

The central API 'setup()' - 'setuptools.init.setup()' - provides the parameter 'distclass=<distribution-class>'. This allows to define a custom 'Distribution' class to be used as a replacement of the 'Distribution' class.

First of all for an ordinary user it is not clear whether 'distutils.dist.Distribution', and/or 'setuptools.dist.Distribution' is replaced. Even more confusing, the 'self' parameter is cross-passed between the classes by using a derived instance provided by:

   _Distribution = get_unpatched(distutils.core.Distribution)

The second is the integration of the initialization bootstrap, which completely ignores the user defined custom class. The main API 'setup()' defined in 'setuptools.init.setup()' calls first the local private function '_install_setup_requires' - 'setuptools.init._install_setup_requires()', which calls the instanciates the hardcoded 'distutils.core.Distribution()', and therein calls the methods 'dist.parse_config_files()', and 'dist.fetch_build_eggs()', which - as far as I can see - finally prohibits the use of a custom version of these, or easily add another one.

The consequence is that the configuration file parameters could basically not be fully customized by the custom class.

The association with the parameter 'distclass' for me - and I guess for others too - is that the 'complete' 'Distribution' class could be customized by this API. But this is currently not possible. So, even though I see the problems that can arise from the use of the modified 'self' parameter - I would propose the application of the 'distclass' for the initial bootstrap by the read of the configuration file too. In case this prooves too risky - due to 'distutils' coupling with 'setuptools', at least a parameter for the initial read of the configuration files should be offered.

The best of course would be the fusion of both parts, probably in a future release.

I have tested 3.8.0, but as far as I can see this is the case for all releases.

PS: I am writing now another issue for the 'alias' command and going add the number as an possible example for the required custom class.
Date User Action Args
2019-11-06 05:02:37acuesetrecipients: + acue, eric.araujo, dstufft
2019-11-06 05:02:37acuesetmessageid: <>
2019-11-06 05:02:37acuelinkissue38711 messages
2019-11-06 05:02:36acuecreate