You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue happens on setuptools 50.0.2 (or greater than 50.0.1) and Python 3.5.1. Since setuptools version 50.0, setuptools overrides the stdlib distutils by default.
Setuptool's issue n°2232 : Once again, Setuptools overrides the stdlib distutils on import. For environments or invocations where this behavior is undesirable, users are provided with a temporary escape hatch. If the environment variable SETUPTOOLS_USE_DISTUTILS is set to stdlib, Setuptools will fall back to the legacy behavior.
Pylint starts to throw out false alarms on no-name-in-module in Python 3.5.1.
Steps to reproduce
Create the environment with the latest setuptools - pip install -U setuptools
Create a simple python file to import stdlib function, e.g.
"""Test."""
from math import sqrt
print(sqrt(2))
Current behavior
Pylint throws out alerts of "no-name-in-module" on the stdlib functions
$ pylint test_pylint.py
************* Module test_pylint
test_pylint.py:2:0: E0611: No name 'sqrt' in module 'math' (no-name-in-module)
----------------------------------------------------------------------
Your code has been rated at -15.00/10 (previous run: 10.00/10, -25.00)
Expected behavior
For setuptools versions < 50.0, pylint behaves correctly.
Same behavior if setuptools falls back to the legacy behavior, i.e.
$ SETUPTOOLS_USE_DISTUTILS=stdlib pylint test_pylint.py
---------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: -2.50/10, +12.50)
pylint --version output
pylint 2.6.0
astroid 2.4.2
Python 3.5.1 (default, May 29 2019, 15:41:33)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Potential impact
As mentioned in the setuptools ticket, it is likely that other micro Python versions e.g. Python 3.5.X, 3.6.X and 3.7.X are impacted as well, while I haven't tested them.
The text was updated successfully, but these errors were encountered:
I had to fix something similar in the build in 2261844, but to be fair I don't understand a lot about the issue and how to fix it permanently without using the hack they gave in their release note.
The setuptools behaviour has been reverted in 50.1.0 so now the issue is not urgent until they flip back the distutils hack again. My understanding the hatch is done by inserting the meta path finder.
Meanwhile could you shed me the light how pylint looks up the module and returns the no module alert?
Background
The issue happens on setuptools 50.0.2 (or greater than 50.0.1) and Python 3.5.1. Since setuptools version 50.0, setuptools overrides the stdlib distutils by default.
https://setuptools.readthedocs.io/en/latest/history.html
Pylint starts to throw out false alarms on no-name-in-module in Python 3.5.1.
Steps to reproduce
pip install -U setuptools
Current behavior
Pylint throws out alerts of "no-name-in-module" on the stdlib functions
Expected behavior
For setuptools versions < 50.0, pylint behaves correctly.
Same behavior if setuptools falls back to the legacy behavior, i.e.
pylint --version output
Potential impact
As mentioned in the setuptools ticket, it is likely that other micro Python versions e.g. Python 3.5.X, 3.6.X and 3.7.X are impacted as well, while I haven't tested them.
The text was updated successfully, but these errors were encountered: