-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Drop support for Python 2 #1763
Comments
cc @AWhetter :) |
Looks good to me. Especially part about not removing py2.x related code in a hurry. Keeing it will help with backporting any fixes to 1.8 branch.
Do we agree that having backport for 1.8.x ready is mandatory for merging any new bug fix pull request?
Dnia 11.12.2017 o godz. 12:20 Claudiu Popa <notifications@github.com> napisał(a):
… cc @AWhetter :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@rogalski Yeah, backporting bug fixes sounds good to me. We'll most likely won't backport features (e.g new checks or flags). |
This sounds good to me. I definitely think it's important to keep an LTS, Python 2 compatible version going alongside the Python 3 version! Looks like I need to knuckle down and get per directory configuration finished! I'm hoping I can get it done for v2.0. |
I agree with all of you and i also think it is very important to keep the ability to analyze python2 code even if it is with python3 interpreter. There are still projects using python2.7 and some of them will keep using it for a while... |
Here's the pip installs for pylint from PyPI for the last month (via
|
We use a lot of hardcoded version checks in both astroid and pylint. These checks will need to become dynamic if we are going to allow python 3 pylint to parse python2 code properly (that is I don't think it will happen without a gigantic amount of effort). |
That's true, @brycepg, there is a caveat that comes with Python 2 support in pylint 2.0 that wasn't mentioned: pylint is tied to its underlying AST parser. That is, we can still analyze Python 2 code as long as it doesn't use Python 2 specific syntax, so projects that rely on six to offer a Python 2/3 compatible code base could still be analysed by Pylint. Because of this, I'm not proposing to remove just yet Python 2 specific checks (but we can remove Python 2 specific syntax error checks, for instance for
|
I do not consider this an enhancement so long as Python 2 is a supported CPython runtime. The world is full of Python 2 code. This means there can be no new features added to pylint to help out the bulk of the worlds code bases (including lint features aimed at helping port to Python 3!) without someone creating a fork of the pylint project off of the 1.8 branch. :( At which point you've got two pylints, with diverging feature sets, checker behaviors, checker names, all sharing a common Please do not do this yet. Python 2 is quite relevant to the world at large. Lets keep pylint relevant. I fully support Django and NumPy moving forwards, but source code analysis tooling is a different matter as people use tools to improve their development practices no matter what language version their code is in. If you do this, you need regression tests to guarantee that "2 and 3" single source compatible code analyzed by pylint 1.8 on Python 2 does not have different warning behavior when analyzed by pylint 2.x+ running under Python 3? One can imagine a hellish situation where it becomes impossible to write lint clean code that passes both as implementations diverge. |
@gpshead Thanks for the input. I understand this is a bit sensible, so I wanted to have some time to think thoroughly with regard to your comment. One thing to start the discussion is that this decision wasn't necessarily motivated by a personal choice. Since PEP 479 changed the way StopIteration are handled inside generators, we found ourselves in a bit of a conundrum with regard to astroid, which uses StopIteration across the inference parts for propagating additional context out of the inference loop. The solutions we found meant either using exec() to generate different code for different versions, or changing the inference to work in some other way so it wouldn't rely on StopIteration, or completely dropping support for Python <3.3. Given this choice, we thought by dropping Python 2 support that we could leverage other nice things that could improve the code quality of the project: type annotations, That being said, I understand from where you're coming from, but at the same time I feel there is some FUD in your comment that somewhat feels aggressive. It's the second time this week that I've heard a similar comment from a pylint user, where either we do a disservice to the community at large or we're not going to be relevant just because we don't want to support an old version of Python. There is no financial incentive that motivates the Pylint committers to do their work, But now after seeing your point, I admit it would be drastic in a way to stop supporting the old Python 2 codebases by this 1.8 - 2.0 dichotomy, where 1.8 is frozen with regard to features. I think it is possible to find a middle ground. The initial proposal was for 1.8 to be bugfixes only, but I think it could be possible to spin a another 1.9 branch/release, that will keep working on Python 2. This one should receive bug fixes as mentioned, but extra I would say that it could also receive Let me know what you think. I hope that we can find a middle ground that could work for all of us. |
Apologies. Sorry for coming off so aggressive there. That was uncalled for frustration on my part after I did a git pull and found master no longer supporting Python 2. :( Thanks for explaining your reasoning on the implementation side! I don't actually know if there are going to be features worthwhile adding that deserve more than the 1.8 bugfix only branch so I wouldn't bother planning a 1.9 unless a set of desired new features for use on Python 2 is actually found. As for why I complain about this for pylint but not for the numpys and djangos of the world... major libraries and frameworks used within applications are developer leaders, their choice to drop Python 2 helps pull users who have been kicking and screaming forward. Good! I do not expect people view development time tool such as pylint the same way (it has a behind the scenes role - people don't think about it - it's effectively a "compile" time step). That said, people not thinking about it suggests that in the short term they won't even notice. So long as they get 1.8 vs 2.x depending on which python version they are using (which should be automatic thanks to pip and metadata), they'll be happy enough. |
I would like also my support for keeping Python 2 at least until EOS of 2.7 (unfortunately, py2k is still widely used for in-house code), but pain could me greatly decreased, if |
Closing this as the support was already removed. To summarise and to provide some extra context:
Let me know if you have any other concerns regarding this change! |
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0 effectively only support Python 3. Debian shipped with dual pylint versions in Buster: 1.9 as plain `pylint` for checking Python 2 code, and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid however, as of today, there is only one `pylint` package, offering `/usr/bin/pylint' which is Python-3-only, so our current strategy of looking for pylint3 won't work. I expect most distributions will end up calling pylint simply `pylint' (as Debian Bullseye does) and only support Python 3. Fix this by checking for `pylint3', and then for `pylint' if the former was not found. In case we end up `pylint', we also need to check that this is not some ancient 1.x version possibly running on/supporting only Python 2. [1] pylint-dev/pylint#1763 Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0 effectively only support Python 3. Debian shipped with dual pylint versions in Buster: 1.9 as plain `pylint` for checking Python 2 code, and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid however, as of today, there is only one `pylint` package, offering `/usr/bin/pylint' which is Python-3-only, so our current strategy of looking for pylint3 won't work. I expect most distributions will end up calling pylint simply `pylint' (as Debian Bullseye does) and only support Python 3. Fix this by checking for `pylint3', and then for `pylint' if the former was not found. In case we end up `pylint', we also need to check that this is not some ancient 1.x version possibly running on/supporting only Python 2. [1] pylint-dev/pylint#1763 Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0 effectively only support Python 3. Debian shipped with dual pylint versions in Buster: 1.9 as plain `pylint' for checking Python 2 code, and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid however, as of today, there is only one `pylint' package, offering `/usr/bin/pylint' which is Python-3-only, so our current strategy of looking for pylint3 won't work. I expect most distributions will end up calling pylint simply `pylint' (as Debian Bullseye does) and only support Python 3. Fix this by checking for `pylint3', and then for `pylint' if the former was not found. In case we end up with `pylint', we also need to check that this is not some ancient 1.x version possibly running on/supporting only Python 2. [1] pylint-dev/pylint#1763 Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0 effectively only support Python 3. Debian shipped with dual pylint versions in Buster: 1.9 as plain `pylint' for checking Python 2 code, and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid however, as of today, there is only one `pylint' package, offering `/usr/bin/pylint' which is Python-3-only, so our current strategy of looking for pylint3 won't work. I expect most distributions will end up calling pylint simply `pylint' (as Debian Bullseye does) and only support Python 3. Fix this by checking for `pylint3', and then for `pylint' if the former was not found. In case we end up with `pylint', we also need to check that this is not some ancient 1.x version possibly running on/supporting only Python 2. [1] pylint-dev/pylint#1763 Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0 effectively only support Python 3. Debian shipped with dual pylint versions in Buster: 1.9 as plain `pylint' for checking Python 2 code, and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid however, as of today, there is only one `pylint' package, offering `/usr/bin/pylint' which is Python-3-only, so our current strategy of looking for pylint3 won't work. I expect most distributions will end up calling pylint simply `pylint' (as Debian Bullseye does) and only support Python 3. Fix this by checking for `pylint3', and then for `pylint' if the former was not found. In case we end up with `pylint', we also need to check that this is not some ancient 1.x version possibly running on/supporting only Python 2. [1] pylint-dev/pylint#1763 Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0 effectively only support Python 3. Debian shipped with dual pylint versions in Buster: 1.9 as plain `pylint' for checking Python 2 code, and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid however, as of today, there is only one `pylint' package, offering `/usr/bin/pylint' which is Python-3-only, so our current strategy of looking for pylint3 won't work. I expect most distributions will end up calling pylint simply `pylint' (as Debian Bullseye does) and only support Python 3. Fix this by checking for `pylint3', and then for `pylint' if the former was not found. In case we end up with `pylint', we also need to check that this is not some ancient 1.x version possibly running on/supporting only Python 2. [1] pylint-dev/pylint#1763 Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
Recently Django 2.0 was released just with Python 3 support. I think we can drop Python 2 support as well, especially since it is planned to do so for Python 3.7, since afterwards some parts of astroid's inference engine will stop working due to the way we propagate context outside of generators.
I think we could try the following plan:
What do you think about this @rogalski @hippo91 and the rest of the folks?
The text was updated successfully, but these errors were encountered: