Skip to content

Deprecate Python 3.7 and update pre-commit hooks #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ jobs:
strategy:
matrix:
python-version:
- 3.7
- 3.8
- 3.9
- '3.10'
- pypy3
- '3.11'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
22 changes: 18 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,30 @@ exclude: |
bin/.*
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: debug-statements
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.7.0
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
hooks:
- id: autoflake
exclude: |
(?x)^(
.*/?__init__\.py|
)$
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
3 changes: 0 additions & 3 deletions cons/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ def __new__(cls, *parts):

@classmethod
def cons_merge(cls, car_part, cdr_part):

if cdr_part is None:
cdr_part = default_ConsNull()

if isinstance(cdr_part, Mapping):
cdr_part = cdr_part.items()

if isinstance(cdr_part, ItemsView):

return OrderedDict(chain((car_part,), cdr_part))

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

class MaybeConsType(ABCMeta):
def __subclasscheck__(self, o):

if issubclass(o, tuple(_cdr.funcs.keys())) and not issubclass(o, NonCons):
return True

Expand Down
1 change: 0 additions & 1 deletion cons/unify.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def _unify_Cons(lcons, rcons, s):

lcons_ = lcons
rcons_ = rcons

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
Expand Down
5 changes: 0 additions & 5 deletions tests/test_cons.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def test_noncons_type():

with pytest.raises(TypeError):
NonCons()

Expand Down Expand Up @@ -50,7 +49,6 @@ def test_cons_type():


def test_cons_null():

with pytest.raises(TypeError):
ConsNull()

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


def test_proper_sequence_type():

with pytest.raises(TypeError):
ProperSequence()

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


def test_cons_join():

with pytest.raises(ValueError):
cons("a")

Expand Down Expand Up @@ -138,7 +134,6 @@ def test_cons_class():


def test_car_cdr():

with pytest.raises(ConsError):
car(object())

Expand Down