Skip to content

Commit c850ac6

Browse files
committed
DROP(PY) All PY3.6 libs & limitations
1 parent 5f836b1 commit c850ac6

File tree

5 files changed

+5
-27
lines changed

5 files changed

+5
-27
lines changed

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ v2.2.0 (20 Nov 2019, @ankostis): enhance OPERATIONS & restruct their modules
11601160

11611161
v2.1.1 (12 Nov 2019, @ankostis): global configs
11621162
===============================================
1163-
+ BREAK: drop Python-3.6 compatibility.
1163+
+ BREAK: drop Python < 3.6 compatibility.
11641164
+ FEAT: Use (possibly multiple) global configurations for all networks,
11651165
stored in a :class:`contextvars.ContextVar`.
11661166
+ ENH/BREAK: Use a (possibly) single `execution_pool` in global-configs.

graphtik/autograph.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from collections import ChainMap
1818
from inspect import Parameter
1919
from pathlib import Path
20+
from re import Pattern as RegexPattern
2021
from types import ModuleType
2122
from typing import (
2223
Any,
@@ -40,13 +41,6 @@
4041
from .fnop import FnOp, reparse_operation_data
4142
from .modifier import is_sfx, keyword, optional, sfxed, token
4243

43-
try:
44-
from re import Pattern as RegexPattern
45-
except ImportError:
46-
# PY3.6
47-
from typing import Pattern as RegexPattern
48-
49-
5044
log = logging.getLogger(__name__)
5145

5246
_my_project_dir = Path(__file__).parent

graphtik/sphinxext/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Extends Sphinx with :rst:dir:`graphtik` directive for :term:`plotting <plotter>` from doctest code.
55
"""
66
import collections.abc as cabc
7+
import importlib.resources as pkg_resources
78
import itertools as itt
89
import os
910
import re
@@ -35,12 +36,6 @@
3536

3637
from .. import __version__
3738

38-
try:
39-
import importlib.resources as pkg_resources
40-
except ImportError:
41-
# Use backported to PY<3.7 `importlib_resources` lib.
42-
import importlib_resources as pkg_resources # noqa
43-
4439
obj_name = "graphtik diagram"
4540
role_name = "graphtik"
4641
log = logging.getLogger(__name__)

setup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def _ask_git_version() -> Optional[str]:
5050
"jinja2>=3",
5151
# Direct use now due to jinja2-3+.
5252
"MarkupSafe",
53-
"importlib_resources; python_version<'3.7'",
5453
]
5554
matplot_deps = plot_deps + ["matplotlib"]
5655
sphinx_deps = plot_deps + ["sphinx[setuptools] >=2", "sphinxext-opengraph"]
@@ -94,12 +93,9 @@ def _ask_git_version() -> Optional[str]:
9493
"graphtik": ["py.typed"],
9594
"graphtik.sphinxext": ["*.css"],
9695
},
97-
python_requires=">=3.6",
96+
python_requires=">=3.7",
9897
install_requires=[
99-
"contextvars; python_version < '3.7'",
100-
"dataclasses; python_version < '3.7'",
101-
"networkx; python_version >= '3.5'",
102-
"networkx == 2.2; python_version < '3.5'",
98+
"networkx",
10399
"boltons", # for IndexSet
104100
],
105101
extras_require={
@@ -139,7 +135,6 @@ def _ask_git_version() -> Optional[str]:
139135
"Operating System :: POSIX",
140136
"Operating System :: Unix",
141137
"Programming Language :: Python",
142-
"Programming Language :: Python :: 3.6",
143138
"Programming Language :: Python :: 3.7",
144139
"Programming Language :: Python :: 3.8",
145140
"Programming Language :: Python :: 3.9",

test/test_plot.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,6 @@ def dot_str_pipeline():
547547
)
548548

549549

550-
@pytest.mark.skipif(
551-
sys.version_info < (3, 7), reason="PY3.6- have different docstrings for builtins."
552-
)
553550
def test_node_dot_str0(dot_str_pipeline):
554551
dot_str = str(dot_str_pipeline.plot())
555552
print(dot_str)
@@ -605,9 +602,6 @@ def test_node_dot_str0(dot_str_pipeline):
605602
assert _striplines(dot_str) == _striplines(exp)
606603

607604

608-
@pytest.mark.skipif(
609-
sys.version_info < (3, 7), reason="PY3.6 - has different docstrings for builtins."
610-
)
611605
def test_node_dot_str1(dot_str_pipeline, monkeypatch):
612606
## Test node-hidding & Graph-overlaying.
613607
#

0 commit comments

Comments
 (0)