From 185be7864c435138992a7ffd8d2ce77f259be1bc Mon Sep 17 00:00:00 2001 From: BryanFauble <17128019+BryanFauble@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:04:25 -0700 Subject: [PATCH] Moved install_requires back to setup.py --- setup.cfg | 21 +-------------------- setup.py | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0a4beff37..8cbef9107 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,26 +43,7 @@ zip_safe = False include_package_data = True packages = find: python_requires = >=3.8 -# on Linux specify a cryptography dependency that will not -# require a Rust compiler to compile from source (< 3.4). -# on Linux cryptography is a transitive dependency -# (keyring -> SecretStorage -> cryptography) -# SecretStorage doesn't pin a version so otherwise if cryptography -# is not already installed the dependency will resolve to the latest -# and will require Rust if a precompiled wheel cannot be used -# (e.g. old version of pip or no wheel available for an architecture). -# if a newer version of cryptography is already installed that is -# fine we don't want to trigger a downgrade, hence the conditional -# addition of the versioned dependency. -install_requires = - # "requests>=2.22.0,<2.30.0; python_version<'3.10'", - requests>=2.22.0,<3.0 - urllib3>=1.26.18,<2 - # "urllib3>=2; python_version>='3.10'", - keyring>=15,<23.5 - keyrings.alt==3.1; sys_platform == "linux" - cryptography<3.4; sys_platform == "linux" - deprecated>=1.2.4,<2.0 +#install_requires is defined in the setup.py tests_require = pytest>=6.0.0,<7.0 pytest-mock>=3.0,<4.0 diff --git a/setup.py b/setup.py index 08a61550f..02653fe9b 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ import os from setuptools import setup +import platform import json # make sure not to overwrite existing .synapseConfig with our example one @@ -15,4 +16,33 @@ with open("synapseclient/synapsePythonClient") as config: __version__ = json.load(config)["latestVersion"] -setup(data_files=data_files, version=__version__) +install_requires = [ + # "requests>=2.22.0,<2.30.0; python_version<'3.10'", + "requests>=2.22.0,<3.0", + "urllib3>=1.26.18,<2", + # "urllib3>=2; python_version>='3.10'", + "keyring>=15,<23.5", + "deprecated>=1.2.4,<2.0", +] + +# on Linux specify a cryptography dependency that will not +# require a Rust compiler to compile from source (< 3.4). +# on Linux cryptography is a transitive dependency +# (keyring -> SecretStorage -> cryptography) +# SecretStorage doesn't pin a version so otherwise if cryptography +# is not already installed the dependency will resolve to the latest +# and will require Rust if a precompiled wheel cannot be used +# (e.g. old version of pip or no wheel available for an architecture). +# if a newer version of cryptography is already installed that is +# fine we don't want to trigger a downgrade, hence the conditional +# addition of the versioned dependency. +if platform.system() == "Linux": + install_requires.append("keyrings.alt==3.1") + try: + import cryptography # noqa + + # already installed, don't need to install (or downgrade) + except ImportError: + install_requires.append("cryptography<3.4") + +setup(data_files=data_files, version=__version__, install_requires=install_requires)