mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Proceed when pip not found
This commit is contained in:
parent
8aca842e9f
commit
604c6263a3
1 changed files with 18 additions and 10 deletions
28
setup.py
28
setup.py
|
@ -11,6 +11,7 @@ The setup script for salt
|
|||
# For Python 2.5. A no-op on 2.6 and above.
|
||||
from __future__ import absolute_import, print_function, with_statement
|
||||
|
||||
import contextlib
|
||||
import distutils.dist
|
||||
import glob
|
||||
import inspect
|
||||
|
@ -461,18 +462,25 @@ class DownloadWindowsDlls(Command):
|
|||
if getattr(self.distribution, "salt_download_windows_dlls", None) is None:
|
||||
print("This command is not meant to be called on it's own")
|
||||
exit(1)
|
||||
import pip
|
||||
try:
|
||||
import pip
|
||||
|
||||
# pip has moved many things to `_internal` starting with pip 10
|
||||
if LooseVersion(pip.__version__) < LooseVersion("10.0"):
|
||||
# pylint: disable=no-name-in-module
|
||||
from pip.utils.logging import indent_log
|
||||
# pip has moved many things to `_internal` starting with pip 10
|
||||
if LooseVersion(pip.__version__) < LooseVersion("10.0"):
|
||||
# pylint: disable=no-name-in-module
|
||||
from pip.utils.logging import indent_log
|
||||
|
||||
# pylint: enable=no-name-in-module
|
||||
else:
|
||||
from pip._internal.utils.logging import (
|
||||
indent_log,
|
||||
) # pylint: disable=no-name-in-module
|
||||
except ImportError:
|
||||
# TODO: Impliment indent_log here so we don't require pip
|
||||
@contextlib.contextmanager
|
||||
def indent_log():
|
||||
yield
|
||||
|
||||
# pylint: enable=no-name-in-module
|
||||
else:
|
||||
from pip._internal.utils.logging import (
|
||||
indent_log,
|
||||
) # pylint: disable=no-name-in-module
|
||||
platform_bits, _ = platform.architecture()
|
||||
url = "https://repo.saltstack.com/windows/dependencies/{bits}/{fname}.dll"
|
||||
dest = os.path.join(os.path.dirname(sys.executable), "{fname}.dll")
|
||||
|
|
Loading…
Add table
Reference in a new issue