From 83c11a49f2e45fbee43a3aa57ec89a8e83169350 Mon Sep 17 00:00:00 2001 From: Jiashuo Li <4003950+jiasli@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:43:44 +0800 Subject: [PATCH] {Packaging} Use proper PEP 508 environment marker for dependencies (#21660) --- src/azure-cli-core/setup.py | 7 ++----- src/azure-cli/setup.py | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/azure-cli-core/setup.py b/src/azure-cli-core/setup.py index 75aa42c5daa..f45c67a0208 100644 --- a/src/azure-cli-core/setup.py +++ b/src/azure-cli-core/setup.py @@ -57,16 +57,13 @@ 'packaging>=20.9,<22.0', 'paramiko>=2.0.8,<3.0.0', 'pkginfo>=1.5.0.1', + # psutil can't install on cygwin: https://github.com/Azure/azure-cli/issues/9399 + 'psutil~=5.9; sys_platform != "cygwin"', 'PyJWT>=2.1.0', 'pyopenssl>=17.1.0', # https://github.com/pyca/pyopenssl/pull/612 'requests[socks]' ] -# dependencies for specific OSes -if not sys.platform.startswith('cygwin'): - DEPENDENCIES.append('psutil~=5.9') - - with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() diff --git a/src/azure-cli/setup.py b/src/azure-cli/setup.py index b2df52bae2d..33b5ff4e145 100644 --- a/src/azure-cli/setup.py +++ b/src/azure-cli/setup.py @@ -139,6 +139,8 @@ 'azure-synapse-spark~=0.2.0', 'chardet~=3.0.4', 'colorama~=0.4.4', + # On Linux, the distribution (Ubuntu, Debian, etc) and version are checked for `az feedback` + 'distro; sys_platform == "linux"', 'fabric~=2.4', 'javaproperties~=0.5.1', 'jsondiff~=1.3.0', @@ -154,10 +156,6 @@ 'xmltodict~=0.12' ] -# On Linux, the distribution (Ubuntu, Debian, etc) and version are checked -if sys.platform == 'linux': - DEPENDENCIES.append('distro') - with open('README.rst', 'r', encoding='utf-8') as f: README = f.read()