Skip to content

Commit 2902001

Browse files
committed
Fix TypedDict for 3.7. Disable 3.6 support/tests.
1 parent 77222fa commit 2902001

File tree

5 files changed

+27
-26
lines changed

5 files changed

+27
-26
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ['3.6', '3.7', '3.8', '3.9']
19+
python-version: ['3.7', '3.8', '3.9']
2020

2121
steps:
2222
- uses: actions/checkout@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,6 @@ flattened_items = [exporter.export_item_as_row(x) for x in item_list]
470470
 
471471

472472
## Requirements
473-
- Python 3.6+
473+
- Python 3.7+
474474
- Works on Linux, Windows, macOS, BSD
475475
<br><br>

flattering/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
import json # NOQA
33
import logging
44
import re
5+
import sys
56
from functools import wraps
67
from os import PathLike
78
from typing import Dict, Hashable, List, TextIO, Tuple, Union
89

9-
# Python 3.6/3.7 compatibility
10-
try:
10+
# Python 3.7 compatibility
11+
if sys.version_info >= (3, 8):
1112
from typing import TypedDict
12-
except ImportError:
13+
else:
1314
from typing_extensions import TypedDict
1415

1516
import attr

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ pre-commit>=2.15.0
22
tox>=3.24.3
33
pytest>=6.2.5
44
typing-extensions>=3.10.0.2
5+
pytest-cov>=2.12.1

tox.ini

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
[tox]
2-
envlist = py38,mypy,isort,black,flake8,doc
2+
envlist = py37,py38,mypy,isort,black,flake8,doc
33

44
[testenv]
55
commands =
6-
# this ugly hack is here because:
7-
# https://github.com/tox-dev/tox/issues/149
6+
# this ugly hack is here because:
7+
# https://github.com/tox-dev/tox/issues/149
88
pip install -q \
9-
-r {toxinidir}/requirements.txt
10-
py.test \
11-
--cov-report=html:coverage-html --cov-report= --cov=flattering \
12-
--doctest-modules --junitxml=test-results/junit.xml \
13-
{posargs:flattering tests}
9+
-r {toxinidir}/requirements.txt
10+
pip install -q \
11+
-r {toxinidir}/requirements-dev.txt
12+
py.test {posargs:flattering tests}
13+
1414

1515
[testenv:mypy]
1616
deps =
1717
mypy==0.812
18-
1918
commands = mypy --ignore-missing-imports --no-warn-no-return flattering tests
2019

2120
[testenv:flake8]
@@ -25,20 +24,20 @@ deps =
2524
flake8-print>=3.0.1
2625
commands =
2726
flake8 \
28-
flattering \
29-
setup.py \
30-
tests \
31-
{posargs}
27+
flattering \
28+
setup.py \
29+
tests \
30+
{posargs}
3231

3332
[testenv:black]
3433
deps =
3534
black
3635
commands =
3736
black \
38-
flattering \
39-
setup.py \
40-
tests/ \
41-
{posargs}
37+
flattering \
38+
setup.py \
39+
tests/ \
40+
{posargs}
4241

4342
[testenv:black-check]
4443
deps =
@@ -50,10 +49,10 @@ commands =
5049
deps = isort
5150
commands =
5251
isort \
53-
flattering/ \
54-
setup.py \
55-
tests/ \
56-
{posargs}
52+
flattering/ \
53+
setup.py \
54+
tests/ \
55+
{posargs}
5756

5857
[testenv:isort-check]
5958
deps = {[testenv:isort]deps}

0 commit comments

Comments
 (0)