diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-11 22:28:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 22:28:52 -0500 |
commit | 874b7ef017c0d1b2de55d4aedfdc316856ae3081 (patch) | |
tree | da78c024b4491210e61b73e9e2f755d46c8bc1ff | |
parent | a5dec2f14e3414e4ee5dd146bff9c289d573de9a (diff) | |
parent | ce8e3ee174ed9dee84aa08a461fb174ac1e53535 (diff) | |
download | external_python_setuptools-874b7ef017c0d1b2de55d4aedfdc316856ae3081.tar.gz external_python_setuptools-874b7ef017c0d1b2de55d4aedfdc316856ae3081.tar.bz2 external_python_setuptools-874b7ef017c0d1b2de55d4aedfdc316856ae3081.zip |
Merge pull request #1764 from venthur/fix/1557
Deprecated Eggsecutable Scripts
-rw-r--r-- | changelog.d/1557.change.rst | 1 | ||||
-rw-r--r-- | docs/setuptools.txt | 2 | ||||
-rw-r--r-- | setuptools/command/bdist_egg.py | 9 | ||||
-rw-r--r-- | setuptools/tests/test_bdist_egg.py | 15 |
4 files changed, 26 insertions, 1 deletions
diff --git a/changelog.d/1557.change.rst b/changelog.d/1557.change.rst new file mode 100644 index 00000000..9f8af4a6 --- /dev/null +++ b/changelog.d/1557.change.rst @@ -0,0 +1 @@ +Deprecated eggsecutable scripts and updated docs. diff --git a/docs/setuptools.txt b/docs/setuptools.txt index f84837ff..efcd0a86 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -560,6 +560,8 @@ Services and Plugins`_. "Eggsecutable" Scripts ---------------------- +.. deprecated:: 45.3.0 + Occasionally, there are situations where it's desirable to make an ``.egg`` file directly executable. You can do this by including an entry point such as the following:: diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 98470f17..1b28d4c9 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -11,13 +11,14 @@ import os import re import textwrap import marshal +import warnings from setuptools.extern import six from pkg_resources import get_build_platform, Distribution, ensure_directory from pkg_resources import EntryPoint from setuptools.extension import Library -from setuptools import Command +from setuptools import Command, SetuptoolsDeprecationWarning try: # Python 2.7 or >=3.2 @@ -278,6 +279,12 @@ class bdist_egg(Command): if ep is None: return 'w' # not an eggsecutable, do it the usual way. + warnings.warn( + "Eggsecutables are deprecated and will be removed in a future " + "version.", + SetuptoolsDeprecationWarning + ) + if not ep.attrs or ep.extras: raise DistutilsSetupError( "eggsecutable entry point (%r) cannot have 'extras' " diff --git a/setuptools/tests/test_bdist_egg.py b/setuptools/tests/test_bdist_egg.py index fb5b90b1..8760ea30 100644 --- a/setuptools/tests/test_bdist_egg.py +++ b/setuptools/tests/test_bdist_egg.py @@ -7,6 +7,7 @@ import zipfile import pytest from setuptools.dist import Distribution +from setuptools import SetuptoolsDeprecationWarning from . import contexts @@ -64,3 +65,17 @@ class Test: names = list(zi.filename for zi in zip.filelist) assert 'hi.pyc' in names assert 'hi.py' not in names + + def test_eggsecutable_warning(self, setup_context, user_override): + dist = Distribution(dict( + script_name='setup.py', + script_args=['bdist_egg'], + name='foo', + py_modules=['hi'], + entry_points={ + 'setuptools.installation': + ['eggsecutable = my_package.some_module:main_func']}, + )) + dist.parse_command_line() + with pytest.warns(SetuptoolsDeprecationWarning): + dist.run_commands() |