Skip to content

Commit 0fa724f

Browse files
authored
Re-enable support for Python 2.7 and Python 3.5 (#509)
1 parent 2a45d27 commit 0fa724f

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

requirements-dev.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
applicationinsights >= 0.11.1
2-
enum34 >= 1.1.6
2+
enum34 >= 1.1.6 ; python_version < '3.4'
33
future >= 0.16.0
44
setuptools >= 36.0.1
55
wheel >= 0.29.0
@@ -16,10 +16,12 @@ docutils >= 0.13.1
1616
azure-storage == 0.36.0
1717
click >= 4.1, < 7.1
1818
Pygments >= 2.0
19-
prompt_toolkit >= 2.0.6 , < 4.0.0
19+
prompt_toolkit >= 2.0.6 , < 4.0.0 ; python_version > '2.7'
20+
prompt_toolkit >= 2.0.6 , < 3.0.0 ; python_version <= '2.7'
2021
sqlparse >= 0.3.0,<0.5
2122
configobj >= 5.0.6
2223
humanize >= 0.5.1
23-
cli_helpers[styles] >= 2.0.0
24-
mock>=1.0.1
24+
cli_helpers[styles] >= 2.0.0 ; python_version > '2.7'
25+
cli_helpers < 1.2.0 ; python_version <= '2.7'
26+
mock>=1.0.1
2527
polib>=1.1.0

setup.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ def get_timestamped_version(ver):
2929
install_requirements = [
3030
'click >= 4.1,<7.1',
3131
'Pygments >= 2.0', # Pygments has to be Capitalcased.
32-
'prompt_toolkit>=2.0.6,<4.0.0',
32+
'prompt_toolkit>=2.0.6,<4.0.0;python_version>"2.7"',
33+
'prompt_toolkit>=2.0.6,<3.0.0;python_version<="2.7"',
3334
'sqlparse >=0.3.0,<0.5',
3435
'configobj >= 5.0.6',
3536
'humanize >= 0.5.1',
36-
'cli_helpers[styles] >= 2.0.0',
37+
'cli_helpers[styles] >= 2.0.0;python_version>"2.7"',
38+
'cli_helpers < 1.2.0;python_version<="2.7"',
3739
'applicationinsights>=0.11.1',
3840
'future>=0.16.0',
3941
'wheel>=0.29.0',
40-
'enum34>=1.1.6'
42+
'enum34>=1.1.6;python_version<"3.4"'
4143
]
4244

4345
with open("README.md", "r") as fh:
@@ -59,7 +61,6 @@ def get_timestamped_version(ver):
5961
long_description_content_type='text/markdown',
6062
install_requires=install_requirements,
6163
include_package_data=True,
62-
python_requires=">=3.6",
6364
scripts=[
6465
'mssql-cli.bat',
6566
'mssql-cli'
@@ -69,7 +70,9 @@ def get_timestamped_version(ver):
6970
'License :: OSI Approved :: BSD License',
7071
'Operating System :: Unix',
7172
'Programming Language :: Python',
73+
'Programming Language :: Python :: 2.7',
7274
'Programming Language :: Python :: 3',
75+
'Programming Language :: Python :: 3.5',
7376
'Programming Language :: Python :: 3.6',
7477
'Programming Language :: Python :: 3.7',
7578
'Programming Language :: Python :: 3.8',

tests/mssqltestutils.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from datetime import datetime, timedelta
22
import os
33
import socket
4+
import sys
45
import time
56
from argparse import Namespace
67
import mssqlcli.sqltoolsclient as sqltoolsclient
@@ -17,10 +18,13 @@
1718
test_queries = [
1819
("SELECT 1", 'small.txt'),
1920
("SELECT 1; SELECT 2;", 'multiple.txt'),
20-
("SELECT %s" % ('x' * 250), 'col_too_wide.txt'),
21-
("SELECT REPLICATE(CAST('X,' AS VARCHAR(MAX)), 1024)", 'col_wide.txt')
21+
("SELECT %s" % ('x' * 250), 'col_too_wide.txt')
2222
]
2323

24+
# Ignore python 2.X which has a different baseline
25+
if (sys.version_info > (3, 0)):
26+
test_queries.append(("SELECT REPLICATE(CAST('X,' AS VARCHAR(MAX)), 1024)", 'col_wide.txt'))
27+
2428
def create_mssql_cli(**non_default_options):
2529
mssqlcli_options = create_mssql_cli_options(**non_default_options)
2630
mssql_cli = MssqlCli(mssqlcli_options)

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36,py37,py38,py39
2+
envlist = py27,py35,py36,py37,py38,py39
33
# We will build the sdist ourselves as we need to detect
44
# what platform we are on and install the generated wheel
55
# locally.

0 commit comments

Comments
 (0)