-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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.7 #1818
Comments
I'd recommend adding
Here's the pip installs for dvc from PyPI for March 2019:
Source:
Source: That's a very low proportion of Python 2, see https://dev.to/hugovk/python-version-share-over-time-4-26hm for some other projects. |
Time flies when you're having fun) |
For the record: trying to drop support for 2.7 (and 3.4, as it has reached EOL already) in conda-forge/dvc-feedstock#54 , as it is starting to cause problems during the build. |
what do you mean, @efiop ? is it happening? are we finally dropping 2.7? |
@MrOutis No, just dropping it where it causes serious issues. The main feast will come later, you won't miss it 😄 |
@MrOutis The joy probably won't fully come until py35 is dead, which is 1 more year 🙂 |
Eek |
@casperdcl Last release was 0.78.1 and it has py2 support, so not broken. We'll limit to >py3.4 in the next one. Plus would be probably nice to put some kind of sanity check for that in CLI and when importing |
what about using |
Are there py3-specific ABC features you refer to? |
No, @casperdcl; I thought that ABCs weren't implemented in Python 2.7, don't know why we are not using them for |
@MrOutis Let's not do that within this sprint, but rather create a separate ticket for that for later. We'll keep in mind them next time we are going to create appropriate classes. Relative imports could be moved to a separate ticket as well, as it is a bit unrelated and we currently mismatch relative and abs imports all over the codebase 🙂 |
I agree with @efiop - both features were supported in py2 (may have needed things like |
Great, @efiop , @casperdcl ; should check better next time, I thought they were not supported in Python 2.7, this is why I was asking 😅 |
The last thing to address is using This is how it looks like: >>> def hello(*, name='world'): print('hello', name)
>>> hello()
"hello world"
>>> hello("people")
TypeError: hello() takes 0 positional arguments but 1 was given It makes the interface more explicit. I can do it for |
Should we close this one or anyone has any other suggestion? @iterative/engineering |
Let's not leave this one open, we can handle any further suggestions on separate issues :) |
Python will drop support for 2.7 in January 1st, 2020, I think DVC should too, it will ease the maintenance (spending less time dealing with str/unicode issues, default support for type checking syntax, access to a more robust standard library, etc.).
Countdown for Python 2.7 EOL: https://pythonclock.org/
I don't know how many users are currently running on Python 2.7, but we can get a clue by analyzing pypi stats with BigQuery or using pypinfo.
There are some maintenance tasks to migrate to a Python 3.x only codebase:
Remove 2.7 and 3.4 from our conda packageUpgrade AppVeyor's Python versionpython_requires
and explicit version classifiers (kudos to @hugovk !)future
utils.compat
super()
to new syntaxDvcExceptions
to use default traceback instead of custom onelogger.py.
Removelogging
formatterparse_exc
logic and useformatException
andformatStack
insteadsystem.py
module to use the defaultos
methods for linking, as they include Windows supportMake keyword params kwonly in dvc.api. Consider the same in other places.(api: use only kwargs #3108)Feel free to edit this comment, modifying the list of tasks that should happen to make a clean transition.
NOTE: This issue was created to keep track of what should be done. I'm not implying that this will happen in a near future, neither expressing the ideas of the rest of the maintainers.
It would be great if you can write down your opinion so we reach a consensus between the maintainers and the community.
The text was updated successfully, but these errors were encountered: