Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Python2.7 removal #1

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
only support pythons that are not EOL (https://endoflife.date/python)
Even debian oldstable has python 3.9. For internet-facing libraries it
is not secure for contributor to install unsupported python versions in order to test them.
Reducing the number of python versions will make maintenance and testing easier.
is not secure to contributor to install unsupported python versions in order to test them.
  • Loading branch information
Mic92 committed Sep 9, 2024
commit 29d3072ee1f982df582b88b4e120453cbbefd37e
29 changes: 0 additions & 29 deletions 29 .appveyor.yml

This file was deleted.

3 changes: 0 additions & 3 deletions 3 .github/workflows/python-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ jobs:
os: [ubuntu-latest, windows-latest]
deps: [base, optional]
include:
- python: "pypy-2.7"
os: ubuntu-latest
deps: base
- python: "pypy-3.10"
os: ubuntu-latest
deps: base
Expand Down
16 changes: 2 additions & 14 deletions 16 README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ or:

By default, the ``document`` will be an ``xml.etree`` element instance.
Whenever possible, html5lib chooses the accelerated ``ElementTree``
implementation (i.e. ``xml.etree.cElementTree`` on Python 2.x).
implementation.

Two other tree types are supported: ``xml.dom.minidom`` and
``lxml.etree``. To use an alternative format, specify the name of
Expand All @@ -41,18 +41,6 @@ a treebuilder:
with open("mydocument.html", "rb") as f:
lxml_etree_document = html5lib.parse(f, treebuilder="lxml")

When using with ``urllib2`` (Python 2), the charset from HTTP should be
pass into html5lib as follows:

.. code-block:: python

from contextlib import closing
from urllib2 import urlopen
import html5lib

with closing(urlopen("http://example.com/")) as f:
document = html5lib.parse(f, transport_encoding=f.info().getparam("charset"))

When using with ``urllib.request`` (Python 3), the charset from HTTP
should be pass into html5lib as follows:

Expand Down Expand Up @@ -90,7 +78,7 @@ More documentation is available at https://html5lib.readthedocs.io/.
Installation
------------

html5lib works on CPython 2.7+, CPython 3.5+ and PyPy. To install:
html5lib works on CPython 3.8+ and PyPy. To install:

.. code-block:: bash

Expand Down
4 changes: 2 additions & 2 deletions 4 html5lib/html5parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def processSpaceCharacters(self, token):
def processStartTag(self, token):
# Note the caching is done here rather than BoundMethodDispatcher as doing it there
# requires a circular reference to the Phase, and this ends up with a significant
# (CPython 2.7, 3.8) GC cost when parsing many short inputs
# (CPython 3.8) GC cost when parsing many short inputs
name = token["name"]
# In Py2, using `in` is quicker in general than try/except KeyError
# In Py3, `in` is quicker when there are few cache hits (typically short inputs)
Expand All @@ -454,7 +454,7 @@ def startTagHtml(self, token):
def processEndTag(self, token):
# Note the caching is done here rather than BoundMethodDispatcher as doing it there
# requires a circular reference to the Phase, and this ends up with a significant
# (CPython 2.7, 3.8) GC cost when parsing many short inputs
# (CPython 3.8) GC cost when parsing many short inputs
name = token["name"]
# In Py2, using `in` is quicker in general than try/except KeyError
# In Py3, `in` is quicker when there are few cache hits (typically short inputs)
Expand Down
6 changes: 1 addition & 5 deletions 6 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ def default_environment():
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down Expand Up @@ -109,7 +105,7 @@ def default_environment():
'six>=1.9',
'webencodings>=0.5.1',
],
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
python_requires=">=3.8",
extras_require={
# A conditional extra will only install these items when the extra is
# requested and the condition matches.
Expand Down
2 changes: 1 addition & 1 deletion 2 tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,35,36,37,38,39,310,311,py,py3}-{base,optional,oldest}
envlist = py{38,39,310,311,py,py3}-{base,optional,oldest}

[testenv]
deps =
Expand Down
7 changes: 0 additions & 7 deletions 7 toxver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
$ toxver.py pypy-3.8 base
TOXENV=pypy3-base

$ toxver.py 2.7 oldest
TOXENV=py27-oldest

$ toxver.py ~3.12.0-0 optional
TOXENV=py312-optional

Expand All @@ -31,10 +28,6 @@ def main(argv):

deps = argv[2]

if argv[1].startswith("pypy-2"):
print("TOXENV=pypy-" + deps)
return 0

if argv[1].startswith("pypy-3"):
print("TOXENV=pypy3-" + deps)
return 0
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.