From 4f8670f8662a8e0235f52e1fe92ad668d5c56987 Mon Sep 17 00:00:00 2001 From: Felipe Alex Hofmann Date: Thu, 18 Apr 2024 09:54:04 -0700 Subject: [PATCH] Fix `entry_points` warning message (#564) --- pyproject.toml | 4 ++-- sdmetrics/__init__.py | 2 +- setup.cfg | 6 +++++- tests/unit/test___init__.py | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f503173..fb38c777 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,12 +89,12 @@ dev = [ 'flake8-mutable>=1.2.0,<1.3', 'flake8-expression-complexity>=0.0.9,<0.1', 'flake8-print>=4.0.0,<4.1', - 'flake8-pytest-style>=1.5.0,<3', + 'flake8-pytest-style>=2.0.0,<3', 'flake8-quotes>=3.3.0,<4', 'flake8-sfs>=0.0.3,<2', 'flake8-variables-names>=0.0.4,<0.1', 'dlint>=0.11.0,<1', - 'isort>=4.3.4,<6', + 'isort>=5.13.2,<6', 'pandas-vet>=0.2.3,<2024', 'pep8-naming>=0.12.1,<1', 'pydocstyle>=6.1.1,<7', diff --git a/sdmetrics/__init__.py b/sdmetrics/__init__.py index 8b1d00cf..c60a9292 100644 --- a/sdmetrics/__init__.py +++ b/sdmetrics/__init__.py @@ -144,7 +144,7 @@ def _find_addons(): try: addon = entry_point.load() except Exception: # pylint: disable=broad-exception-caught - msg = f'Failed to load "{entry_point.name}" from "{entry_point.module_name}".' + msg = f'Failed to load "{entry_point.name}" from "{entry_point.value}".' python_warnings.warn(msg) continue diff --git a/setup.cfg b/setup.cfg index 70ff2409..46492ac0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,11 @@ extend-ignore = # Line break occurred before a binary operator W503, # Mutable default arg of type List - M511 + M511, + # TokenError: unterminated string literal + E902, + # The module is shadowing a Python builtin module + A005 [aliases] test = pytest diff --git a/tests/unit/test___init__.py b/tests/unit/test___init__.py index 5aa91bb4..11e6ecf5 100644 --- a/tests/unit/test___init__.py +++ b/tests/unit/test___init__.py @@ -64,7 +64,7 @@ def entry_point_error(): bad_entry_point = Mock() bad_entry_point.name = 'bad_entry_point' - bad_entry_point.module_name = 'bad_module' + bad_entry_point.value = 'bad_module' bad_entry_point.load.side_effect = entry_point_error entry_points_mock.return_value = [bad_entry_point] msg = 'Failed to load "bad_entry_point" from "bad_module".'