setuptools version
setuptools==60.9.1
Python version
Python 3.8 and Python 3.9
OS
Ubuntu 20.04
Additional environment information
No response
Description
Since setuptools started vendoring importlib_metadata it is shadowing the actual package. This means that the type of entry points are no longer the class provided by the original importlib_metadata but the vendored package instead. Example:
Expected behavior
Installing setuptools should not have its vendored library shadow the real one changing the types returned by functions of the importlib_metadata package.
How to Reproduce
- Install
setuptools>=60.9.0 in Python 3.8 or Python 3.9
Output
Behavior of setuptools==60.8
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import setuptools
In [2]: setuptools.__version__
Out[2]: '60.8.0'
In [3]: from importlib_metadata import entry_points
In [4]: ep = entry_points().select(group='aiida.calculations', name='core.arithmetic.add')['core.arithmetic.add']
In [5]: type(ep)
Out[5]: importlib_metadata.EntryPoint
In [6]: str(ep)
Out[6]: "EntryPoint(name='core.arithmetic.add', value='aiida.calculations.arithmetic.add:ArithmeticAddCalculation', group='aiida.calculations')"
Behavior of setuptools>=60.9.0
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import setuptools
In [2]: setuptools.__version__
Out[2]: '60.9.1'
In [3]: from importlib_metadata import entry_points
In [4]: ep = entry_points().select(group='aiida.calculations', name='core.arithmetic.add')['core.arithmetic.add']
In [5]: type(ep)
Out[5]: setuptools._vendor.importlib_metadata.EntryPoint
In [6]: str(ep)
Out[6]: "EntryPoint(name='core.arithmetic.add', value='aiida.calculations.arithmetic.add:ArithmeticAddCalculation', group='aiida.calculations')"
Note how the type of the return value of entry_points().select has changed.
setuptools version
setuptools==60.9.1
Python version
Python 3.8 and Python 3.9
OS
Ubuntu 20.04
Additional environment information
No response
Description
Since
setuptoolsstarted vendoringimportlib_metadatait is shadowing the actual package. This means that the type of entry points are no longer the class provided by the originalimportlib_metadatabut the vendored package instead. Example:Expected behavior
Installing
setuptoolsshould not have its vendored library shadow the real one changing the types returned by functions of theimportlib_metadatapackage.How to Reproduce
setuptools>=60.9.0in Python 3.8 or Python 3.9Output
Behavior of
setuptools==60.8Behavior of
setuptools>=60.9.0Note how the type of the return value of
entry_points().selecthas changed.