aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--changelog.d/1557.change.rst1
-rw-r--r--docs/setuptools.txt2
-rw-r--r--setuptools/command/bdist_egg.py9
-rw-r--r--setuptools/tests/test_bdist_egg.py15
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()