Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ieaves committed Feb 2, 2024
1 parent 6e0de80 commit e3e5bf1
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 25 deletions.
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: ['--py36-plus','--exit-zero-even-if-changed']
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
files: '.*'
args: ['--profile=black']
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.1.1
hooks:
- id: black
language_version: python
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.0.0
hooks:
- id: flake8
# TODO: remove F40x, E772 and fix errors
Expand All @@ -26,17 +25,17 @@ repos:
# - flake8-print
- flake8-2020
- repo: https://github.com/mgedmin/check-manifest
rev: "0.48"
rev: "0.49"
hooks:
- id: check-manifest
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.982'
rev: 'v1.8.0'
hooks:
- id: mypy
files: '^src/'
additional_dependencies:
- types-attrs
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: rst-backticks
5 changes: 5 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[mypy]
strict = True

[mypy-tests.*]
disable_error_code = ["empty-body"]
1 change: 1 addition & 0 deletions src/visions/backends/numpy/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A selection of testing utilities for visions.
"""

import functools
from typing import Callable, Dict, List, Optional, Type, Union

Expand Down
1 change: 1 addition & 0 deletions src/visions/backends/pandas/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A selection of testing utilities for visions.
"""

import functools
from typing import Callable, Dict, List, Optional, Type, Union

Expand Down
1 change: 1 addition & 0 deletions src/visions/relations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains (predefined) relations."""

from visions.relations.relations import (
IdentityRelation,
InferenceRelation,
Expand Down
36 changes: 21 additions & 15 deletions src/visions/types/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,27 @@ def relations(cls) -> RelationsIterManager:
if cls._relations is None:
cls._relations = RelationsIterManager(
[
attr.evolve(
r,
type=cls,
relationship=cls.contains_op
if r.relationship is None
else r.relationship,
)
if isinstance(r, IdentityRelation)
else attr.evolve(
r,
type=cls,
relationship=multimethod(r.relationship)
if r.relationship is not None
else None,
transformer=multimethod(r.transformer),
(
attr.evolve(
r,
type=cls,
relationship=(
cls.contains_op
if r.relationship is None
else r.relationship
),
)
if isinstance(r, IdentityRelation)
else attr.evolve(
r,
type=cls,
relationship=(
multimethod(r.relationship)
if r.relationship is not None
else None
),
transformer=multimethod(r.transformer),
)
)
for r in cls.get_relations()
]
Expand Down
1 change: 0 additions & 1 deletion src/visions/typesets/typeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def infer(self, data: Sequence) -> Tuple[Sequence, Any, dict]:
return traverse_graph(data, self.root_node, self.relation_graph)

def infer_type(self, data: Sequence) -> Union[T, Dict[str, T]]:

"""The inferred type found using all type relations.
Args:
Expand Down
1 change: 1 addition & 0 deletions tests/test_typeset_external_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Test for issue 85
https://github.com/dylan-profiler/visions/issues/85
"""

import pytest

from visions import VisionsTypeset
Expand Down

0 comments on commit e3e5bf1

Please sign in to comment.