Skip to content

Commit 213f7fb

Browse files
committed
Restore support for python 3.6
Python 3.6 EOL is 2021-12-23
1 parent 26fbbce commit 213f7fb

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repos:
3535
rev: v2.7.4
3636
hooks:
3737
- id: pyupgrade
38-
args: [--py37-plus]
38+
args: [--py36-plus]
3939
- repo: https://github.com/psf/black
4040
rev: 20.8b1
4141
hooks:

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Installation
3434

3535
1. ``pip install sphinxcontrib-email``
3636

37+
Support for python 3.6 will be dropped after its EOL on 2021-12-23.
38+
3739

3840
Configuration
3941
-------------

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[tool.black]
66
line-length = 88
7-
target-version = ["py37", "py38"]
7+
target-version = ["py36", "py37", "py38"]
88
include = '\.pyi?$'
99
exclude = '''
1010
/(

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ classifiers =
1919
Operating System :: OS Independent
2020
Programming Language :: Python :: 3
2121
Programming Language :: Python :: 3 :: Only
22+
Programming Language :: Python :: 3.6
2223
Programming Language :: Python :: 3.7
2324
Programming Language :: Python :: 3.8
2425
Programming Language :: Python :: 3.9
@@ -34,7 +35,7 @@ packages = find_namespace:
3435
install_requires =
3536
Sphinx>=1.8
3637
lxml>=4.5.2
37-
python_requires = >=3.7
38+
python_requires = >=3.6
3839
include_package_data = True
3940
package_dir =
4041
= src

src/sphinxcontrib/email/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from __future__ import annotations
2-
3-
from typing import Any
1+
from typing import Any, Dict
42

53
import sphinx.util
64
from sphinx.application import Sphinx
@@ -21,7 +19,7 @@
2119
logger = sphinx.util.logging.getLogger(__name__)
2220

2321

24-
def setup(app: Sphinx) -> dict[str, Any]:
22+
def setup(app: Sphinx) -> Dict[str, Any]:
2523
app.add_config_value(name="email_automode", default=False, rebuild="env")
2624
app.connect("html-page-context", html_page_context_handler)
2725
app.add_role("email", EmailRole())

src/sphinxcontrib/email/handlers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from __future__ import annotations
2-
31
import html
42
import urllib.parse
3+
from typing import Dict
54

65
import lxml.html # nosec # noqa DUO107
76
import sphinx.util
@@ -13,7 +12,7 @@
1312

1413

1514
def html_page_context_handler(
16-
app: Sphinx, pagename: str, templatename: str, context: dict, doctree: bool
15+
app: Sphinx, pagename: str, templatename: str, context: Dict, doctree: bool
1716
):
1817
"""Search html for 'mailto' links and obfuscate them"""
1918
if not app.config["email_automode"]:

src/sphinxcontrib/email/roles.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from __future__ import annotations
2-
31
import re
2+
from typing import List, Tuple
43

54
import sphinx.util
65
from docutils import nodes
@@ -14,7 +13,7 @@
1413

1514

1615
class EmailRole(SphinxRole):
17-
def run(self) -> tuple[list[Node], list[system_message]]:
16+
def run(self) -> Tuple[List[Node], List[system_message]]:
1817
"""Role to obfuscate e-mail addresses.
1918
2019
Handle addresses of the form

src/sphinxcontrib/email/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import re
42
import textwrap
53
import xml.sax.saxutils # nosec

0 commit comments

Comments
 (0)