]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Drop Python 2.6 / 3.3 support
authorHugo <hugovk@users.noreply.github.com>
Sat, 9 Jun 2018 14:41:43 +0000 (17:41 +0300)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Jun 2018 22:01:51 +0000 (18:01 -0400)
For Alembic 1.0, Python 2.6 / 3.3 support is being dropped, allowing a
fixed setup.py to be built as well as universal wheels.  Pull request
courtesy Hugo.

Change-Id: Iff9018ea6c5a65b3560f7ca72e0ef233c822ec27
Fixes: #491
alembic/testing/mock.py
alembic/testing/plugin/bootstrap.py
alembic/testing/plugin/noseplugin.py
alembic/testing/plugin/plugin_base.py
alembic/testing/plugin/pytestplugin.py
alembic/util/compat.py
docs/build/front.rst
docs/build/unreleased/491.rst [new file with mode: 0644]
setup.py
tests/test_autogen_fks.py

index db8a67313943e8a703b86dc9f30471e39a5e3fd1..08a756cbc27e1fab3cda7021d4cbb7b54f3f0187 100644 (file)
@@ -12,9 +12,9 @@
 
 """
 from __future__ import absolute_import
-from ..util.compat import py33
+from ..util.compat import py3k
 
-if py33:
+if py3k:
     from unittest.mock import MagicMock, Mock, call, patch, ANY
 else:
     try:
index 1560b03dd87d9dcaf1747545a93383afe6e5c0ae..9f42fd2191a662eb1c9c1a0ffe96f2d2bd86d012 100644 (file)
@@ -26,7 +26,7 @@ to_bootstrap = locals()['to_bootstrap']
 
 def load_file_as_module(name):
     path = os.path.join(os.path.dirname(bootstrap_file), "%s.py" % name)
-    if sys.version_info >= (3, 3):
+    if sys.version_info.major >= 3:
         from importlib import machinery
         mod = machinery.SourceFileLoader(name, path).load_module()
     else:
index 1adfccb168bb93be009a7e84af268e1e9f261883..f8894d66689d945bd87ce50d6091b8295cd92c30 100644 (file)
@@ -27,7 +27,7 @@ import sys
 from nose.plugins import Plugin
 fixtures = None
 
-py3k = sys.version_info >= (3, 0)
+py3k = sys.version_info.major >= 3
 
 
 class NoseSQLAlchemy(Plugin):
index 81584230416a5418517a8575d4697d9cfe7c3007..a5c7ee3962720e8f675c27d6de5626612c172dbc 100644 (file)
@@ -28,7 +28,7 @@ except ImportError:
 import sys
 import re
 
-py3k = sys.version_info >= (3, 0)
+py3k = sys.version_info.major >= 3
 
 if py3k:
     import configparser
index 15c7e078897ea59a5a71e02da1c29505eafc321e..4d0f340d5ec635cf069e224b87516d29e8e18613 100644 (file)
@@ -11,7 +11,7 @@ except ImportError:
 
 import sys
 
-py3k = sys.version_info >= (3, 0)
+py3k = sys.version_info.major >= 3
 
 import pytest
 import argparse
index a754f2a8a23cdf6b09caa94cae2a8525c7fb1e3c..b3e0d57ac7b4204b111ec0dc34d6f96389656c5c 100644 (file)
@@ -1,13 +1,12 @@
 import io
 import sys
 
-if sys.version_info < (2, 6):
-    raise NotImplementedError("Python 2.6 or greater is required.")
+if sys.version_info < (2, 7):
+    raise NotImplementedError("Python 2.7 or greater is required.")
 
 py27 = sys.version_info >= (2, 7)
-py2k = sys.version_info < (3, 0)
-py3k = sys.version_info >= (3, 0)
-py33 = sys.version_info >= (3, 3)
+py2k = sys.version_info.major < 3
+py3k = sys.version_info.major >= 3
 py35 = sys.version_info >= (3, 5)
 py36 = sys.version_info >= (3, 6)
 
@@ -89,7 +88,7 @@ if py35:
         spec.loader.exec_module(module)
         return module
 
-elif py33:
+elif py3k:
     import importlib.machinery
 
     def load_module_py(module_id, path):
@@ -104,7 +103,7 @@ elif py33:
         del sys.modules[module_id]
         return module
 
-if py33:
+if py3k:
     def get_bytecode_suffixes():
         try:
             return importlib.machinery.BYTECODE_SUFFIXES
@@ -114,16 +113,11 @@ if py33:
     def get_current_bytecode_suffixes():
         if py35:
             suffixes = importlib.machinery.BYTECODE_SUFFIXES
-        elif py33:
+        else:
             if sys.flags.optimize:
                 suffixes = importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES
             else:
                 suffixes = importlib.machinery.BYTECODE_SUFFIXES
-        else:
-            if sys.flags.optimize:
-                suffixes = [".pyo"]
-            else:
-                suffixes = [".pyc"]
 
         return suffixes
 
index dceb1a4748003842e9962d0ad56cbf02f94a5000..45a15f27763440ff62b2c1f7535693a821a63ab0 100644 (file)
@@ -54,7 +54,9 @@ is installed, in addition to other dependencies.  Alembic will work with
 SQLAlchemy as of version **0.7.3**, however more features are available with
 newer versions such as the 0.9 or 1.0 series.
 
-Alembic supports Python versions 2.6 and above.
+Alembic supports Python versions 2.7, 3.4 and above.
+
+.. versionchanged::  1.0.0  Support for Python 2.6 and 3.3 was dropped.
 
 Community
 =========
diff --git a/docs/build/unreleased/491.rst b/docs/build/unreleased/491.rst
new file mode 100644 (file)
index 0000000..3aed5da
--- /dev/null
@@ -0,0 +1,10 @@
+.. change::
+    :tags: feature, general
+    :tickets: 491
+
+    For Alembic 1.0, Python 2.6 / 3.3 support is being dropped, allowing a
+    fixed setup.py to be built as well as universal wheels.  Pull request
+    courtesy Hugo.
+
+
+
index e424eb034eb784d0b264d01ab3a7cd4c33e838d7..af0c74d2c905dc9ac6c11a4fc9c9634f1f315bb7 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -19,11 +19,6 @@ requires = [
     'python-dateutil'
 ]
 
-try:
-    import argparse
-except ImportError:
-    requires.append('argparse')
-
 
 class PyTest(TestCommand):
     user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
@@ -48,12 +43,18 @@ setup(name='alembic',
       version=VERSION,
       description="A database migration tool for SQLAlchemy.",
       long_description=open(readme).read(),
+      python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
       classifiers=[
           'Development Status :: 4 - Beta',
           'Environment :: Console',
           'Intended Audience :: Developers',
           'Programming Language :: Python',
+          '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 :: Implementation :: CPython',
           'Programming Language :: Python :: Implementation :: PyPy',
           'Topic :: Database :: Front-Ends',
index 569408b7833aefde0c872702dfeae7ce562a6515..0e5f076bf7b4d95623f31c31b2e96509ff0744e4 100644 (file)
@@ -5,7 +5,7 @@ from sqlalchemy import MetaData, Column, Table, Integer, String, \
     ForeignKeyConstraint
 from alembic.testing import eq_
 
-py3k = sys.version_info >= (3, )
+py3k = sys.version_info.major >= 3
 
 from ._autogen_fixtures import AutogenFixtureTest