diff --git a/istub.yml b/istub.yml index 317f34d..4dc48c7 100644 --- a/istub.yml +++ b/istub.yml @@ -1,8 +1,23 @@ packages: - - name: botocore + - name: s3transfer checks: stubtest: true snapshots: stubtest: |- - error: not checking stubs due to mypy build errors: - ./botocore-stubs/crt/auth.pyi:4: error: Skipping analyzing "awscrt.auth": module is installed, but missing library stubs or py.typed marker + error: s3transfer.compat.BaseManager.shutdown is not present at runtime + Stub: at line 152 + def (self: multiprocessing.managers.BaseManager) + Runtime: + MISSING + + error: s3transfer.processpool.BaseManager.shutdown is not present at runtime + Stub: at line 152 + def (self: multiprocessing.managers.BaseManager) + Runtime: + MISSING + + error: s3transfer.processpool.TransferMonitorManager.TransferMonitor is not present in stub + Stub: + MISSING + Runtime: at line 722 in file ./multiprocessing/managers.py + .temp at HASH> diff --git a/istub/checks/base.py b/istub/checks/base.py index bf9f6a2..1120222 100644 --- a/istub/checks/base.py +++ b/istub/checks/base.py @@ -51,7 +51,7 @@ def get_diff(self, data: List[str]) -> List[str]: differ = difflib.Differ() diff = differ.compare(old_data, data) - return [i for i in diff if i.startswith("-") or i.startswith("+")] + return [i for i in diff if not self.is_ignored_line_diff(i)] def get_call_output( self, @@ -77,3 +77,11 @@ def set_snapshot(self, data: Iterable[str]) -> None: Set snapshot data. """ self.package.set_snapshot(self.NAME, data) + + def is_ignored_line_diff(self, line: str) -> bool: + """ + Whether line is ignored in diff. + """ + if line.startswith("+") or line.startswith("-"): + return False + return True diff --git a/istub/checks/stubtest.py b/istub/checks/stubtest.py index 9d6fdcc..692075a 100644 --- a/istub/checks/stubtest.py +++ b/istub/checks/stubtest.py @@ -17,3 +17,15 @@ def run(self) -> str: capture_stderr=False, ) return "\n".join(output.splitlines()[:-1]) + + def is_ignored_line_diff(self, line: str) -> bool: + """ + Whether line is ignored in diff. + """ + if super().is_ignored_line_diff(line): + return True + + if "at line" in line: + return True + + return False diff --git a/poetry.lock b/poetry.lock index 62d6931..8e02aed 100644 --- a/poetry.lock +++ b/poetry.lock @@ -63,7 +63,7 @@ crt = ["awscrt (==0.13.8)"] [[package]] name = "botocore-stubs" -version = "1.27.42.post1" +version = "1.27.42.post2" description = "Type annotations and code completion for botocore" category = "dev" optional = false @@ -444,6 +444,20 @@ typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9 [package.extras] jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] +[[package]] +name = "s3transfer" +version = "0.6.0" +description = "An Amazon S3 Transfer Manager" +category = "dev" +optional = false +python-versions = ">= 3.7" + +[package.dependencies] +botocore = ">=1.12.36,<2.0a.0" + +[package.extras] +crt = ["botocore[crt] (>=1.20.29,<2.0a.0)"] + [[package]] name = "secretstorage" version = "3.3.2" @@ -526,6 +540,14 @@ python-versions = "*" [package.dependencies] types-urllib3 = "<1.27" +[[package]] +name = "types-s3transfer" +version = "0.6.0.post4" +description = "Type annotations and code completion for s3transfer" +category = "dev" +optional = false +python-versions = ">=3.7,<4.0" + [[package]] name = "types-urllib3" version = "1.26.19" @@ -589,7 +611,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "52b0f0a5b5e9407934cb0d93efb7c15e68d9fc53581c3e4bdb5c2b9174cad745" +content-hash = "cf9b8a27b74f9db46296c0296579620201ccbeffe65ebb492122e9e6d2a26bed" [metadata.files] awscrt = [] @@ -627,8 +649,8 @@ botocore = [ {file = "botocore-1.27.42.tar.gz", hash = "sha256:38a180a6666c5a9b069a75ec3cf374ff2a64c3e90c9f24a916858bcdeb04456d"}, ] botocore-stubs = [ - {file = "botocore-stubs-1.27.42.post1.tar.gz", hash = "sha256:e5feb509594148f6311bc785d35a285016d9979456336cebce15ee4fcae20d9e"}, - {file = "botocore_stubs-1.27.42.post1-py3-none-any.whl", hash = "sha256:59115ed3ea774ffc5a973a962c316a90378a02758d368675af7f136f55844da1"}, + {file = "botocore-stubs-1.27.42.post2.tar.gz", hash = "sha256:f87bac3f2156338173bdae804092addf64572c264a41bf90e53d5a268d85681b"}, + {file = "botocore_stubs-1.27.42.post2-py3-none-any.whl", hash = "sha256:f51a788f190eea6c825fa0f30183d5243108368f39d3074d694daeb01fd04969"}, ] certifi = [ {file = "certifi-2022.6.15-py3-none-any.whl", hash = "sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412"}, @@ -775,6 +797,10 @@ rfc3986 = [ {file = "rfc3986-2.0.0.tar.gz", hash = "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c"}, ] rich = [] +s3transfer = [ + {file = "s3transfer-0.6.0-py3-none-any.whl", hash = "sha256:06176b74f3a15f61f1b4f25a1fc29a4429040b7647133a463da8fa5bd28d5ecd"}, + {file = "s3transfer-0.6.0.tar.gz", hash = "sha256:2ed07d3866f523cc561bf4a00fc5535827981b117dd7876f036b0c1aca42c947"}, +] secretstorage = [ {file = "SecretStorage-3.3.2-py3-none-any.whl", hash = "sha256:755dc845b6ad76dcbcbc07ea3da75ae54bb1ea529eb72d15f83d26499a5df319"}, {file = "SecretStorage-3.3.2.tar.gz", hash = "sha256:0a8eb9645b320881c222e827c26f4cfcf55363e8b374a021981ef886657a912f"}, @@ -826,6 +852,10 @@ types-requests = [ {file = "types-requests-2.28.6.tar.gz", hash = "sha256:cf3383bbd79394bf051a0a9202d6831fa962f186f923c178f7c059e3424bd00e"}, {file = "types_requests-2.28.6-py3-none-any.whl", hash = "sha256:d8d7607419cd4b41a7b9497e15e8c0bad78d50df43c48ad25bc526a11518c3a9"}, ] +types-s3transfer = [ + {file = "types-s3transfer-0.6.0.post4.tar.gz", hash = "sha256:0c45331bfd0db210f5043efd2bc3ecd4b3482a02c28faea33edf719b6be38431"}, + {file = "types_s3transfer-0.6.0.post4-py3-none-any.whl", hash = "sha256:78f9ea029fedc97e1a5d323edd149a827d4ab361d11cd92bb1b5f235ff84ba72"}, +] types-urllib3 = [ {file = "types-urllib3-1.26.19.tar.gz", hash = "sha256:45b307bdb73d2eac0c2fb1386da97e51c9ae7f1474ef35f61024c3084b6bf371"}, {file = "types_urllib3-1.26.19-py3-none-any.whl", hash = "sha256:540bf5a42ba09a4a58c406cb2c2c8654b0aadf413f8337fdc184711ab48b900c"}, diff --git a/pyproject.toml b/pyproject.toml index 6f72bb5..f548da8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,6 @@ pip = "*" pyyaml = "*" [tool.poetry.dev-dependencies] -awscrt = "*" isort = "*" mypy = "*" black = "*" @@ -71,8 +70,10 @@ flake8 = "*" vulture = "*" twine = "*" types-pyyaml = "*" -botocore = "*" +s3transfer = "*" +awscrt = "*" botocore-stubs = "*" +types-s3transfer = "*" types-requests = "*" [build-system]