From 403c54effa8d1fc7792f4a63731643d155634493 Mon Sep 17 00:00:00 2001 From: Bart Skowron Date: Sat, 18 Sep 2021 23:52:32 +0200 Subject: [PATCH 1/2] Explicitly define the maximum version required The currently used version of `setuptools` has a bug, so the version requirements are not properly respected. In the current version, `requests>= 0.12.1` always installs the latest version of the package. --- setup.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 71d019c8..1fe70750 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,19 @@ "Topic :: System :: Monitoring", ], install_requires=[ - 'requests>=0.12.1', + # The currently used version of `setuptools` has a bug, + # so the version requirements are not properly respected. + # + # In the current version, `requests>= 0.12.1` + # always installs the latest version of the package. + 'requests>=0.12.1; python_version == "2.7"', + 'requests>=0.12.1; python_version >= "3.6"', + 'requests<2.26,>=0.12.1; python_version == "3.5"', + 'requests<2.22,>=0.12.1; python_version == "3.4"', + 'requests<2.19,>=0.12.1; python_version == "3.3"', + 'requests<1.2,>=0.12.1; python_version == "3.2"', + 'requests<1.2,>=0.12.1; python_version == "3.1"', + 'requests<1.2,>=0.12.1; python_version == "3.0"', 'six>=1.9.0' ], tests_require=tests_require, From ef5b42b7549dfb18ed801f8dec86bf691e7cf7d7 Mon Sep 17 00:00:00 2001 From: Bart Skowron Date: Sat, 18 Sep 2021 23:53:28 +0200 Subject: [PATCH 2/2] Remove redundant import and whitespaces --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1fe70750..db85c93d 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ import re import os.path -import sys from setuptools import setup, find_packages HERE = os.path.abspath(os.path.dirname(__file__)) @@ -94,4 +93,4 @@ 'six>=1.9.0' ], tests_require=tests_require, - ) +)