From 24782c4a9bdf00c13c5ce011f703d65044b5716d Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 20 Jun 2024 14:36:25 -0500 Subject: [PATCH] Updates to run and pass flake8-builtins There are flake8-builtins violations which appear as part of rosdep's public API. We'll supporess those to avoid breaking API, but still add the linter plugin so we don't regress more. --- setup.py | 1 + src/rosdep2/meta.py | 4 ++-- src/rosdep2/sources_list.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index addc1bd77..8900dd439 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ 'extras_require': { 'test': [ 'flake8 < 6', + 'flake8-builtins', 'flake8-comprehensions', 'pytest', ], diff --git a/src/rosdep2/meta.py b/src/rosdep2/meta.py index b8cd9006b..3f32795ca 100644 --- a/src/rosdep2/meta.py +++ b/src/rosdep2/meta.py @@ -37,7 +37,7 @@ except NameError: # Python 2 compatibility # https://stackoverflow.com/questions/21367320/ - FileNotFoundError = IOError + FileNotFoundError = IOError # noqa: A001 import rospkg @@ -95,7 +95,7 @@ def __init__(self, cache_dir=None): self._cache_dir = cache_dir self._loaded = {} - def set(self, category, metadata): + def set(self, category, metadata): # noqa: A003 """Add or overwrite metadata in the cache.""" wrapper = CacheWrapper(category, metadata) # print(category, metadata) diff --git a/src/rosdep2/sources_list.py b/src/rosdep2/sources_list.py index 3339fe39c..85408e21d 100644 --- a/src/rosdep2/sources_list.py +++ b/src/rosdep2/sources_list.py @@ -231,8 +231,8 @@ def __str__(self): def __repr__(self): return repr((self.type, self.url, self.tags, self.rosdep_data, self.origin)) - @property - def type(self): + @property # noqa: A003 + def type(self): # noqa: A003 """ :returns: data source type """