Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace sys.version_info checks for Python 2 compatibility with another way of detecting the file environment #2070

Closed
PCManticore opened this issue May 9, 2018 · 3 comments
Labels
Enhancement ✨ Improvement to a component

Comments

@PCManticore
Copy link
Contributor

Pylint 2.0 drops support for running with Python 2 but we will still allow analysing Python 2 files. Unfortunately we sometimes use sys.version_info checks for doing different things on Python 2, such as looking for next instead of __next__. Instead of doing a check against the running environment, we should do a check against the given environment to pylint. Say for example that we'll allow this:

pylint ... -2 # Lint Python 2 files
pylint ... # by default assumes the code is Python 3
pylint ... -3 # maybe this should work as well? 
@PCManticore PCManticore added this to the 2.0 milestone May 9, 2018
@PCManticore PCManticore modified the milestones: 2.0, Next minor release Jul 11, 2018
@kayhayen
Copy link

Looking forward to this. Using divergent PyLint on a codebase, to check for both Python2 and Python3 compatibility has proven already difficult with different levels of bug fixes in 1.9.2 and 2.0.0 with e.g. too-many-statements.

Allowing to drop supporting PyLint before 2.1 would be great.

@cdce8p
Copy link
Member

cdce8p commented Oct 17, 2021

@Pierre-Sassoulas I think we can close this one as support for linting Python 2 code has been removed.

@Pierre-Sassoulas
Copy link
Member

I agree as we removed support for python version < 3.6 since 2.7. Thank for cleaning so much old issues, much appreciated !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

No branches or pull requests

4 participants