From df99eefd484692882dd845fd4df8fb34f629d256 Mon Sep 17 00:00:00 2001 From: Mikhail Golubev Date: Tue, 11 Jul 2017 19:44:12 +0300 Subject: [PATCH] PY-24682 Explicitly remove helpers directory from the sys.path in packaging_tool.py As a workaround for the pip's issue #4216 and setuptools' #885. --- python/helpers/packaging_tool.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/helpers/packaging_tool.py b/python/helpers/packaging_tool.py index fc0a71bcc974..e770cf41f671 100644 --- a/python/helpers/packaging_tool.py +++ b/python/helpers/packaging_tool.py @@ -161,6 +161,14 @@ def mkdtemp_ifneeded(): def main(): + try: + # As a workaround for #885 in setuptools, don't expose other helpers + # in sys.path so as not no confuse it with possible combination of + # namespace/ordinary packages + sys.path.remove(os.path.dirname(__file__)) + except ValueError: + pass + retcode = 0 try: if len(sys.argv) < 2: