question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drop Python 2 Support

See original GitHub issue

Python 2 is deprecated as of 2020. Dropping Python 2 support would simplify virtually every future change, since it invariably causes annoying and tricky-to-fix problems. Just one example is in my work on #81. Tests pass on Python 3 and fail on Python 2.

Todo

  • Remove imports future, backports, pathlib2
  • Update CI config
  • Update dependencies in setup.py
  • Remove monkey patch header_encode_patched
  • Replace u"" with ""
  • Remove coding=utf-8 from all files
  • Remove code from tests that accounts for newline differences produced by the email library in Python 2 vs. 3
  • Recursively search for “python 2”
  • Recursively search for “utf.?8”
  • Remove “inherit from object” and update pylint directives
  • Update Contributing docs
  • Bump major version before release

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
awdeoriocommented, Jul 16, 2021

Edit: Maybe also update the README for users whose default Python path still points to Python 2? (Like users who set up on older versions of MacOS? I don’t actually know if it’s still bundled in newer versions.)

Brainwave! I think that adding this to the setup.py should do the trick:

    python_requires='>=3.4',
1reaction
seshrscommented, Jul 16, 2021

Edit: Maybe also update the README for users whose default Python path still points to Python 2? (Like users who set up on older versions of MacOS? I don’t actually know if it’s still bundled in newer versions.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plan for dropping Python 2 support - Apache Spark
In the next major release in 2019, we will deprecate Python 2 support. · We will drop Python 2 support in a future...
Read more >
Dropping Python 2 Support From Open Source Projects
I've recently dropped Python 2 support from most of the open source projects I maintain. Python 2 support ends 2020-01-01 (see ...
Read more >
Sunsetting Python 2 support
The developers of the Python language extended support of Python 2.7 from 2015 to January 1, 2020, recognising that many people were still...
Read more >
Dropping Python 2 support · Issue #7367 - GitHub
The first step was to drop most Python-2-only third party packages. As a second step I suggest to drop the remaining Python-2-only packages...
Read more >
Python 2 EOL - Now What? - ActiveState
If you're like most Python developers, you've been working with Python 2 for years. Now, with the Python Software Foundation announcing the End ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found