diff --git a/pyproject.toml b/pyproject.toml index 7483076..78965fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,6 @@ classifiers = [ ] requires-python = ">=3.7" dependencies = [ - "attrs>=19.0", "filelock>=3.0", "mypy>=1.0", "pytest>=7.0", diff --git a/src/pytest_mypy.py b/src/pytest_mypy.py index e3fb2f8..ac363b1 100644 --- a/src/pytest_mypy.py +++ b/src/pytest_mypy.py @@ -1,12 +1,12 @@ """Mypy static type checker plugin for Pytest""" +from dataclasses import dataclass import json from pathlib import Path from tempfile import NamedTemporaryFile from typing import Dict, List, Optional, TextIO import warnings -import attr from filelock import FileLock # type: ignore import mypy.api import pytest @@ -197,18 +197,18 @@ def runtest(self): raise MypyError(f"mypy exited with status {results.status}.") -@attr.s(frozen=True, kw_only=True) +@dataclass(frozen=True) # compat python < 3.10 (kw_only=True) class MypyResults: """Parsed results from Mypy.""" _abspath_errors_type = Dict[str, List[str]] - opts = attr.ib(type=List[str]) - stdout = attr.ib(type=str) - stderr = attr.ib(type=str) - status = attr.ib(type=int) - abspath_errors = attr.ib(type=_abspath_errors_type) - unmatched_stdout = attr.ib(type=str) + opts: List[str] + stdout: str + stderr: str + status: int + abspath_errors: _abspath_errors_type + unmatched_stdout: str def dump(self, results_f: TextIO) -> None: """Cache results in a format that can be parsed by load()."""