Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Python 3.5 #1620

Merged
merged 8 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
fail-fast: false
matrix:
python_version:
- 3.5
- 3.6
- 3.7
- 3.8
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 9 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -67,12 +67,13 @@ Documentation can be found at <https://libcloud.readthedocs.org>.
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
========
Expand Down
11 changes: 10 additions & 1 deletion docs/upgrade_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -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'
23 changes: 9 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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])
Expand All @@ -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)


Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down
29 changes: 3 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down