From feb701d30fa6ec2f211df640eb2ac222b8e7dc7b Mon Sep 17 00:00:00 2001 From: Callahan Date: Wed, 18 Oct 2023 15:18:40 -0500 Subject: [PATCH] chore: ignore types for pkg_resources (#4406) Signed-off-by: Callahan Kovacs --- snapcraft/elf/_elf_file.py | 6 ++++-- tests/unit/test_projects.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/snapcraft/elf/_elf_file.py b/snapcraft/elf/_elf_file.py index 8c674127fef..82b7c7f326c 100644 --- a/snapcraft/elf/_elf_file.py +++ b/snapcraft/elf/_elf_file.py @@ -322,7 +322,9 @@ def is_linker_compatible(self, *, linker_version: str) -> bool: """Determine if the linker will work given the required glibc version.""" version_required = self.get_required_glibc() # TODO: pkg_resources is deprecated in setuptools>66 (CRAFT-1598) - is_compatible = parse_version(version_required) <= parse_version(linker_version) + parsed_version_required = parse_version(version_required) # type: ignore + parsed_linker_version = parse_version(linker_version) # type: ignore + is_compatible = parsed_version_required <= parsed_linker_version emit.debug( f"Check if linker {linker_version!r} works with GLIBC_{version_required} " f"required by {str(self.path)!r}: {is_compatible}" @@ -341,7 +343,7 @@ def get_required_glibc(self) -> str: continue version = version[6:] # TODO: pkg_resources is deprecated in setuptools>66 (CRAFT-1598) - if parse_version(version) > parse_version(version_required): + if parse_version(version) > parse_version(version_required): # type: ignore version_required = version self._required_glibc = version_required diff --git a/tests/unit/test_projects.py b/tests/unit/test_projects.py index 627400836ff..5a2a9b57584 100644 --- a/tests/unit/test_projects.py +++ b/tests/unit/test_projects.py @@ -361,7 +361,7 @@ def test_project_grade_assignment(self, grade, project_yaml_data): else: error = ".*unexpected value; permitted: 'stable', 'devel'" with pytest.raises(pydantic.ValidationError, match=error): - project.grade = grade + project.grade = grade # type: ignore def test_project_summary_valid(self, project_yaml_data): summary = "x" * 78