diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index a10cba0..0840e9f 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -5,7 +5,12 @@ labels: 'bug' --- ### Environment information -* `ape` and plugin versions: +* Python Version: x.x.x +* OS: macOS/linux/win + +If `ape` is installed: + +* `ape` and plugin versions ``` $ ape --version @@ -15,9 +20,6 @@ $ ape plugins list # ...copy and paste result of above command here... ``` -* Python Version: x.x.x -* OS: macOS/linux/win - ### What went wrong? Please include information like: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 74f708c..392d431 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,7 +2,6 @@ on: ["push", "pull_request"] name: Test - env: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -57,7 +56,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] # eventually add `windows-latest` - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f46e79..349717e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,4 +28,4 @@ repos: default_language_version: - python: python3.8 + python: python3 diff --git a/ethpm_types/contract_type.py b/ethpm_types/contract_type.py index 3af7570..177ac50 100644 --- a/ethpm_types/contract_type.py +++ b/ethpm_types/contract_type.py @@ -220,7 +220,9 @@ def __init__( self._selector_hash_fn = selector_hash_fn super().__init__(iterable) - def __getitem__(self, item: Union[int, slice, str, bytes, MethodABI, EventABI]): # type: ignore + def __getitem__( # type: ignore + self, item: Union[int, slice, str, HexBytes, bytes, MethodABI, EventABI] + ): try: # selector if isinstance(item, str) and "(" in item: @@ -230,7 +232,7 @@ def __getitem__(self, item: Union[int, slice, str, bytes, MethodABI, EventABI]): return next(abi for abi in self if abi.name == item) # hashed selector, like log.topics[0] or tx.data # NOTE: Will fail with `ImportError` if `item` is `bytes` and `eth-hash` has no backend - elif isinstance(item, bytes) and self._selector_hash_fn: + elif isinstance(item, (bytes, HexBytes)) and self._selector_hash_fn: return next( abi for abi in self diff --git a/pyproject.toml b/pyproject.toml index 1497590..d5462c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ write_to = "ethpm_types/version.py" [tool.black] line-length = 100 -target-version = ['py37', 'py38', 'py39', 'py310'] +target-version = ['py38', 'py39', 'py310'] include = '\.pyi?$' [tool.pytest.ini_options] diff --git a/setup.py b/setup.py index dc55094..f9f6bb7 100644 --- a/setup.py +++ b/setup.py @@ -68,15 +68,13 @@ url="https://github.com/ApeWorX/ethpm-types", include_package_data=True, install_requires=[ - "importlib-metadata ; python_version<'3.8'", - "typing_extensions ; python_version<'3.8'", "hexbytes>=0.2.3,<1", "pydantic>=1.10.1,<2", "eth-utils>=2.0.0,<3", "py-cid>=0.3.0,<0.4", "requests>=2.28.1,<3", ], - python_requires=">=3.7.2,<4", + python_requires=">=3.8,<3.11", extras_require=extras_require, py_modules=["ethpm_types"], license="Apache-2.0", @@ -92,7 +90,6 @@ "Operating System :: MacOS", "Operating System :: POSIX", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",