diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 43ae079..9a29df7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,9 +13,9 @@ jobs: - '3.12' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -27,5 +27,8 @@ jobs: - name: Running flake8 run: flake8 vsdeband - name: Running mypy - if: steps.dependencies.outcome == 'success' - run: mypy vsdeband + run: | + echo "::add-matcher::.github/workflows/matchers/mypy.json" + mypy --no-pretty vsdeband + echo "::remove-matcher owner=mypy::" + continue-on-error: true diff --git a/.github/workflows/matchers/mypy.json b/.github/workflows/matchers/mypy.json new file mode 100644 index 0000000..c1e81a9 --- /dev/null +++ b/.github/workflows/matchers/mypy.json @@ -0,0 +1,16 @@ +{ + "problemMatcher": [ + { + "owner": "mypy", + "pattern": [ + { + "regexp": "^(.+):(\\d+):\\s(error|warning|note):\\s(.+)$", + "file": 1, + "line": 2, + "severity": 3, + "message": 4 + } + ] + } + ] +} diff --git a/requirements-dev.txt b/requirements-dev.txt index 2c6b2e8..ea06cb4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ flake8>=7.0.0 -mypy>=1.10.0 +mypy>=1.11.2 mypy-extensions>=1.0.0 pycodestyle>=2.11.1 -typing-extensions>=4.11.0 +typing-extensions>=4.12.2 diff --git a/vsdeband/noise.py b/vsdeband/noise.py index 70969bf..4aae476 100644 --- a/vsdeband/noise.py +++ b/vsdeband/noise.py @@ -11,7 +11,7 @@ from vsmasktools import adg_mask from vsrgtools import BlurMatrix from vstools import ( - CustomIndexError, CustomOverflowError, CustomValueError, InvalidColorFamilyError, KwargsT, Matrix, MatrixT, + CustomIndexError, CustomOverflowError, CustomValueError, InvalidColorFamilyError, KwargsT, Matrix, MatrixT, PlanesT, check_variable, core, depth, fallback, get_neutral_values, get_peak_value, get_sample_type, get_y, inject_self, join, mod_x, normalize_seq, plane, scale_value, split, to_arr, vs ) @@ -76,7 +76,7 @@ def _resolve(grained: vs.VideoNode) -> vs.VideoNode: FadeLimits = tuple[int | Iterable[int] | None, int | Iterable[int] | None] -GrainPostProcessT = ResolverOneClipArgs | ResolverTwoClipsArgs | str | GrainPP | GrainPP.Resolver +GrainPostProcessT = type[ResolverOneClipArgs | ResolverTwoClipsArgs | str | GrainPP | GrainPP.Resolver] GrainPostProcessesT = GrainPostProcessT | list[GrainPostProcessT] @@ -153,7 +153,7 @@ def grain( return clip if strength[0] <= 0.0 and strength[1] > 0.0: - planes = [1, 2] + planes: PlanesT = [1, 2] elif strength[0] > 0.0 and strength[1] <= 0.0: planes = 0 else: @@ -360,7 +360,7 @@ def _get_kw(self, kwargs: KwargsT) -> KwargsT: return kwargs def _is_poisson(self, **kwargs: Any) -> bool: - return kwargs.get('type', None) == 4 + return kwargs.get('type') == 4 def _is_input_dependent(self, clip: vs.VideoNode, **kwargs: Any) -> bool: return self._is_poisson(**kwargs)