Skip to content

Commit dc4375a

Browse files
committed
fix mypy issues, add mypy to linting
1 parent 68e620a commit dc4375a

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

src/isal/isal_zlib.pyi

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,26 @@ class IsalError(OSError): ...
5050

5151
error: IsalError
5252

53-
def adler32(data, value: int) -> int: ...
54-
def crc32(data, value: int) -> int: ...
53+
def adler32(data, value: int = ...) -> int: ...
54+
def crc32(data, value: int = ...) -> int: ...
5555

56-
def compress(data, level: int, wbits: int) -> bytes: ...
57-
def decompress(data, wbits: int, bufsize: int) -> bytes: ...
56+
def compress(data, level: int = ..., wbits: int = ...) -> bytes: ...
57+
def decompress(data, wbits: int = ..., bufsize: int = ...) -> bytes: ...
5858

5959
class Compress:
6060
def compress(self, data) -> bytes: ...
61-
def flush(self, mode: int) -> bytes: ...
61+
def flush(self, mode: int = ...) -> bytes: ...
6262

6363
class Decompress:
6464
unused_data: bytes
6565
unconsumed_tail: bytes
6666
eof: bool
6767
crc: int
6868

69-
def decompress(self, data, max_length: int) -> bytes: ...
70-
def flush(self, length: int) -> bytes: ...
69+
def decompress(self, data, max_length: int = ...) -> bytes: ...
70+
def flush(self, length: int = ...) -> bytes: ...
7171

72-
def compressobj(level: int, method: int, wbits: int, memLevel: int,
73-
strategy: int, zdict) -> Compress: ...
74-
def decompressobj(wbits: int, zdict) -> Decompress: ...
72+
def compressobj(level: int = ..., method: int = ..., wbits: int = ...,
73+
memLevel: int = ..., strategy: int = ..., zdict = ...
74+
) -> Compress: ...
75+
def decompressobj(wbits: int = ..., zdict = ...) -> Decompress: ...

tests/test_gzip_compliance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import tempfile
2727
import unittest
2828
from subprocess import PIPE, Popen
29-
from test.support import _4G, bigmemtest
30-
from test.support.script_helper import assert_python_failure, assert_python_ok
29+
from test.support import _4G, bigmemtest # type: ignore
30+
from test.support.script_helper import assert_python_failure, assert_python_ok # type: ignore # noqa: E501
3131

3232
from isal import igzip
3333

tests/test_zlib_compliance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import random
2020
import sys
2121
import unittest
22-
from test import support
23-
from test.support import _1G, _4G, bigmemtest
22+
from test import support # type: ignore
23+
from test.support import _1G, _4G, bigmemtest # type: ignore
2424

2525
import isal
2626
from isal import isal_zlib

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ commands=
3939
pytest tests/test_isal.py
4040

4141
[testenv:lint]
42+
# pytest dep needed for mypy check
4243
deps=flake8
4344
flake8-import-order
4445
mypy
45-
# Linting does not need the installed package.
46-
skip_install=true
46+
pytest
4747
commands =
4848
flake8 src tests setup.py benchmark.py
49+
mypy src/ tests/
4950

5051
# Documentation should build on python version 3
5152
[testenv:docs]

0 commit comments

Comments
 (0)