Skip to content

Commit 16c31cc

Browse files
maffooaugustehirth
authored andcommitted
Drop support for python 3.6 (quantumlib#5373)
This is a step toward following the numpy python support schedule (quantumlib#3347). Note that according to the schedule we should be at 3.8+, but we cannot yet drop support for 3.7 since colab is still at 3.7.13.
1 parent d97d1b1 commit 16c31cc

File tree

20 files changed

+22
-50
lines changed

20 files changed

+22
-50
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,14 @@ jobs:
155155
name: Pytest Ubuntu
156156
strategy:
157157
matrix:
158-
python-version: [ '3.6', '3.7', '3.8', '3.9' ]
158+
python-version: [ '3.7', '3.8', '3.9' ]
159159
runs-on: ubuntu-20.04
160160
steps:
161161
- uses: actions/checkout@v2
162162
- uses: actions/setup-python@v1
163163
with:
164164
python-version: ${{ matrix.python-version }}
165165
architecture: 'x64'
166-
- name: Force old pip (3.6 only)
167-
if: matrix.python-version == '3.6'
168-
run: pip install pip==20.2
169166
- uses: actions/cache@v2
170167
with:
171168
path: ${{ env.pythonLocation }}

asv.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dvcs": "git",
99
"environment_type": "virtualenv",
1010
"show_commit_url": "https://github.com/quantumlib/Cirq/commit/",
11-
"pythons": ["3.6", "3.7", "3.8"],
11+
"pythons": ["3.7", "3.8"],
1212
"benchmark_dir": "benchmarks",
1313
"env_dir": ".asv/env",
1414
"results_dir": ".asv/results",

cirq-aqt/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
url='http://github.com/quantumlib/cirq',
6161
author='The Cirq Developers',
6262
author_email='[email protected]',
63-
python_requires=('>=3.6.0'),
63+
python_requires=('>=3.7.0'),
6464
install_requires=requirements,
6565
license='Apache 2',
6666
description=description,

cirq-core/cirq/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@
541541
Condition,
542542
Duration,
543543
DURATION_LIKE,
544-
GenericMetaImplementAnyOneOf,
545544
KeyCondition,
546545
LinearDict,
547546
MEASUREMENT_KEY_SEPARATOR,

cirq-core/cirq/_version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
# limitations under the License.
1414

1515
"""Define version number here, read it from setup.py automatically,
16-
and warn users that the latest version of cirq uses python 3.6+"""
16+
and warn users that the latest version of cirq uses python 3.7+"""
1717

1818
import sys
1919

20-
if sys.version_info < (3, 6, 0):
20+
if sys.version_info < (3, 7, 0):
2121
# coverage: ignore
2222
raise SystemError(
23-
"You installed the latest version of cirq but aren't on python 3.6+.\n"
23+
"You installed the latest version of cirq but aren't on python 3.7+.\n"
2424
'To fix this error, you need to either:\n'
2525
'\n'
26-
'A) Update to python 3.6 or later.\n'
26+
'A) Update to python 3.7 or later.\n'
2727
'- OR -\n'
2828
'B) Explicitly install an older deprecated-but-compatible version '
2929
'of cirq (e.g. "python -m pip install cirq==0.5.*")'

cirq-core/cirq/protocols/json_test_data/spec.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
'Pauli',
130130
'SingleQubitGate',
131131
'ABCMetaImplementAnyOneOf',
132-
'GenericMetaImplementAnyOneOf',
133132
'SimulatesAmplitudes',
134133
'SimulatesExpectationValues',
135134
'SimulatesFinalState',

cirq-core/cirq/sim/simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def simulate_expectation_values_sweep_iter(
452452

453453

454454
class SimulatesFinalState(
455-
Generic[TSimulationTrialResult], metaclass=value.GenericMetaImplementAnyOneOf
455+
Generic[TSimulationTrialResult], metaclass=value.ABCMetaImplementAnyOneOf
456456
):
457457
"""Simulator that allows access to the simulator's final state.
458458

cirq-core/cirq/value/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Value conversion utilities and classes for time and quantum states."""
16-
from cirq.value.abc_alt import ABCMetaImplementAnyOneOf, alternative, GenericMetaImplementAnyOneOf
16+
from cirq.value.abc_alt import ABCMetaImplementAnyOneOf, alternative
1717

1818
from cirq.value.angle import (
1919
canonicalize_half_turns,

cirq-core/cirq/value/abc_alt.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
import functools
1818
from typing import cast, Callable, Set, TypeVar
1919

20-
# Required due to PEP 560
21-
try:
22-
# python 3.6 class for generic metaclasses
23-
from typing import GenericMeta # type: ignore
24-
except ImportError:
25-
# In python 3.7, GenericMeta doesn't exist but we don't need it
26-
class GenericMeta(type): # type: ignore
27-
pass
28-
2920

3021
T = TypeVar('T')
3122

@@ -154,14 +145,3 @@ def impl_of_abstract(*args, **kwargs):
154145
cls.__abstractmethods__ |= abstracts # Add to the set made by ABCMeta
155146
cls._implemented_by_ = implemented_by
156147
return cls
157-
158-
159-
class GenericMetaImplementAnyOneOf(GenericMeta, ABCMetaImplementAnyOneOf):
160-
"""Generic version of ABCMetaImplementAnyOneOf.
161-
162-
Classes which inherit from Generic[T] must use this type instead of
163-
ABCMetaImplementAnyOneOf due to https://github.com/python/typing/issues/449.
164-
165-
This issue is specific to python3.6; this class can be removed when Cirq
166-
python3.6 support is turned down.
167-
"""

cirq-core/requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Runtime requirements for the python 3 version of cirq.
22

3-
# for python 3.6 and below dataclasses needs to be installed
4-
dataclasses; python_version < '3.7'
5-
63
# functools.cached_property was introduced in python 3.8
74
backports.cached_property~=1.0.1; python_version < '3.8'
85

cirq-core/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
url='http://github.com/quantumlib/cirq',
6464
author='The Cirq Developers',
6565
author_email='[email protected]',
66-
python_requires=('>=3.6.0'),
66+
python_requires=('>=3.7.0'),
6767
install_requires=requirements,
6868
extras_require={'contrib': contrib_requirements},
6969
license='Apache 2',

cirq-google/cirq_google/_version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
# limitations under the License.
1414

1515
"""Define version number here, read it from setup.py automatically,
16-
and warn users that the latest version of cirq uses python 3.6+"""
16+
and warn users that the latest version of cirq uses python 3.7+"""
1717

1818
import sys
1919

20-
if sys.version_info < (3, 6, 0):
20+
if sys.version_info < (3, 7, 0):
2121
# coverage: ignore
2222
raise SystemError(
23-
"You installed the latest version of cirq but aren't on python 3.6+.\n"
23+
"You installed the latest version of cirq but aren't on python 3.7+.\n"
2424
'To fix this error, you need to either:\n'
2525
'\n'
26-
'A) Update to python 3.6 or later.\n'
26+
'A) Update to python 3.7 or later.\n'
2727
'- OR -\n'
2828
'B) Explicitly install an older deprecated-but-compatible version '
2929
'of cirq (e.g. "python -m pip install cirq==0.5.*")'

cirq-google/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
url='http://github.com/quantumlib/cirq',
6363
author='The Cirq Developers',
6464
author_email='[email protected]',
65-
python_requires=('>=3.6.0'),
65+
python_requires=('>=3.7.0'),
6666
install_requires=requirements,
6767
license='Apache 2',
6868
description=description,

cirq-ionq/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
url='http://github.com/quantumlib/cirq',
6060
author='The Cirq Developers',
6161
author_email='[email protected]',
62-
python_requires=('>=3.6.0'),
62+
python_requires=('>=3.7.0'),
6363
install_requires=requirements,
6464
license='Apache 2',
6565
description=description,

cirq-pasqal/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
url='http://github.com/quantumlib/cirq',
5959
author='The Cirq Developers',
6060
author_email='[email protected]',
61-
python_requires='>=3.6.0',
61+
python_requires='>=3.7.0',
6262
install_requires=requirements,
6363
license='Apache 2',
6464
description=description,

cirq-web/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
url='http://github.com/quantumlib/cirq',
6363
author='The Cirq Developers',
6464
author_email='[email protected]',
65-
python_requires=('>=3.6.0'),
65+
python_requires=('>=3.7.0'),
6666
install_requires=requirements,
6767
license='Apache 2',
6868
description=description,

dev_tools/modules_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_modules():
3737
'url': 'http://github.com/quantumlib/cirq',
3838
'author': 'The Cirq Developers',
3939
'author_email': '[email protected]',
40-
'python_requires': '>=3.6.0',
40+
'python_requires': '>=3.7.0',
4141
'install_requires': ['req1', 'req2'],
4242
'license': 'Apache 2',
4343
'packages': ['pack1', 'pack1.sub'],

dev_tools/modules_test_data/mod1/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
url='http://github.com/quantumlib/cirq',
2323
author='The Cirq Developers',
2424
author_email='[email protected]',
25-
python_requires=('>=3.6.0'),
25+
python_requires=('>=3.7.0'),
2626
install_requires=requirements,
2727
license='Apache 2',
2828
packages=pack1_packages,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.black]
22
line-length = 100
3-
target_version = ['py36', 'py37', 'py38']
3+
target_version = ['py37', 'py38', 'py39']
44
skip-string-normalization = true
55
skip-magic-trailing-comma = true

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
url='http://github.com/quantumlib/cirq',
6565
author='The Cirq Developers',
6666
author_email='[email protected]',
67-
python_requires='>=3.6.0',
67+
python_requires='>=3.7.0',
6868
install_requires=requirements,
6969
extras_require={'dev_env': dev_requirements},
7070
license='Apache 2',

0 commit comments

Comments
 (0)