diff options
Diffstat (limited to 'setuptools/command')
-rw-r--r-- | setuptools/command/develop.py | 26 | ||||
-rw-r--r-- | setuptools/command/easy_install.py | 9 |
2 files changed, 4 insertions, 31 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index b5619246..5d17c04b 100644 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -192,30 +192,4 @@ class develop(namespaces.DevelopInstaller, easy_install): self.install_script(dist, script_name, script_text, script_path) def install_wrapper_scripts(self, dist): - dist = VersionlessRequirement(dist) return easy_install.install_wrapper_scripts(self, dist) - - -class VersionlessRequirement: - """ - Adapt a pkg_resources.Distribution to simply return the project - name as the 'requirement' so that scripts will work across - multiple versions. - - >>> from pkg_resources import Distribution - >>> dist = Distribution(project_name='foo', version='1.0') - >>> str(dist.as_requirement()) - 'foo==1.0' - >>> adapted_dist = VersionlessRequirement(dist) - >>> str(adapted_dist.as_requirement()) - 'foo' - """ - - def __init__(self, dist): - self.__dist = dist - - def __getattr__(self, name): - return getattr(self.__dist, name) - - def as_requirement(self): - return self.project_name diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 81526b9a..5d39ff16 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2071,7 +2071,7 @@ class ScriptWriter: """ template = textwrap.dedent(r""" - # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r + # EASY-INSTALL-ENTRY-SCRIPT: %(dist_name)r,%(group)r,%(name)r import re import sys @@ -2084,8 +2084,7 @@ class ScriptWriter: from pkg_resources import load_entry_point - def importlib_load_entry_point(spec, group, name): - dist_name, _, _ = spec.partition('==') + def importlib_load_entry_point(dist_name, group, name): matches = ( entry_point for entry_point in distribution(dist_name).entry_points @@ -2099,7 +2098,7 @@ class ScriptWriter: if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) - sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)()) + sys.exit(load_entry_point(%(dist_name)r, %(group)r, %(name)r)()) """).lstrip() command_spec_class = CommandSpec @@ -2129,7 +2128,7 @@ class ScriptWriter: """ if header is None: header = cls.get_header() - spec = str(dist.as_requirement()) + dist_name = dist.project_name for type_ in 'console', 'gui': group = type_ + '_scripts' for name, ep in dist.get_entry_map(group).items(): |