diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4415b7795d..9f939ab7a7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,6 @@ jobs: fail-fast: false matrix: python_version: - - 3.5 - 3.6 - 3.7 - 3.8 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/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/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 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' diff --git a/setup.py b/setup.py index 0f3ef37af0..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) @@ -278,7 +274,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', @@ -304,7 +300,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', diff --git a/tox.ini b/tox.ini index 1e19e7d1de..f2c9c04712 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,pyjion},checks,lint,pylint,mypy,docs,coverage,integration-storage +envlist = py{pypy3,3.6,3.7,3.8,3.9,3.10,pyjion},checks,lint,pylint,mypy,docs,coverage,integration-storage skipsdist = true requires = wheel @@ -11,10 +11,8 @@ deps = fasteners libvirt-python==7.9.0 basepython = - pypypy3.5: pypy3.5 pypypy3: pypy3 pypyjion: pyjion - {py3.5,py3.5-dist,py3.5-dist-wheel}: python3.5 {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 {py3.8,py3.8-windows,integration-storage,py3.8-dist,py3.8-dist-wheel}: python3.8 @@ -27,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 @@ -40,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