Skip to content

Commit 29d3072

Browse files
committed
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.
1 parent fb864a9 commit 29d3072

File tree

7 files changed

+6
-61
lines changed

7 files changed

+6
-61
lines changed

.appveyor.yml

-29
This file was deleted.

.github/workflows/python-tox.yml

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ jobs:
1212
os: [ubuntu-latest, windows-latest]
1313
deps: [base, optional]
1414
include:
15-
- python: "pypy-2.7"
16-
os: ubuntu-latest
17-
deps: base
1815
- python: "pypy-3.10"
1916
os: ubuntu-latest
2017
deps: base

README.rst

+2-14
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ or:
2929
3030
By default, the ``document`` will be an ``xml.etree`` element instance.
3131
Whenever possible, html5lib chooses the accelerated ``ElementTree``
32-
implementation (i.e. ``xml.etree.cElementTree`` on Python 2.x).
32+
implementation.
3333

3434
Two other tree types are supported: ``xml.dom.minidom`` and
3535
``lxml.etree``. To use an alternative format, specify the name of
@@ -41,18 +41,6 @@ a treebuilder:
4141
with open("mydocument.html", "rb") as f:
4242
lxml_etree_document = html5lib.parse(f, treebuilder="lxml")
4343
44-
When using with ``urllib2`` (Python 2), the charset from HTTP should be
45-
pass into html5lib as follows:
46-
47-
.. code-block:: python
48-
49-
from contextlib import closing
50-
from urllib2 import urlopen
51-
import html5lib
52-
53-
with closing(urlopen("http://example.com/")) as f:
54-
document = html5lib.parse(f, transport_encoding=f.info().getparam("charset"))
55-
5644
When using with ``urllib.request`` (Python 3), the charset from HTTP
5745
should be pass into html5lib as follows:
5846

@@ -90,7 +78,7 @@ More documentation is available at https://html5lib.readthedocs.io/.
9078
Installation
9179
------------
9280

93-
html5lib works on CPython 2.7+, CPython 3.5+ and PyPy. To install:
81+
html5lib works on CPython 3.8+ and PyPy. To install:
9482

9583
.. code-block:: bash
9684

html5lib/html5parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def processSpaceCharacters(self, token):
427427
def processStartTag(self, token):
428428
# Note the caching is done here rather than BoundMethodDispatcher as doing it there
429429
# requires a circular reference to the Phase, and this ends up with a significant
430-
# (CPython 2.7, 3.8) GC cost when parsing many short inputs
430+
# (CPython 3.8) GC cost when parsing many short inputs
431431
name = token["name"]
432432
# In Py2, using `in` is quicker in general than try/except KeyError
433433
# In Py3, `in` is quicker when there are few cache hits (typically short inputs)
@@ -454,7 +454,7 @@ def startTagHtml(self, token):
454454
def processEndTag(self, token):
455455
# Note the caching is done here rather than BoundMethodDispatcher as doing it there
456456
# requires a circular reference to the Phase, and this ends up with a significant
457-
# (CPython 2.7, 3.8) GC cost when parsing many short inputs
457+
# (CPython 3.8) GC cost when parsing many short inputs
458458
name = token["name"]
459459
# In Py2, using `in` is quicker in general than try/except KeyError
460460
# In Py3, `in` is quicker when there are few cache hits (typically short inputs)

setup.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ def default_environment():
6363
'Operating System :: OS Independent',
6464
'Programming Language :: Python',
6565
'Programming Language :: Python :: 2',
66-
'Programming Language :: Python :: 2.7',
6766
'Programming Language :: Python :: 3',
68-
'Programming Language :: Python :: 3.5',
69-
'Programming Language :: Python :: 3.6',
70-
'Programming Language :: Python :: 3.7',
7167
'Programming Language :: Python :: 3.8',
7268
'Programming Language :: Python :: 3.9',
7369
'Programming Language :: Python :: 3.10',
@@ -109,7 +105,7 @@ def default_environment():
109105
'six>=1.9',
110106
'webencodings>=0.5.1',
111107
],
112-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
108+
python_requires=">=3.8",
113109
extras_require={
114110
# A conditional extra will only install these items when the extra is
115111
# requested and the condition matches.

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,35,36,37,38,39,310,311,py,py3}-{base,optional,oldest}
2+
envlist = py{38,39,310,311,py,py3}-{base,optional,oldest}
33

44
[testenv]
55
deps =

toxver.py

-7
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
$ toxver.py pypy-3.8 base
1313
TOXENV=pypy3-base
1414
15-
$ toxver.py 2.7 oldest
16-
TOXENV=py27-oldest
17-
1815
$ toxver.py ~3.12.0-0 optional
1916
TOXENV=py312-optional
2017
@@ -31,10 +28,6 @@ def main(argv):
3128

3229
deps = argv[2]
3330

34-
if argv[1].startswith("pypy-2"):
35-
print("TOXENV=pypy-" + deps)
36-
return 0
37-
3831
if argv[1].startswith("pypy-3"):
3932
print("TOXENV=pypy3-" + deps)
4033
return 0

0 commit comments

Comments
 (0)