From bc3389a6048b23871e50eaab20d8df06ba3ff53d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 27 Sep 2015 07:50:30 -0400 Subject: Extract _requirement_spec method for rendering the requirement specification for scripts. Ref #439. --- setuptools/command/easy_install.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 45d180bb..2faff4c2 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -766,7 +766,7 @@ class easy_install(Command): def install_script(self, dist, script_name, script_text, dev_path=None): """Generate a legacy script wrapper and install it""" - spec = str(dist.as_requirement()) + spec = self._requirement_spec(dist) is_script = is_python_script(script_text, script_name) if is_script: @@ -774,6 +774,10 @@ class easy_install(Command): self._load_template(dev_path) % locals()) self.write_script(script_name, _to_ascii(script_text), 'b') + @staticmethod + def _requirement_spec(dist): + return str(dist.as_requirement()) + @staticmethod def _load_template(dev_path): """ -- cgit v1.2.1