Skip to content

Commit

Permalink
Drop support for python 3.5
Browse files Browse the repository at this point in the history
This commit drops support for running with python 3.5. It marks the
minimum supported version of the package as python 3.6, removes python
3.5 package pins, removes the 3.5 CI jobs, and removes the warning on
python 3.5. Looking at the PyPI stats since the deprecation period
started the number of users on Python 3.5 has diminished significantly,
but not disappeared. There were 783 downloads with pip from pypi out of
total of 25782 total pip downloads in the last 30 days. Compared to the
roughly 10% figure when we deprecated Python 3.5.

Merging this means we can not release until after the documented EoL
date for Python 3.5 support of September 13. This shouldn't be a problem
because with Qiskit#4767 we will need to coordinate the release of all the
qiskit elements and are planning to do that after 09/13/2020.

It's worth noting that we should start planning to deprecate python 3.6
support sooner rather than later it goes EoL upstream at the end of
next year [1] and some of our other upstream dependencies (mainly numpy
et al) are going to remove support before the upstream Python EoL date
[2].

[1] https://devguide.python.org/#branchstatus
[2] https://numpy.org/neps/nep-0029-deprecation_policy.html
  • Loading branch information
mtreinish committed Aug 13, 2020
1 parent 995ac92 commit 16ebc8c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 35 deletions.
16 changes: 5 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stages:
variables:
python.version: '3.7'
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* pp*
CIBW_SKIP: cp27-* cp34-* cp35-* pp*
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}/examples/python/stochastic_swap.py
steps:
Expand Down Expand Up @@ -72,7 +72,7 @@ stages:
variables:
python.version: '3.7'
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* pp*
CIBW_SKIP: cp27-* cp34-* cp35-* pp*
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}/examples/python/stochastic_swap.py
steps:
Expand All @@ -95,16 +95,16 @@ stages:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
variables:
CIBW_BEFORE_BUILD: pip install -U Cython
CIBW_SKIP: cp27-* cp34-* pp*
CIBW_SKIP: cp27-* cp34-* cp35-* pp*
TWINE_USERNAME: qiskit
CIBW_TEST_COMMAND: python {project}\examples\python\stochastic_swap.py
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.5', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.5', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x86}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x64}}
- script: choco install vcpython27 -f -y
displayName: Install Visual C++ for Python 2.7
- bash: |
Expand Down Expand Up @@ -349,8 +349,6 @@ stages:
pool: {vmImage: 'vs2017-win2016'}
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
Expand Down Expand Up @@ -423,8 +421,6 @@ stages:
matrix:
Python36:
python.version: '3.6'
Python35:
python.version: '3.5'
Python38:
python.version: '3.8'
variables:
Expand Down Expand Up @@ -494,8 +490,6 @@ stages:
matrix:
Python36:
python.version: '3.6'
Python35:
python.version: '3.5'
Python38:
python.version: '3.8'
variables:
Expand Down
8 changes: 0 additions & 8 deletions qiskit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"""Main Qiskit public functionality."""

import pkgutil
import sys
import warnings
import os

Expand Down Expand Up @@ -82,11 +81,4 @@
from .version import _get_qiskit_versions # noqa


if sys.version_info[0] == 3 and sys.version_info[1] == 5:
warnings.warn(
"Using Qiskit with Python 3.5 is deprecated as of the 0.12.0 release. "
"Support for running Qiskit with Python 3.5 will be removed at the "
"Python 3.5 EoL on 09/13/2020.", DeprecationWarning)


__qiskit_version__ = _get_qiskit_versions()
7 changes: 0 additions & 7 deletions qiskit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
import psutil


def _check_python_version():
"""Check for Python version 3.5+."""
if sys.version_info < (3, 5):
raise Exception('Qiskit requires Python version 3.5 or greater.')


def _filter_deprecation_warnings():
"""Apply filters to deprecation warnings.
Expand All @@ -55,7 +49,6 @@ def _filter_deprecation_warnings():
pass


_check_python_version()
_filter_deprecation_warnings()


Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/drop-py3.5-86a65daa49903d46.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
upgrade:
- |
The deprecated support for running qiskit-terra with Python 3.5 has been
removed. To use qiskit-terra >=0.16.0 you will now need at least Python 3.6.
If you are using Python 3.5 the last version which will work is Qiskit
0.15.x.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cython>=0.27.1
pylatexenc>=1.4
ddt>=1.2.0,!=1.4.0
seaborn>=0.9.0
reno>=3.1.0;python_version>'3.5'
reno>=3.1.0
Sphinx>=1.8.3,<3.1.0
sphinx-rtd-theme>=0.4.0
sphinx-tabs>=1.1.11
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
contextvars>=2.4;python_version<'3.7'
jsonschema>=2.6
networkx>=2.2;python_version>'3.5'
networkx>=2.2,<2.4;python_version=='3.5'
networkx>=2.2
retworkx>=0.4.0
numpy>=1.17
ply>=3.10
Expand Down
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
REQUIREMENTS = [
"contextvars>=2.4;python_version<'3.7'",
"jsonschema>=2.6",
"networkx>=2.2;python_version>'3.5'",
# Networkx 2.4 is the final version with python 3.5 support.
"networkx>=2.2,<2.4;python_version=='3.5'",
"networkx>=2.2",
"retworkx>=0.4.0",
"numpy>=1.17",
"ply>=3.10",
Expand Down Expand Up @@ -96,7 +94,6 @@
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand All @@ -107,7 +104,7 @@
install_requires=REQUIREMENTS,
setup_requires=['Cython>=0.27.1'],
include_package_data=True,
python_requires=">=3.5",
python_requires=">=3.6",
extras_require={
'visualization': ['matplotlib>=2.1', 'ipywidgets>=7.3.0',
'pydot', "pillow>=4.2.1", "pylatexenc>=1.4",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 2.1
envlist = py35, py36, py37, py38, lint
envlist = py36, py37, py38, lint
skipsdist = True

[testenv]
Expand Down

0 comments on commit 16ebc8c

Please sign in to comment.