Skip to content

Commit 851cf5a

Browse files
committed
📝 Make "setuptools entrypoint" term generic
This feature grew out of `setuptools` but the modern interface for extracting this information from the distribution package metadata is `importlib.metadata`. So the patch attempts to reflect this in the documentation messaging. Refs: * https://docs.python.org/3/library/importlib.metadata.html#entry-points * https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#using-package-metadata * https://packaging.python.org/en/latest/specifications/entry-points/#entry-points
1 parent fe4961a commit 851cf5a

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/_pytest/config/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,8 @@ def _mark_plugins_for_rewrite(self, hook) -> None:
12901290
self.pluginmanager.rewrite_hook = hook
12911291

12921292
if os.environ.get("PYTEST_DISABLE_PLUGIN_AUTOLOAD"):
1293-
# We don't autoload from setuptools entry points, no need to continue.
1293+
# We don't autoload from distribution package entry points,
1294+
# no need to continue.
12941295
return
12951296

12961297
package_files = (
@@ -1381,8 +1382,8 @@ def _preparse(self, args: List[str], addopts: bool = True) -> None:
13811382
self._consider_importhook(args)
13821383
self.pluginmanager.consider_preparse(args, exclude_only=False)
13831384
if not os.environ.get("PYTEST_DISABLE_PLUGIN_AUTOLOAD"):
1384-
# Don't autoload from setuptools entry point. Only explicitly specified
1385-
# plugins are going to be loaded.
1385+
# Don't autoload from distribution package entry point. Only
1386+
# explicitly specified plugins are going to be loaded.
13861387
self.pluginmanager.load_setuptools_entrypoints("pytest11")
13871388
self.pluginmanager.consider_env()
13881389

src/_pytest/helpconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def getpluginversioninfo(config: Config) -> List[str]:
243243
lines = []
244244
plugininfo = config.pluginmanager.list_plugin_distinfo()
245245
if plugininfo:
246-
lines.append("setuptools registered plugins:")
246+
lines.append("distribution package registered plugins:")
247247
for plugin, dist in plugininfo:
248248
loc = getattr(plugin, "__file__", repr(plugin))
249249
content = f"{dist.project_name}-{dist.version} at {loc}"

testing/test_assertion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def test_installed_plugin_rewrite(
223223
) -> None:
224224
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
225225
# Make sure the hook is installed early enough so that plugins
226-
# installed via setuptools are rewritten.
226+
# installed via distribution package are rewritten.
227227
pytester.mkdir("hampkg")
228228
contents = {
229229
"hampkg/__init__.py": """\

testing/test_helpconfig.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:
1010
assert result.ret == 0
1111
result.stdout.fnmatch_lines([f"*pytest*{pytest.__version__}*imported from*"])
1212
if pytestconfig.pluginmanager.list_plugin_distinfo():
13-
result.stdout.fnmatch_lines(["*setuptools registered plugins:", "*at*"])
13+
result.stdout.fnmatch_lines(
14+
["*distribution package registered plugins:", "*at*"]
15+
)
1416

1517

1618
def test_version_less_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:

0 commit comments

Comments
 (0)