diff options
Diffstat (limited to 'setuptools')
| -rwxr-xr-x | setuptools/command/easy_install.py | 2 | ||||
| -rwxr-xr-x | setuptools/command/sdist.py | 11 | ||||
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index ae9079d8..5065661f 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -2018,10 +2018,12 @@ class ScriptWriter(object): template = textwrap.dedent(""" # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r + import re import sys from pkg_resources import load_entry_point 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)() ) diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index b6125f58..1d4f5d54 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -66,6 +66,17 @@ class sdist(orig.sdist): if data not in dist_files: dist_files.append(data) + def initialize_options(self): + orig.sdist.initialize_options(self) + + self._default_to_gztar() + + def _default_to_gztar(self): + # only needed on Python prior to 3.6. + if sys.version_info >= (3, 6, 0, 'beta', 1): + return + self.formats = ['gztar'] + def make_distribution(self): """ Workaround for #516 diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index da0a355c..82e1d7e8 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -74,10 +74,12 @@ class TestEasyInstallTest: expected = header + DALS(""" # EASY-INSTALL-ENTRY-SCRIPT: 'spec','console_scripts','name' __requires__ = 'spec' + import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point('spec', 'console_scripts', 'name')() ) |
