Skip to content

Commit

Permalink
Adjust build requirements because of Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed May 7, 2020
1 parent 1b6e0a5 commit d540d71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
requires = ["setuptools >= 40.6.0", "wheel", "pip >= 20.1", "requests; sys_platform == 'win32'"]
build-backend = "setuptools.build_meta"

[tool.black]
Expand Down
18 changes: 8 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,18 +373,16 @@ def run(self):
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

# 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
try:
from pip._internal.utils.logging import indent_log
except ImportError:
from contextlib import contextmanager

@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")
Expand Down

0 comments on commit d540d71

Please sign in to comment.