Skip to content

Commit bafb13f

Browse files
Deprecate Python 3.7 and update pre-commit hooks
1 parent 45fa00e commit bafb13f

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

.github/workflows/tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ jobs:
6262
strategy:
6363
matrix:
6464
python-version:
65-
- 3.7
6665
- 3.8
6766
- 3.9
6867
- '3.10'
69-
- pypy3
68+
- '3.11'
7069
steps:
7170
- uses: actions/checkout@v2
7271
- uses: actions/setup-python@v2

.pre-commit-config.yaml

+18-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,30 @@ exclude: |
66
bin/.*
77
)$
88
repos:
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v4.4.0
11+
hooks:
12+
- id: debug-statements
13+
- id: check-merge-conflict
914
- repo: https://github.com/psf/black
10-
rev: 22.3.0
15+
rev: 23.3.0
1116
hooks:
1217
- id: black
1318
language_version: python3
14-
- repo: https://gitlab.com/pycqa/flake8
15-
rev: 3.8.4
19+
- repo: https://github.com/pycqa/flake8
20+
rev: 6.0.0
1621
hooks:
1722
- id: flake8
1823
- repo: https://github.com/pycqa/isort
19-
rev: 5.7.0
24+
rev: 5.12.0
2025
hooks:
2126
- id: isort
27+
- repo: https://github.com/humitos/mirrors-autoflake.git
28+
rev: v1.1
29+
hooks:
30+
- id: autoflake
31+
exclude: |
32+
(?x)^(
33+
.*/?__init__\.py|
34+
)$
35+
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']

cons/core.py

-3
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ def __new__(cls, *parts):
100100

101101
@classmethod
102102
def cons_merge(cls, car_part, cdr_part):
103-
104103
if cdr_part is None:
105104
cdr_part = default_ConsNull()
106105

107106
if isinstance(cdr_part, Mapping):
108107
cdr_part = cdr_part.items()
109108

110109
if isinstance(cdr_part, ItemsView):
111-
112110
return OrderedDict(chain((car_part,), cdr_part))
113111

114112
elif hasattr(cdr_part, "__add__") or hasattr(cdr_part, "__radd__"):
@@ -142,7 +140,6 @@ def __str__(self):
142140

143141
class MaybeConsType(ABCMeta):
144142
def __subclasscheck__(self, o):
145-
146143
if issubclass(o, tuple(_cdr.funcs.keys())) and not issubclass(o, NonCons):
147144
return True
148145

cons/unify.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
def _unify_Cons(lcons, rcons, s):
10-
1110
lcons_ = lcons
1211
rcons_ = rcons
1312

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
"Operating System :: OS Independent",
3131
"Programming Language :: Python",
3232
"Programming Language :: Python :: 3",
33-
"Programming Language :: Python :: 3.7",
3433
"Programming Language :: Python :: 3.8",
3534
"Programming Language :: Python :: 3.9",
3635
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
3737
"Programming Language :: Python :: Implementation :: CPython",
3838
"Programming Language :: Python :: Implementation :: PyPy",
3939
"Topic :: Software Development :: Libraries",

tests/test_cons.py

-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
def test_noncons_type():
13-
1413
with pytest.raises(TypeError):
1514
NonCons()
1615

@@ -50,7 +49,6 @@ def test_cons_type():
5049

5150

5251
def test_cons_null():
53-
5452
with pytest.raises(TypeError):
5553
ConsNull()
5654

@@ -68,7 +66,6 @@ def test_cons_null():
6866

6967

7068
def test_proper_sequence_type():
71-
7269
with pytest.raises(TypeError):
7370
ProperSequence()
7471

@@ -87,7 +84,6 @@ def test_proper_sequence_type():
8784

8885

8986
def test_cons_join():
90-
9187
with pytest.raises(ValueError):
9288
cons("a")
9389

@@ -138,7 +134,6 @@ def test_cons_class():
138134

139135

140136
def test_car_cdr():
141-
142137
with pytest.raises(ConsError):
143138
car(object())
144139

0 commit comments

Comments
 (0)