]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Remove support for python 3.4
authorFederico Caselli <cfederico87@gmail.com>
Sun, 29 Mar 2020 18:57:08 +0000 (20:57 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sun, 29 Mar 2020 22:35:33 +0000 (00:35 +0200)
Also remove no longer used compat code

Change-Id: Ifda239fd84b425e43f4028cb55a5b3b8efa4dfc6

doc/build/changelog/migration_14.rst
doc/build/changelog/unreleased_14/drop_python34.rst [new file with mode: 0644]
doc/build/intro.rst
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/testing/mock.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/compat.py
setup.py
test/ext/declarative/test_basic.py
test/orm/test_mapper.py
test/sql/test_metadata.py

index e7ee2a7b2132b117eabc683c23203d19cdbba895..72cd996fb890ac7a80f91daf8a2704e15a93919b 100644 (file)
@@ -1508,7 +1508,7 @@ join rewriting logic would only occur for SQLite verisons prior to 3.7.16 after
 bisection was used to  identify where SQLite fixed its support for this
 construct, and no further issues were reported against the behavior (even
 though some bugs were found internally).    It is now anticipated that there
-are little to no Python builds for Python 2.7 or 3.4 and above (the supported
+are little to no Python builds for Python 2.7 or 3.5 and above (the supported
 Python versions) which would include a SQLite version prior to 3.7.17, and
 the behavior is only necessary only in more complex ORM joining scenarios.
 A warning is now emitted if the installed SQLite version is older than
diff --git a/doc/build/changelog/unreleased_14/drop_python34.rst b/doc/build/changelog/unreleased_14/drop_python34.rst
new file mode 100644 (file)
index 0000000..6956393
--- /dev/null
@@ -0,0 +1,5 @@
+.. change::
+    :tags: change
+
+    Python 3.4 has reached EOL and its support has been dropped from
+    SQLAlchemy.
index f31206bde1f4c535120188d32d5516492398b588..828ba31b318c77b429dc60139198005a100133d8 100644 (file)
@@ -71,14 +71,14 @@ Supported Platforms
 SQLAlchemy has been tested against the following platforms:
 
 * cPython 2.7
-* cPython 3.4 and higher
+* cPython 3.5 and higher
 * `PyPy <http://pypy.org/>`_ 2.1 or greater
 
 .. versionchanged:: 1.2
    Python 2.7 is now the minimum Python version supported.
 
-.. versionchanged:: 1.3
-   Within the Python 3 series, 3.4 is now the minimum Python 3 version supported.
+.. versionchanged:: 1.4
+   Within the Python 3 series, 3.5 is now the minimum Python 3 version supported.
 
 Supported Installation Methods
 -------------------------------
index f093cad9093ee0a96dce095fcd7b960244882400..682ef891cb59dc866d40f8707c6a3282c7902324 100644 (file)
@@ -192,7 +192,7 @@ class _DialectArgView(util.collections_abc.MutableMapping):
 
     def __iter__(self):
         return (
-            util.safe_kwarg("%s_%s" % (dialect_name, value_name))
+            "%s_%s" % (dialect_name, value_name)
             for dialect_name in self.obj.dialect_options
             for value_name in self.obj.dialect_options[
                 dialect_name
index 16c2d2ac925b5d393fca69b66f7b9f22698fc8c7..a63082b9b2a98d96ad2a92d250230e514e24290c 100644 (file)
@@ -9,10 +9,10 @@
 """
 from __future__ import absolute_import
 
-from ..util import py33
+from ..util import py3k
 
 
-if py33:
+if py3k:
     from unittest.mock import MagicMock
     from unittest.mock import Mock
     from unittest.mock import call
index 1909619c59bb86263b6dbc142615c651bda75ade..c0e290cb0e65f403582623addc35ab0d378da17c 100644 (file)
@@ -63,7 +63,6 @@ from .compat import parse_qsl  # noqa
 from .compat import pickle  # noqa
 from .compat import print_  # noqa
 from .compat import py2k  # noqa
-from .compat import py33  # noqa
 from .compat import py36  # noqa
 from .compat import py3k  # noqa
 from .compat import quote_plus  # noqa
@@ -71,7 +70,6 @@ from .compat import raise_  # noqa
 from .compat import raise_from_cause  # noqa
 from .compat import reduce  # noqa
 from .compat import reraise  # noqa
-from .compat import safe_kwarg  # noqa
 from .compat import string_types  # noqa
 from .compat import StringIO  # noqa
 from .compat import text_type  # noqa
index 31654b97c8b2c07c0c83717bd845fd5beb8d53cc..79de3c9783930ff49a55ff164a05055776c966c2 100644 (file)
@@ -16,12 +16,8 @@ import sys
 
 
 py36 = sys.version_info >= (3, 6)
-py33 = sys.version_info >= (3, 3)
-py35 = sys.version_info >= (3, 5)
-py32 = sys.version_info >= (3, 2)
 py3k = sys.version_info >= (3, 0)
 py2k = sys.version_info < (3, 0)
-py265 = sys.version_info >= (2, 6, 5)
 
 
 cpython = platform.python_implementation() == "CPython"
@@ -53,13 +49,6 @@ except ImportError:
     import dummy_threading as threading  # noqa
 
 
-# work around http://bugs.python.org/issue2646
-if py265:
-    safe_kwarg = lambda arg: arg  # noqa
-else:
-    safe_kwarg = str
-
-
 def inspect_getfullargspec(func):
     """Fully vendored version of getfullargspec from Python 3.3."""
 
@@ -298,7 +287,7 @@ else:
     TYPE_CHECKING = False
 
 
-if py35:
+if py3k:
 
     def _formatannotation(annotation, base_module=None):
         """vendored from python 3.7
@@ -378,7 +367,7 @@ if py35:
         return result
 
 
-elif py2k:
+else:
     from inspect import formatargspec as _inspect_formatargspec
 
     def inspect_formatargspec(*spec, **kw):
@@ -386,13 +375,9 @@ elif py2k:
         return _inspect_formatargspec(*spec[0:4], **kw)  # noqa
 
 
-else:
-    from inspect import formatargspec as inspect_formatargspec  # noqa
-
-
 # Fix deprecation of accessing ABCs straight from collections module
 # (which will stop working in 3.8).
-if py33:
+if py3k:
     import collections.abc as collections_abc
 else:
     import collections as collections_abc  # noqa
index e77c617b421c613843988fad8c98a616eaba3512..3b175c9353420770e4398dea138724e23d130804 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -157,7 +157,7 @@ def run_setup(with_cext):
         license="MIT",
         cmdclass=cmdclass,
         long_description=readme,
-        python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
+        python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
         classifiers=[
             "Development Status :: 5 - Production/Stable",
             "Intended Audience :: Developers",
@@ -166,7 +166,6 @@ def run_setup(with_cext):
             "Programming Language :: Python :: 2",
             "Programming Language :: Python :: 2.7",
             "Programming Language :: Python :: 3",
-            "Programming Language :: Python :: 3.4",
             "Programming Language :: Python :: 3.5",
             "Programming Language :: Python :: 3.6",
             "Programming Language :: Python :: 3.7",
index d81b99ccd5a9339f7e8ca48bba9c9fe74b1da7d0..cb70b59f1260badfead541d22b0b9a5fad9ba687 100644 (file)
@@ -1006,7 +1006,7 @@ class DeclarativeTest(DeclarativeTestBase):
         try:
             hasattr(User.addresses, "property")
         except exc.InvalidRequestError:
-            assert sa.util.compat.py32
+            assert sa.util.compat.py3k
 
         # the exception is preserved.  Remains the
         # same through repeated calls.
index 99e7358e5ae5d1c09f544e3a0c2d8cf465d1d930..e4ba50f13eaf26759bd17bea071ca6adf57a94c4 100644 (file)
@@ -182,7 +182,7 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
         try:
             hasattr(Address.user, "property")
         except sa.orm.exc.UnmappedClassError:
-            assert util.compat.py32
+            assert util.compat.py3k
 
         for i in range(3):
             assert_raises_message(
index 8ef272a9ef13babdc954e2217208c6444bffb6ad..afe5bdb593ac60921a2d2f6d7181731f58fd35f5 100644 (file)
@@ -29,7 +29,6 @@ from sqlalchemy import TypeDecorator
 from sqlalchemy import types as sqltypes
 from sqlalchemy import Unicode
 from sqlalchemy import UniqueConstraint
-from sqlalchemy import util
 from sqlalchemy.engine import default
 from sqlalchemy.schema import AddConstraint
 from sqlalchemy.schema import CreateIndex
@@ -4164,17 +4163,6 @@ class DialectKWArgTest(fixtures.TestBase):
                 },
             )  # still populates
 
-    def test_runs_safekwarg(self):
-
-        with mock.patch(
-            "sqlalchemy.util.safe_kwarg", lambda arg: "goofy_%s" % arg
-        ):
-            with self._fixture():
-                idx = Index("a", "b")
-                idx.kwargs[util.u("participating_x")] = 7
-
-                eq_(list(idx.dialect_kwargs), ["goofy_participating_x"])
-
     def test_combined(self):
         with self._fixture():
             idx = Index(