summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoridgserpro <idg@serpro.gov.br>2017-02-08 11:35:43 -0200
committeridgserpro <idg@serpro.gov.br>2017-02-09 11:19:30 -0200
commit6a3923e3380a8e679abe76a1356a4faebb4232b1 (patch)
treebb262aa51d979736d66a7bb7ef0e10996ba4be8b
parentc109b93ec8aa611867e34966a009955fe7d48183 (diff)
downloadpython-setuptools-git-6a3923e3380a8e679abe76a1356a4faebb4232b1.tar.gz
Warn deprecation at the beginning of file.
This way the deprecation message is shown when running 'python ez_setup.py' or other methods (like when using 'exec' in buildout world, check https://github.com/buildout/buildout/blob/9ba1e3170a474e6139c9a7eadd32a498c22cb3bb/bootstrap/bootstrap.py#L88 for more details). The deprecation message was improved as well.
-rwxr-xr-xez_setup.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ez_setup.py b/ez_setup.py
index d15ce1da..800c31ef 100755
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -20,7 +20,6 @@ import subprocess
import platform
import textwrap
import contextlib
-import warnings
from distutils import log
@@ -38,9 +37,12 @@ except ImportError:
DEFAULT_VERSION = "33.1.1"
DEFAULT_URL = "https://pypi.io/packages/source/s/setuptools/"
DEFAULT_SAVE_DIR = os.curdir
+DEFAULT_DEPRECATION_MESSAGE = "ez_setup.py is deprecated and when using it setuptools will be pinned to {0} since it's the last version that supports setuptools self upgrade/installation, check https://github.com/pypa/setuptools/issues/581 for more info; use pip to install setuptools"
MEANINGFUL_INVALID_ZIP_ERR_MSG = 'Maybe {0} is corrupted, delete it and try again.'
+log.warn(DEFAULT_DEPRECATION_MESSAGE.format(DEFAULT_VERSION))
+
def _python_cmd(*args):
"""
@@ -409,5 +411,4 @@ def main():
return _install(archive, _build_install_args(options))
if __name__ == '__main__':
- warnings.warn("ez_setup.py is deprecated, check https://github.com/pypa/setuptools/issues/581 for more info; use pip to install setuptools")
sys.exit(main())