Skip to content

Commit

Permalink
Update to latest mypy, drop Python 3.8 support (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd authored Aug 27, 2024
1 parent 821bdd7 commit 329bbc6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
name: python-${{ matrix.python }}
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ instead of `optional_converter`.
Requirements and Installation
-----------------------------

You need Python 3.7 or higher.
You need Python 3.8 or higher.

```bash
python3 -m pip install undictify
Expand Down
9 changes: 0 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ version: '2.4'

services:

unit-tests-3-7:
build:
context: .
dockerfile: test/Dockerfile_3.7
volumes:
- .:/undictify
working_dir: /undictify
entrypoint: ./test/install_from_local_and_run_code_checks.sh

unit-tests-3-8:
build:
context: .
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
url="http://github.com/Dobiasd/undictify",
package_data={"undictify": ["py.typed"]},
packages=["undictify"],
python_requires=">=3.7",
python_requires=">=3.8",
classifiers=(
"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 :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
),
Expand Down
4 changes: 0 additions & 4 deletions test/Dockerfile_3.7

This file was deleted.

6 changes: 3 additions & 3 deletions undictify/_unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _get_value(func: WrappedOrFunc[TypeT],
f'yields incorrect target type: '
f'{_get_type_name(type(result))}')
return result
if Any not in allowed_types and not _isinstanceofone(value, allowed_types):
if Any not in allowed_types and not _isinstanceofone(value, allowed_types): # type: ignore
if _is_enum_type(func):
for entry in func: # type: ignore
if value == entry.value:
Expand Down Expand Up @@ -360,7 +360,7 @@ def _get_dict_value(func: Callable[..., TypeT], value: Any,
skip_superfluous, convert_types,
converters)
return typed_dict
if func is Any:
if func is Any: # type: ignore
return value
return func(**value)

Expand Down Expand Up @@ -517,7 +517,7 @@ def _is_union_of_builtins_type(the_type: Callable[..., TypeT]) -> bool:

def _is_builtin_type(the_type: Callable[..., TypeT]) -> bool:
"""Return True if the type is a NoneType, str, int, float or bool."""
return the_type in [str, int, bool, float, type(None)] # type: ignore
return the_type in [str, int, bool, float, type(None)]


def _is_none_type(value: TypeT) -> bool:
Expand Down

0 comments on commit 329bbc6

Please sign in to comment.