Skip to content

Commit

Permalink
Update minimum version of requests dependency we require as part of
Browse files Browse the repository at this point in the history
install_requires in setup.py to 2.26.0 when running under Python >= 3.6.

This was done to avoid potential licensing issue with transitive
dependency of the requests library (chardet).

NOTE: Since requests 2.26.0 dropped support for Python 3.5 which we
still stupport, requests >= 2.25.1 is required when running under Python
3.5.

Thanks to Jarek Potiuk - @potiuk for reporting this issue.

Resolves apache#1594.
  • Loading branch information
Kami authored and dimgal1 committed Nov 12, 2021
1 parent f5df16e commit 43947fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pylint==2.4.4
mock==3.0.5
codecov==2.1.12
coverage==4.5.4
requests
requests>=2.25.0; python_version <= '3.5'
requests>=2.26.0; python_version >= '3.6'
requests_mock
# 5.3.2 is latest version which still supports Python 3.5, >= 6.2.5 is needed for Python 3.10
pytest==5.3.2; python_version <= '3.5'
Expand Down
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,16 @@ def get_data_files(dname, ignore=None, parent=None):
# setuptools >= 36.2
# For installation, minimum required pip version is 1.4
# Reference: https://hynek.me/articles/conditional-python-dependencies/
INSTALL_REQUIREMENTS = [
'requests>=2.5.0',
]
# We rely on >= 2.26.0 to avoid issues with LGL transitive dependecy
# See https://github.com/apache/libcloud/issues/1594 for more context
INSTALL_REQUIREMENTS = []

if sys.version_info < (3, 6, 0):
# requests 2.26.0 doesn't support Python 3.5 anymore
INSTALL_REQUIREMENTS.append('requests>=2.25.1')
else:
INSTALL_REQUIREMENTS.append('requests>=2.26.0')


setuptools_version = tuple(setuptools.__version__.split(".")[0:2])
setuptools_version = tuple([int(c) for c in setuptools_version])
Expand Down

0 comments on commit 43947fd

Please sign in to comment.