Skip to content

Remove support for end-of-life Python 2.7 #432

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
wants to merge 1 commit into from
Closed

Remove support for end-of-life Python 2.7 #432

wants to merge 1 commit into from

Conversation

jdufresne
Copy link
Contributor

Python 2.7 has been EOL since 2020-01-01. It is no longer receiving
security updates.

By removing Python 2 support, can reduce testing resources and simplify
the code by removing compatibility shims.

Removes dependency on six.

Removes test dependency on mock.

@jgraham
Copy link
Member

jgraham commented Jan 9, 2020

I am strongly opposed to this. There are still many consumers of html5lib who can't or haven't migrated to Python 3. Although PSF is no longer supporting Python 2.7 it's still under support in e.g. RHEL.

@jdufresne
Copy link
Contributor Author

No problem. With this change, I'm only trying to help this project and the larger Python community. I figure sooner or later, someone would need to do this maintenance work. If the project policy is to continue supporting Python 2.7, no worries.

That said, Python 2.7 user can continue using the last release of html5lib that supported 2.7 which is 1.0.1 as of this writing, released Dec 7, 2017. As users haven't had a new release in over a year, there wouldn't really be any immediate change for them. The setup.py file users python_requires so pip would choose the best compatible version automatically.

Python 2.7 has been EOL since 2020-01-01. It is no longer receiving
security updates.

By removing Python 2 support, can reduce testing resources and simplify
the code by removing compatibility shims.

Removes dependency on six.

Removes test dependency on mock.
@codecov-io
Copy link

codecov-io commented Jan 9, 2020

Codecov Report

Merging #432 into master will decrease coverage by 0.82%.
The diff coverage is 86.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #432      +/-   ##
==========================================
- Coverage   90.52%   89.69%   -0.83%     
==========================================
  Files          50       49       -1     
  Lines        6973     6872     -101     
  Branches     1328     1310      -18     
==========================================
- Hits         6312     6164     -148     
- Misses        502      545      +43     
- Partials      159      163       +4
Impacted Files Coverage Δ
html5lib/tests/conftest.py 46.47% <ø> (-0.75%) ⬇️
html5lib/_trie/__init__.py 100% <ø> (ø) ⬆️
html5lib/treeadapters/__init__.py 100% <ø> (ø) ⬆️
html5lib/filters/alphabeticalattributes.py 100% <ø> (ø) ⬆️
html5lib/constants.py 100% <ø> (ø) ⬆️
html5lib/treeadapters/sax.py 72.41% <ø> (-0.92%) ⬇️
html5lib/treewalkers/dom.py 92.59% <ø> (-0.27%) ⬇️
html5lib/tests/test_sanitizer.py 94.52% <ø> (-0.08%) ⬇️
html5lib/tests/test_optionaltags_filter.py 100% <ø> (ø) ⬆️
html5lib/tests/test_whitespace_filter.py 100% <ø> (ø) ⬆️
... and 46 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af19281...04e4dba. Read the comment docs.

@gsnedders
Copy link
Member

Note that this implies pip staying on the last Py2-supporting release, which is potentially troublesome given the current last Py2 release doesn't support Py3.future and implies pip vending multiple versions of html5lib. I'd rather stick to the somewhat unwritten policy of supporting at least the same versions that pip supports (and we should document that).

Let's move any discussion about the policy to #439, and close this for now.

@gsnedders gsnedders closed this Feb 25, 2020
@jdufresne jdufresne deleted the py2 branch February 26, 2020 01:51
@jdufresne
Copy link
Contributor Author

Now that pip has dropped support for Python 2, perhaps this PR can be reconsidered? If so, I'll happily rebase.

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

Successfully merging this pull request may close these issues.

4 participants