From 316a3df4d679f6df8e084a1c9a3ef68d93a73f46 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 25 Oct 2021 11:53:02 +0200 Subject: [PATCH 1/7] Drop support for Python 3.5. --- README.rst | 17 +++++++++-------- setup.py | 3 +-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 1fb4ed199a..e9495cb070 100644 --- a/README.rst +++ b/README.rst @@ -42,9 +42,9 @@ through a unified and easy to use API. :Issues: https://issues.apache.org/jira/projects/LIBCLOUD/issues :Website: https://libcloud.apache.org/ :Documentation: https://libcloud.readthedocs.io -:Supported Python Versions: Python >= 3.5, PyPy 3 (Python 2.7 and Python 3.4 is - supported by the v2.8.x release series) - +:Supported Python Versions: Python >= 3.6, PyPy 3 (Python 2.7 and Python 3.4 is + supported by the v2.8.x release series, last version + which supports Python 3.5 is v3.4.0) Resources you can manage with Libcloud are divided into the following categories: @@ -67,12 +67,13 @@ Documentation can be found at . Note on Python Version Compatibility ==================================== -Libcloud v3.0.0 dropped support for Python 2.7 and Python 3.4 and now only -supports Python >= 3.5. +Libcloud supports Python >= 3.6 and PyPy3. + +Support for Python 3.5 has been dropped in v3.4.0 release (last release series +which still supports 3.5 is v3.3.x). -If you still need to us Libcloud with one of the now unsupported versions, -you can do that by using the latest release of Libcloud which still supports -those versions (Libcloud v2.8). +Support for Python 2.7 and 3.4 has been dropped in Libcloud v3.0.0 (last +release series which still support Python 2.7 and Python 3.4 is v2.8.x). Feedback ======== diff --git a/setup.py b/setup.py index c04e0f117a..65a51c56af 100644 --- a/setup.py +++ b/setup.py @@ -271,7 +271,7 @@ def run(self): author='Apache Software Foundation', author_email='dev@libcloud.apache.org', install_requires=INSTALL_REQUIREMENTS, - python_requires=">=3.5, <4", + python_requires=">=3.6, <4", packages=get_packages('libcloud'), package_dir={ 'libcloud': 'libcloud', @@ -297,7 +297,6 @@ def run(self): 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', From 50b28053d44e39b4ae3f07a0af800b8e9d91c4e8 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 25 Oct 2021 11:54:38 +0200 Subject: [PATCH 2/7] Remove support for Python 3.5 from tox and GHA workflow. --- .github/workflows/main.yml | 1 - tox.ini | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7648282e5..0ecee81859 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,6 @@ jobs: fail-fast: false matrix: python_version: - - 3.5 - 3.6 - 3.7 - 3.8 diff --git a/tox.ini b/tox.ini index b1d321527e..436508fe8f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{pypy3.5,3.5,3.6,3.7,3.8,3.9,3.10},checks,lint,pylint,mypy,docs,coverage,integration-storage +envlist = py{pypy3,3.6,3.7,3.8,3.9,3.10},checks,lint,pylint,mypy,docs,coverage,integration-storage skipsdist = true [testenv] @@ -10,9 +10,7 @@ deps = libvirt-python==6.10.0 setuptools==42.0.2 basepython = - pypypy3.5: pypy3.5 pypypy3: pypy3 - py3.5: python3.5 py3.6: python3.6 {py3.7,docs,checks,lint,pylint,mypy,coverage,docs,py3.7-dist,py3.7-dist-wheel}: python3.7 {py3.8,py3.8-windows,integration-storage}: python3.8 From 88fa5a100b8cbfb952b8f92b464b36e1cdfd2e85 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 10 Nov 2021 18:35:09 +0100 Subject: [PATCH 3/7] Add changelog and upgrade notes entry. --- CHANGES.rst | 7 +++++++ docs/upgrade_notes.rst | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index ec6ea8aaaf..b00663d6a3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,13 @@ Changes in Apache Libcloud in development Common ~~~~~~ +- Support for Python 3.5 which has been EOL for more than a year now has been + removed. + + If you still want to use Libcloud with Python 3.5, you should use an older + release which still supports Python 3.5. + (GITHUB-1620) + - Update code which retries failed HTTP requests to also retry failed "raw" requests and make sure we also wrap and retry piece of code where Response class is instantiated and exceptions can be thrown. diff --git a/docs/upgrade_notes.rst b/docs/upgrade_notes.rst index a5e1781394..d2cbdc022c 100644 --- a/docs/upgrade_notes.rst +++ b/docs/upgrade_notes.rst @@ -5,7 +5,16 @@ This page describes how to upgrade from a previous version to a new version which contains backward incompatible or semi-incompatible changes and how to preserve the old behavior when this is possible. -Libcloud 3.3.2 +Libcloud 3.5.0 +-------------- + +* Support for Python 3.5 which has been EOL for more than a year now has been + removed. + + If you still want to use Libcloud with Python 3.5, you should use an older + release which still supports Python 3.5. + +Libcloud 3.4.0 -------------- * Exception message changed in OpenStack drivers From c1ee89566274c6ed4dabec5f930530cdb1ca44a9 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 10 Nov 2021 18:43:36 +0100 Subject: [PATCH 4/7] Fix tox config. --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index c7e6001251..85263cdfd5 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,6 @@ deps = libvirt-python==7.9.0 basepython = pypypy3: pypy3 - py3.6: python3.6 pypyjion: pyjion {py3.6,py3.6-dist,py3.6-dist-wheel}: python3.6 {py3.7,docs,checks,lint,pylint,mypy,coverage,docs,py3.7-dist,py3.7-dist-wheel}: python3.7 From 2b8d521cc8400f6bc454ff19fd2f83ce0fd918c2 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 10 Nov 2021 18:44:23 +0100 Subject: [PATCH 5/7] Remove tox targets we don't need anymore. --- tox.ini | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/tox.ini b/tox.ini index 85263cdfd5..f2c9c04712 100644 --- a/tox.ini +++ b/tox.ini @@ -25,9 +25,9 @@ setenv = # file in the same worker process. # python setup.py test # NOTE: tee-sys is not supported by pytest which still supports Python 3.5 -# pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 -n auto --dist loadfile +# pytest -rsx -vvv -o log_cli=True --durations=10 -n auto --dist loadfile commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py - pytest -rsx -vvv -o log_cli=True --durations=10 -n auto --dist loadfile + pytest -rsx -vvv --capture=tee-sys -o log_cli=True --durations=10 -n auto --dist loadfile whitelist_externals = cp bash @@ -38,27 +38,6 @@ deps = -r{toxinidir}/requirements-tests.txt fasteners -[testenv:py3.5-dist] -# Verify library installs without any dependencies when using python setup.py -# install -skipdist = True -recreate = True -# NOTE: We intentionally set empty deps to ensure it works on a clean -# environment without any dependencies -deps = -# Ensure those packages are not installed. If they are, it indicates unclean -# environment so those checks won't work correctly -commands = bash ./scripts/dist_install_check.sh - -[testenv:py3.5-dist-wheel] -# Verify library installs without any dependencies when using built wheel -skipdist = True -recreate = True -# NOTE: We intentionally set empty deps to ensure it works on a clean -# environment without any dependencies -deps = -commands = bash -c "./scripts/dist_wheel_install_check.sh" - [testenv:py3.6-dist] # Verify library installs without any dependencies when using python setup.py # install From a293b96b7180b5e355190a4f72719488e56e0823 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 10 Nov 2021 18:48:47 +0100 Subject: [PATCH 6/7] Simplify requirements now that we don't support Python 3.5 anymore. --- requirements-tests.txt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 7c718789e8..f249d2d5e6 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,27 +1,15 @@ pep8==1.7.1 -flake8==3.9.2; python_version <= '3.5' flake8==4.0.1; python_version >= '3.6' -astroid==2.3.3; python_version <= '3.5' astroid==2.8.4; python_version >= '3.6' -pylint==2.4.4; python_version <= '3.5' pylint==2.11.1; python_version >= '3.6' -mock==3.0.5; python_version <= '3.5' mock==4.0.3; python_version >= '3.6' codecov==2.1.12 coverage==4.5.4 -requests>=2.25.0; python_version <= '3.5' requests>=2.26.0; python_version >= '3.6' requests_mock==1.9.3 -# 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' pytest==6.2.5; python_version >= '3.6' -pytest-xdist==1.34.0; python_version <= '3.5' pytest-xdist==2.4.0; python_version >= '3.6' -cryptography==3.2.1; python_version <= '3.5' cryptography==35.0.0; python_version >= '3.6' # NOTE: Only needed by nttcis loadbalancer driver -pyopenssl==20.0.1; python_version <= '3.5' pyopenssl==21.0.0; python_version >= '3.6' -# Newer version of itertools doesn't support Python 3.5 anymore -more-itertools==8.10.0; python_version <= '3.5' more-itertools==8.11.0; python_version >= '3.6' From a1e148dfdf8cd1529c300ad7d59591e13a32502d Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 10 Nov 2021 19:03:50 +0100 Subject: [PATCH 7/7] Update setup.py now that we don't support 3.5 anymore. --- setup.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index a1d0b7d99d..05dc38bc34 100644 --- a/setup.py +++ b/setup.py @@ -153,7 +153,7 @@ def get_data_files(dname, ignore=None, parent=None): # Different versions of python have different requirements. We can't use # libcloud.utils.py3 here because it relies on backports dependency being # installed / available -PY_pre_35 = sys.version_info < (3, 5, 0) +PY_pre_36 = sys.version_info < (3, 6, 0) HTML_VIEWSOURCE_BASE = 'https://svn.apache.org/viewvc/libcloud/trunk' PROJECT_BASE_DIR = 'https://libcloud.apache.org' @@ -167,21 +167,16 @@ def get_data_files(dname, ignore=None, parent=None): 'libcloud.container.drivers.dummy', 'libcloud.backup.drivers.dummy'] -SUPPORTED_VERSIONS = ['PyPy 3', 'Python 3.5+'] +SUPPORTED_VERSIONS = ['PyPy 3.6+', 'Python 3.6+'] # NOTE: python_version syntax is only supported when build system has # setuptools >= 36.2 # For installation, minimum required pip version is 1.4 # Reference: https://hynek.me/articles/conditional-python-dependencies/ -# We rely on >= 2.26.0 to avoid issues with LGL transitive dependecy +# We rely on >= 2.26.0 to avoid issues with LGPL transitive dependency # 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') +INSTALL_REQUIREMENTS.append('requests>=2.26.0') setuptools_version = tuple(setuptools.__version__.split(".")[0:2]) @@ -201,11 +196,12 @@ def get_data_files(dname, ignore=None, parent=None): 'pytest-runner' ] + INSTALL_REQUIREMENTS -if PY_pre_35: +if PY_pre_36: version = '.'.join([str(x) for x in sys.version_info[:3]]) - print('Version ' + version + ' is not supported. Supported versions are: %s. ' + print('Python version %s is not supported. Supported versions are: %s. ' 'Latest version which supports Python 2.7 and Python 3 < 3.5.0 is ' - 'Libcloud v2.8.2' % ', '.join(SUPPORTED_VERSIONS)) + 'Libcloud v2.8.2 and Libcloud v3.4.0 for Python 3.5.' % + (version, ', '.join(SUPPORTED_VERSIONS))) sys.exit(1)