Skip to content

Commit

Permalink
Merge b82a559 into dd9e11e
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Nov 28, 2020
2 parents dd9e11e + b82a559 commit 8ba0afd
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .appveyor.yml
Expand Up @@ -4,6 +4,9 @@ environment:
PYTHON_MINOR: 7
- PYTHON_MAJOR: 3
PYTHON_MINOR: 8
# TODO: Enable this when Python 3.9 is available in the default images
# - PYTHON_MAJOR: 3
# PYTHON_MINOR: 9

cache:
- .venv -> poetry.lock
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,7 @@ language: python
python:
- 3.7
- 3.8
- 3.9

cache:
pip: true
Expand Down
2 changes: 1 addition & 1 deletion datafiles/converters/__init__.py
Expand Up @@ -47,7 +47,7 @@ def map_type(cls, *, name: str = '', item_cls: Optional[type] = None):
if dataclasses.is_dataclass(cls):
converters = {}
for field in dataclasses.fields(cls):
converters[field.name] = map_type(field.type, name=field.name)
converters[field.name] = map_type(field.type, name=field.name) # type: ignore
converter = Dataclass.of_mappings(cls, converters)
log.debug(f'Mapped {cls!r} to new converter: {converter}')
return converter
Expand Down
4 changes: 2 additions & 2 deletions datafiles/mapper.py
Expand Up @@ -212,7 +212,7 @@ def _infer_attr(name, value):
log.warn(f'{name!r} list type cannot be inferred')
item_cls = Converter
log.debug(f'Inferring {name!r} type: {cls} of {item_cls}')
return map_type(cls, name=name, item_cls=item_cls)
return map_type(cls, name=name, item_cls=item_cls) # type: ignore

if issubclass(cls, dict):
cls.__origin__ = dict
Expand Down Expand Up @@ -290,7 +290,7 @@ def create_mapper(obj, root=None) -> Mapper:
for field in dataclasses.fields(obj):
self_name = f'self.{field.name}'
if pattern is None or self_name not in pattern:
attrs[field.name] = map_type(field.type, name=field.name)
attrs[field.name] = map_type(field.type, name=field.name) # type: ignore

return Mapper(
obj,
Expand Down
50 changes: 25 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Utilities",
Expand Down Expand Up @@ -64,8 +65,8 @@ black = "=20.8b1"
isort = "=5.5.1"

# Linters
mypy = "*"
pylint = '~2.6'
mypy = "~0.790"
pylint = "~2.6"
pydocstyle = "*"

# Testing
Expand Down

0 comments on commit 8ba0afd

Please sign in to comment.