New submission from Arno-Can Uestuensoez <acue.opensou...@gmail.com>:

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.

----------
components: Distutils
messages: 356090
nosy: acue, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: setup parameter 'distclass' ignored for configuration files
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38711>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to