Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows and macOS requirements handling in setup.py #56099

Merged
merged 3 commits into from
Mar 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
)

# Store a reference to the executing platform
IS_OSX_PLATFORM = sys.platform.startswith('darwin')
IS_WINDOWS_PLATFORM = sys.platform.startswith('win')
if IS_WINDOWS_PLATFORM:
if IS_WINDOWS_PLATFORM or IS_OSX_PLATFORM:
IS_SMARTOS_PLATFORM = False
else:
# os.uname() not available on Windows.
Expand All @@ -100,8 +101,15 @@
SALT_REQS = os.path.join(os.path.abspath(SETUP_DIRNAME), 'requirements', 'base.txt')
SALT_CRYPTO_REQS = os.path.join(os.path.abspath(SETUP_DIRNAME), 'requirements', 'crypto.txt')
SALT_ZEROMQ_REQS = os.path.join(os.path.abspath(SETUP_DIRNAME), 'requirements', 'zeromq.txt')
SALT_WINDOWS_REQS = os.path.join(os.path.abspath(SETUP_DIRNAME), 'pkg', 'windows', 'req.txt')
SALT_LONG_DESCRIPTION_FILE = os.path.join(os.path.abspath(SETUP_DIRNAME), 'README.rst')
SALT_OSX_REQS = [
os.path.join(os.path.abspath(SETUP_DIRNAME), 'pkg', 'osx', 'req.txt'),
os.path.join(os.path.abspath(SETUP_DIRNAME), 'pkg', 'osx', 'req_ext.txt')
]
SALT_WINDOWS_REQS = [
os.path.join(os.path.abspath(SETUP_DIRNAME), 'pkg', 'windows', 'req.txt'),
os.path.join(os.path.abspath(SETUP_DIRNAME), 'pkg', 'windows', 'req_win.txt')
]

# Salt SSH Packaging Detection
PACKAGED_FOR_SALT_SSH_FILE = os.path.join(os.path.abspath(SETUP_DIRNAME), '.salt-ssh-package')
Expand Down Expand Up @@ -1019,14 +1027,24 @@ def _property_data_files(self):

@property
def _property_install_requires(self):

if IS_OSX_PLATFORM:
install_requires = []
for reqfile in SALT_OSX_REQS:
install_requires += _parse_requirements_file(reqfile)
return install_requires

if IS_WINDOWS_PLATFORM:
install_requires = []
for reqfile in SALT_WINDOWS_REQS:
install_requires += _parse_requirements_file(reqfile)
return install_requires

install_requires = _parse_requirements_file(SALT_REQS)

if self.salt_transport == 'zeromq':
install_requires += _parse_requirements_file(SALT_CRYPTO_REQS)
install_requires += _parse_requirements_file(SALT_ZEROMQ_REQS)

if IS_WINDOWS_PLATFORM:
install_requires = _parse_requirements_file(SALT_WINDOWS_REQS)
return install_requires

@property
Expand Down