Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/2093.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Plugins now use 'selectable' entry points.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ project_urls =
packages = find:
install_requires =
appdirs>=1.4.3,<2
backports.entry_points_selectable>=1.0.4
distlib>=0.3.1,<1
filelock>=3.0.0,<4
six>=1.9.0,<2 # keep it >=1.9.0 as it may cause problems on LTS platforms
Expand Down
8 changes: 2 additions & 6 deletions src/virtualenv/run/plugin/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from __future__ import absolute_import, unicode_literals

import sys
from collections import OrderedDict

if sys.version_info >= (3, 8):
from importlib.metadata import entry_points
else:
from importlib_metadata import entry_points
from backports.entry_points_selectable import entry_points


class PluginLoader(object):
Expand All @@ -15,7 +11,7 @@ class PluginLoader(object):

@classmethod
def entry_points_for(cls, key):
return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))
return OrderedDict((e.name, e.load()) for e in cls.entry_points().select(group=key))

@staticmethod
def entry_points():
Expand Down