Skip to content

Commit

Permalink
➕ Python 3.11 support (#194)
Browse files Browse the repository at this point in the history
* Upgrade parsimonious for python 3.11 support

* Add circleci testing for Python 3.11

* Limit Parsimonious to <0.10.0

* Remove upper pins on eth-utils and eth-typing

* Add newsfragment

Co-authored-by: kclowes <kclowes@users.noreply.github.com>
  • Loading branch information
fselmo and kclowes committed Nov 17, 2022
1 parent de39f66 commit c8688f5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
21 changes: 14 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ common: &common
command: pip install --user tox
- run:
name: run tox
command: ~/.local/bin/tox -r
command: python -m tox -r
- save_cache:
paths:
- .hypothesis
Expand All @@ -39,39 +39,45 @@ jobs:
docs:
<<: *common
docker:
- image: circleci/python:3.10
- image: cimg/python:3.10
environment:
TOXENV: docs
lint:
<<: *common
docker:
- image: circleci/python:3.10
- image: cimg/python:3.10
environment:
TOXENV: lint
py37-core:
<<: *common
docker:
- image: circleci/python:3.7
- image: cimg/python:3.7
environment:
TOXENV: py37-core
py38-core:
<<: *common
docker:
- image: circleci/python:3.8
- image: cimg/python:3.8
environment:
TOXENV: py38-core
py39-core:
<<: *common
docker:
- image: circleci/python:3.9
- image: cimg/python:3.9
environment:
TOXENV: py39-core
py310-core:
<<: *common
docker:
- image: circleci/python:3.10
- image: cimg/python:3.10
environment:
TOXENV: py310-core
py311-core:
<<: *common
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-core
workflows:
version: 2
test:
Expand All @@ -82,3 +88,4 @@ workflows:
- py38-core
- py39-core
- py310-core
- py311-core
4 changes: 2 additions & 2 deletions eth_abi/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def generic_visit(self, node, visited_children):
return tuple(visited_children)

@functools.lru_cache(maxsize=None)
def parse(self, type_str):
def parse(self, type_str, **kwargs):
"""
Parses a type string into an appropriate instance of
:class:`~eth_abi.grammar.ABIType`. If a type string cannot be parsed,
Expand All @@ -125,7 +125,7 @@ def parse(self, type_str):
)

try:
return super().parse(type_str)
return super().parse(type_str, **kwargs)
except parsimonious.ParseError as e:
raise ParseError(e.text, e.pos, e.expr)

Expand Down
1 change: 1 addition & 0 deletions newsfragments/194.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for Python 3.11
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
url="https://github.com/ethereum/eth-abi",
include_package_data=True,
install_requires=[
"eth-utils>=2.0.0,<3.0.0",
"eth-typing>=3.0.0,<4.0.0",
"parsimonious>=0.8.0,<0.9.0",
"eth-utils>=2.0.0",
"eth-typing>=3.0.0",
"parsimonious>=0.8.0,<0.10.0",
],
python_requires=">=3.7, <4",
extras_require=extras_require,
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist=
py{37,38,39,310}-core
py{37,38,39,310,311}-core
lint
docs

Expand Down Expand Up @@ -30,6 +30,7 @@ basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
extras=
test
docs: doc
Expand Down

0 comments on commit c8688f5

Please sign in to comment.