Skip to content

Drop Python 2 support? #710

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

Closed
slarse opened this issue Feb 21, 2019 · 3 comments
Closed

Drop Python 2 support? #710

slarse opened this issue Feb 21, 2019 · 3 comments

Comments

@slarse
Copy link

slarse commented Feb 21, 2019

Also related to #309

There are a lot of files that try to support both Python 2 and Python 3, with mixed results. Then there are some files using explicit Python 3.6 features (such as f-strings), which makes running all files under both Python 2 and Python 3 a bit yanky.

While we can probably make most of this work using backporting libraries (such as future-fstrings), we could start going through all of your files and drop Python 2 support entirely. As Python 2 reaches end of life January 1st 2020, this should be done at some point, sooner rather than later. Do you want us to, at least start, to do it while refactoring the test suite? If so, which versions of Python should be supported?

For this whole project to be tested in a unified manner, it must require certain versions of Python. We can do this job for you, when the test suites have been set up.

@slarse
Copy link
Author

slarse commented Feb 21, 2019

To just be able to keep on working toward #309, we will assume Python 2 should be supported and consider anything that does not work at all in Python 2 to be bugs.

@slarse
Copy link
Author

slarse commented Feb 22, 2019

After some more digging around in the project, Python 2 support seems to be fairly poor already. There are 256 modules in total, and these are the results for just importing them in Python 2 and 3, respectively:

Python 2

  • 150 succeed
  • 106 fail
    • 14 fail because top level code reads from stdin
    • 4 timeout (blocking top-level code)
    • 81 import errors
  • Statement+branch coverage (from just importing): 20%

Python 3

  • 171 succeed
  • 85 fails
    • 32 fail because top level code reads from stdin
    • 11 timeout (blocking top-level code)
    • 33 import errors
  • Statement+branch coverage (from just importing): 22%

Note that import errors are of 2 types: external dependencies (such as matplotlib and numpy) and incorrect imports of adjacent modules.

To further #309, we will attempt to not break existing Python 2 compatibility, but we will not backport any Python 3 code, as it is in the majority.

The .lgtm is also only linting for Python 3 on your current CI.

@slarse slarse mentioned this issue Feb 22, 2019
@cclauss
Copy link
Member

cclauss commented Oct 23, 2019

This repo does not support legacy Python.

@cclauss cclauss closed this as completed Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants