Commit ce62d094 authored by Julien Muchembled's avatar Julien Muchembled

Do not install entry points if there's any missing extra

parent 96a0d1ea
...@@ -1273,14 +1273,16 @@ def scripts(reqs, working_set, executable, dest=None, ...@@ -1273,14 +1273,16 @@ def scripts(reqs, working_set, executable, dest=None,
for req in reqs: for req in reqs:
if isinstance(req, str): if isinstance(req, str):
req = pkg_resources.Requirement.parse(req) req = pkg_resources.Requirement.parse(req)
has_extras = set(req.extras).issuperset
dist = working_set.find(req) dist = working_set.find(req)
# regular console_scripts entry points # regular console_scripts entry points
for name in pkg_resources.get_entry_map(dist, 'console_scripts'): for name in pkg_resources.get_entry_map(dist, 'console_scripts'):
entry_point = dist.get_entry_info('console_scripts', name) entry_point = dist.get_entry_info('console_scripts', name)
entry_points.append( if has_extras(entry_point.extras):
(name, entry_point.module_name, entry_points.append(
'.'.join(entry_point.attrs)) (name, entry_point.module_name,
) '.'.join(entry_point.attrs))
)
# The metadata on "old-style" distutils scripts is not retained by # The metadata on "old-style" distutils scripts is not retained by
# distutils/setuptools, except by placing the original scripts in # distutils/setuptools, except by placing the original scripts in
# /EGG-INFO/scripts/. # /EGG-INFO/scripts/.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment