Skip to content

Commit

Permalink
Drop support for python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Naman Jain committed Nov 4, 2022
1 parent ef2d5b1 commit 8ae96ad
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/bionic-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ jobs:
# version.)
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8]
include:
- python-version: 3.6
shard-id: 0
- python-version: 3.7
shard-id: 1
- python-version: 3.8
Expand Down
7 changes: 3 additions & 4 deletions bionic/code_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@


PREFIX_SEPARATOR = b"$"
# This is gross but types.MethodWrapperType was introduced in Python 3.7
# and does not exist in 3.6 which Bionic supports.
METHOD_WRAPPER_TYPE = type("".__str__)


class CodeHasher:
Expand Down Expand Up @@ -290,7 +287,9 @@ def _update_hash(self, hash_accumulator, obj, code_context):
obj_bytes=self._check_and_hash(builtin_name, code_context),
)

elif inspect.ismethoddescriptor(obj) or isinstance(obj, METHOD_WRAPPER_TYPE):
elif inspect.ismethoddescriptor(obj) or isinstance(
obj, types.MethodWrapperType
):
if inspect.ismethoddescriptor(obj):
type_prefix = TypePrefix.METHOD_DESCRIPTOR
else:
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ performance for some workloads. LibYAML is also available via Homebrew:
brew install libyaml
Bionic supports Python 3.6 and above.
Bionic supports Python 3.7 and above.

.. _extra-packages:

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
include_package_data=True,
install_requires=requirements,
extras_require=extras_require,
python_requires=">=3.6",
python_requires=">=3.7",
zip_safe=False,
keywords="bionic",
classifiers=[
Expand All @@ -52,6 +52,6 @@
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
)
11 changes: 1 addition & 10 deletions tests/test_flow/test_persistence_compatibility.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
import shutil
import sys

from .generate_test_compatibility_cache import Harness, CACHE_TEST_DIR

Expand All @@ -26,15 +25,7 @@ def older_serialized_cache_harness(make_counter, tmp_path):
# To renegerate cache, run the following command from bionic/ dir
# `python -m tests.test_flow.generate_test_compatibility_cache`
def test_caching_compatibility(older_serialized_cache_harness):
# The auto-versioned flow generates different bytecode hashes on Python 3.6
# compared to 3.7 and 3.8 This is because Python 3.7 added new
# bytecode instructions like LOAD_METHOD and uses them widely.
# We skip the auto-versioned flow for Python 3.6 and only test it on
# Python 3.7+.
if sys.version_info < (3, 7):
flows = [older_serialized_cache_harness.manual_flow]
else:
flows = older_serialized_cache_harness.flows
flows = older_serialized_cache_harness.flows

for flow in flows:
assert (
Expand Down

0 comments on commit 8ae96ad

Please sign in to comment.