From: Federico Caselli Date: Thu, 8 Oct 2020 19:01:19 +0000 (+0200) Subject: Drop python 3.5 support X-Git-Tag: rel_1_4_0b1~42^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b3812a0c646ee14a6f102e6dc87298d5c255cec;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Drop python 3.5 support Fixes: #5634 Change-Id: Ie8d4076ee35234b535a04e6fb9321096df3f648b --- diff --git a/.github/workflows/create-wheels.yaml b/.github/workflows/create-wheels.yaml index 8c2d7ee604..673081fca8 100644 --- a/.github/workflows/create-wheels.yaml +++ b/.github/workflows/create-wheels.yaml @@ -24,7 +24,6 @@ jobs: - "macos-latest" python-version: - "2.7" - - "3.5" - "3.6" - "3.7" - "3.8" @@ -83,10 +82,9 @@ jobs: pip install -f dist --no-index sqlalchemy - name: Check c extensions - # on windows in python 2.7 and 3.5 the cextension fail to build. + # on windows in python 2.7 the cextension fail to build. # for python 2.7 visual studio 9 is missing - # for python 3.5 the linker has an error "cannot run 'rc.exe'" - if: matrix.os != 'windows-latest' || ( matrix.python-version != '2.7' && matrix.python-version != '3.5' ) + if: matrix.os != 'windows-latest' || matrix.python-version != '2.7' run: | python -c 'from sqlalchemy import cprocessors, cresultproxy, cutils' @@ -145,7 +143,6 @@ jobs: # the versions are - as specified in PEP 425. - cp27-cp27m - cp27-cp27mu - - cp35-cp35m - cp36-cp36m - cp37-cp37m - cp38-cp38 @@ -294,7 +291,6 @@ jobs: - "ubuntu-latest" python-version: # the versions are - as specified in PEP 425. - - cp35-cp35m - cp36-cp36m - cp37-cp37m - cp38-cp38 diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 79f2a60860..7b32950f0e 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -29,7 +29,6 @@ jobs: - "macos-latest" python-version: - "2.7" - - "3.5" - "3.6" - "3.7" - "3.8" @@ -47,13 +46,10 @@ jobs: pytest-args: "-k 'not test_autocommit_on and not test_turn_autocommit_off_via_default_iso_level and not test_autocommit_isolation_level'" exclude: - # c-extensions fail to build on windows for python 3.5 and 2.7 + # c-extensions fail to build on windows for python 2.7 - os: "windows-latest" python-version: "2.7" build-type: "cext" - - os: "windows-latest" - python-version: "3.5" - build-type: "cext" # linux and osx do not have x86 python - os: "ubuntu-latest" architecture: x86 @@ -94,7 +90,6 @@ jobs: strategy: matrix: python-version: - - cp35-cp35m - cp36-cp36m - cp37-cp37m - cp38-cp38 diff --git a/doc/build/changelog/unreleased_14/5634.rst b/doc/build/changelog/unreleased_14/5634.rst new file mode 100644 index 0000000000..44e866e89f --- /dev/null +++ b/doc/build/changelog/unreleased_14/5634.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: change + :tickets: 5634 + + Dropped support for python 3.5 that has reached EOL. + SQLAlchemy 1.4 series requires python 2.7 or 3.6+. diff --git a/doc/build/intro.rst b/doc/build/intro.rst index 4b9376ab0f..2beec697e6 100644 --- a/doc/build/intro.rst +++ b/doc/build/intro.rst @@ -71,14 +71,14 @@ Supported Platforms SQLAlchemy has been tested against the following platforms: * cPython 2.7 -* cPython 3.5 and higher +* cPython 3.6 and higher * `PyPy `_ 2.1 or greater .. versionchanged:: 1.2 Python 2.7 is now the minimum Python version supported. .. versionchanged:: 1.4 - Within the Python 3 series, 3.5 is now the minimum Python 3 version supported. + Within the Python 3 series, 3.6 is now the minimum Python 3 version supported. Supported Installation Methods ------------------------------- diff --git a/lib/sqlalchemy/dialects/postgresql/__init__.py b/lib/sqlalchemy/dialects/postgresql/__init__.py index 92abcd124a..2762a9971b 100644 --- a/lib/sqlalchemy/dialects/postgresql/__init__.py +++ b/lib/sqlalchemy/dialects/postgresql/__init__.py @@ -59,7 +59,7 @@ from .ranges import TSRANGE from .ranges import TSTZRANGE from ...util import compat -if compat.py36: +if compat.py3k: from . import asyncpg # noqa base.dialect = dialect = psycopg2.dialect diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py index 586974f11b..c52dc4a19b 100644 --- a/lib/sqlalchemy/testing/util.py +++ b/lib/sqlalchemy/testing/util.py @@ -17,7 +17,6 @@ from ..util import defaultdict from ..util import has_refcount_gc from ..util import inspect_getfullargspec from ..util import py2k -from ..util import py36 if not has_refcount_gc: @@ -54,7 +53,7 @@ def picklers(): yield pickle_.loads, lambda d: pickle_.dumps(d, protocol) -if py2k or not py36: +if py2k: def random_choices(population, k=1): pop = list(population) diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py index 8ef2f01032..69cdce216e 100644 --- a/lib/sqlalchemy/util/__init__.py +++ b/lib/sqlalchemy/util/__init__.py @@ -72,7 +72,6 @@ from .compat import perf_counter # noqa from .compat import pickle # noqa from .compat import print_ # noqa from .compat import py2k # noqa -from .compat import py36 # noqa from .compat import py37 # noqa from .compat import py3k # noqa from .compat import pypy # noqa diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py index d3fefa5265..1480bbeee3 100644 --- a/lib/sqlalchemy/util/compat.py +++ b/lib/sqlalchemy/util/compat.py @@ -17,7 +17,6 @@ import sys py38 = sys.version_info >= (3, 8) py37 = sys.version_info >= (3, 7) -py36 = sys.version_info >= (3, 6) py3k = sys.version_info >= (3, 0) py2k = sys.version_info < (3, 0) pypy = platform.python_implementation() == "PyPy" diff --git a/pyproject.toml b/pyproject.toml index 276edcf74b..0f72578923 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [tool.black] line-length = 79 -target-version = ['py27', 'py35'] +target-version = ['py27', 'py36'] diff --git a/setup.cfg b/setup.cfg index cb8e6930ed..c8767d310d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,6 @@ classifiers = Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 @@ -34,7 +33,7 @@ project_urls = [options] packages = find: -python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* +python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* package_dir = =lib install_requires = diff --git a/test/base/test_utils.py b/test/base/test_utils.py index fa347243e7..8921be8d00 100644 --- a/test/base/test_utils.py +++ b/test/base/test_utils.py @@ -1674,12 +1674,10 @@ class IdentitySetTest(fixtures.TestBase): return super_, sub_, twin1, twin2, unique1, unique2 def _assert_unorderable_types(self, callable_): - if util.py36: + if util.py3k: assert_raises_message( TypeError, "not supported between instances of", callable_ ) - elif util.py3k: - assert_raises_message(TypeError, "unorderable types", callable_) else: assert_raises_message( TypeError, "cannot compare sets using cmp()", callable_ @@ -3165,8 +3163,6 @@ class TimezoneTest(fixtures.TestBase): ), ) def test_tzname(self, td, expected): - if expected == "UTC" and util.py3k and not util.py36: - expected += "+00:00" eq_(timezone(td).tzname(None), expected) def test_utcoffset(self): diff --git a/test/orm/test_unitofwork.py b/test/orm/test_unitofwork.py index ee76d7a247..dcd9219a43 100644 --- a/test/orm/test_unitofwork.py +++ b/test/orm/test_unitofwork.py @@ -3505,19 +3505,12 @@ class EnsurePKSortableTest(fixtures.MappedTest): a.data = "bar" b.data = "foo" if sa.util.py3k: - if sa.util.py36: - message = ( - r"Could not sort objects by primary key; primary key " - r"values must be sortable in Python \(was: '<' not " - r"supported between instances of 'MyNotSortableEnum'" - r" and 'MyNotSortableEnum'\)" - ) - else: - message = ( - r"Could not sort objects by primary key; primary key " - r"values must be sortable in Python \(was: unorderable " - r"types: MyNotSortableEnum\(\) < MyNotSortableEnum\(\)\)" - ) + message = ( + r"Could not sort objects by primary key; primary key " + r"values must be sortable in Python \(was: '<' not " + r"supported between instances of 'MyNotSortableEnum'" + r" and 'MyNotSortableEnum'\)" + ) assert_raises_message( sa.exc.InvalidRequestError,