]> git.phdru.name Git - sqlconvert.git/commitdiff
Build(setup.py): Use python_version marker and python_requires keyword
authorOleg Broytman <phd@phdru.name>
Mon, 11 Dec 2017 14:16:07 +0000 (17:16 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 11 Dec 2017 14:40:27 +0000 (17:40 +0300)
CI: Upgrade pip and setuptools

.travis.yml
appveyor.yml
setup.py

index 550b6d0e397e8515acb768708d3bedcc260993ba..e598ae2c50e8b2cf323347c1b5c64828770ed7f1 100644 (file)
@@ -55,7 +55,7 @@ matrix:
     env: TOXENV=py34-flake8
 
 install:
-  - travis_retry pip install tox ppu
+  - travis_retry pip install --upgrade pip setuptools tox ppu
 
 script:
   - tox
index 2dec36f80d56f8260999a203f35b71d85b952fa6..95e50c0f7de225cedc4830b9ed1d179c2d50068b 100644 (file)
@@ -144,7 +144,7 @@ install:
   - "python --version"
   - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
   - "pip --version"
-  - "pip install tox ppu"
+  - "pip install --upgrade pip setuptools tox ppu"
 
 # No build step - we don't have C extensions
 build: false
index d43442444c1c67f87da474af9e0931cf34dac5ec..2313958a3c5aeedfa455dde0c143c0c19bd69d82 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,5 @@
 #!/usr/bin/env python
 
-import sys
 from imp import load_source
 from os.path import abspath, dirname, join
 
@@ -18,21 +17,15 @@ from sqlconvert_version import __version__  # noqa
 
 kw = {}
 if is_setuptools:
-    if (sys.version_info[:2] == (2, 7)):
-        PY2 = True
-    elif (sys.version_info[0] == 3) and (sys.version_info[:2] >= (3, 4)):
-        PY2 = False
-    else:
-        raise ImportError("sqlconvert requires Python 2.7 or 3.4+")
-
     kw['install_requires'] = [
         'sqlparse',
-        'm_lib.defenc>=1.0', 'm_lib>=3.1',
+        'm_lib>=3.1',
+        'm_lib.defenc>=1.0',
+        'SQLObject>=2.2.1; python_version=="2.7"',
+        'SQLObject>=3.0.0; python_version>="3.4"',
     ]
-    if PY2:
-        kw['install_requires'].append('SQLObject>=2.2.1')
-    else:
-        kw['install_requires'].append('SQLObject>=3.0.0')
+
+    kw['python_requires'] = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'
 
 setup(name='sqlconvert',
       version=__version__,