Skip to content

Commit

Permalink
Attempt to debug errors in pytest-flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Apr 25, 2023
1 parent 8e9c330 commit d10352d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions setuptools/_vendor/importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,28 @@ def _name_from_stem(stem):
name, sep, rest = filename.partition('-')
return name

@property
def name(self):
try:
return super().name
except Exception:
msg = f"""
DEBUG: {self.__class__.__name__} @ {self._path}
normalized_name: {self._normalized_name}
{list(pathlib.Path(self._path).glob('*'))}
---
{pathlib.Path().resolve()}
{list(pathlib.Path().glob('*'))}
?????????????????????????????????????????????????????????????????
{self.read_text('PKG-INFO')}
-----------------------------------------------------------------
{list(pathlib.Path(self._path, 'PKG-INFO').read_text(encoding='utf-8'))}
?????????????????????????????????????????????????????????????????
"""
print(msg)
warnings.warn(msg)
raise


def distribution(distribution_name):
"""Get the ``Distribution`` instance for the named package.
Expand Down

0 comments on commit d10352d

Please sign in to comment.