Skip to content

Commit

Permalink
Restore support for python 3.6
Browse files Browse the repository at this point in the history
Python 3.6 EOL is 2021-12-23
  • Loading branch information
lcnittl committed Jan 18, 2021
1 parent 26fbbce commit 213f7fb
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
rev: v2.7.4
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py36-plus]
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Installation

1. ``pip install sphinxcontrib-email``

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


Configuration
-------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[tool.black]
line-length = 88
target-version = ["py37", "py38"]
target-version = ["py36", "py37", "py38"]
include = '\.pyi?$'
exclude = '''
/(
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Expand All @@ -34,7 +35,7 @@ packages = find_namespace:
install_requires =
Sphinx>=1.8
lxml>=4.5.2
python_requires = >=3.7
python_requires = >=3.6
include_package_data = True
package_dir =
= src
Expand Down
6 changes: 2 additions & 4 deletions src/sphinxcontrib/email/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from __future__ import annotations

from typing import Any
from typing import Any, Dict

import sphinx.util
from sphinx.application import Sphinx
Expand All @@ -21,7 +19,7 @@
logger = sphinx.util.logging.getLogger(__name__)


def setup(app: Sphinx) -> dict[str, Any]:
def setup(app: Sphinx) -> Dict[str, Any]:
app.add_config_value(name="email_automode", default=False, rebuild="env")
app.connect("html-page-context", html_page_context_handler)
app.add_role("email", EmailRole())
Expand Down
5 changes: 2 additions & 3 deletions src/sphinxcontrib/email/handlers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import html
import urllib.parse
from typing import Dict

import lxml.html # nosec # noqa DUO107
import sphinx.util
Expand All @@ -13,7 +12,7 @@


def html_page_context_handler(
app: Sphinx, pagename: str, templatename: str, context: dict, doctree: bool
app: Sphinx, pagename: str, templatename: str, context: Dict, doctree: bool
):
"""Search html for 'mailto' links and obfuscate them"""
if not app.config["email_automode"]:
Expand Down
5 changes: 2 additions & 3 deletions src/sphinxcontrib/email/roles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import re
from typing import List, Tuple

import sphinx.util
from docutils import nodes
Expand All @@ -14,7 +13,7 @@


class EmailRole(SphinxRole):
def run(self) -> tuple[list[Node], list[system_message]]:
def run(self) -> Tuple[List[Node], List[system_message]]:
"""Role to obfuscate e-mail addresses.
Handle addresses of the form
Expand Down
2 changes: 0 additions & 2 deletions src/sphinxcontrib/email/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import re
import textwrap
import xml.sax.saxutils # nosec
Expand Down

0 comments on commit 213f7fb

Please sign in to comment.