Skip to content

Commit 9779a2b

Browse files
author
Carl Sverre
authored
Removing Python 2 support and updating dependencies (#17)
* Remove python 2 support * Updating mysqlclient dependency * Remove SQL Lock * Remove SQL Utility * Remove SQL Step Queue
1 parent aac223a commit 9779a2b

15 files changed

+20
-1288
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
sudo: false
21
language: python
3-
python:
4-
- "2.7"
5-
- "3.4"
6-
- "3.5"
7-
- "3.6"
82
install: pip install .
93
script: python setup.py test
104
services: mysql
5+
python:
6+
- "3.4"
7+
- "3.5"
8+
- "3.6"
9+
- "3.7"
10+
dist: xenial

default.nix

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
11
with import <nixpkgs> {}; {
2-
memsqlPython2Env = stdenv.mkDerivation {
3-
name = "memsql-python-env";
4-
buildInputs = with python27Packages; [
5-
python27Full
6-
python27Packages.virtualenv
7-
python27Packages.twine
8-
mysql55
9-
zlib
10-
openssl
11-
];
12-
shellHook = ''
13-
[ -d venv2 ] || virtualenv venv2
14-
source venv2/bin/activate
15-
pip list --format freeze | grep MySQL-python==1.2.5 >/dev/null || pip install MySQL-python==1.2.5
16-
'';
17-
};
18-
19-
memsqlPython3Env = stdenv.mkDerivation {
2+
memsqlPython = stdenv.mkDerivation {
203
name = "memsql-python-env";
214
buildInputs = with python36Packages; [
225
python36Full
236
python36Packages.virtualenv
247
python36Packages.twine
25-
mysql55
8+
mysql57
269
zlib
2710
openssl
2811
];

memsql/common/database.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
import _mysql
44
import time
55
import operator
6-
import six
76

87
try:
98
from _thread import get_ident as _get_ident
109
except ImportError:
1110
from thread import get_ident as _get_ident
1211

13-
if six.PY3:
14-
from memsql.common.conversions import CONVERSIONS
15-
else:
16-
from MySQLdb.converters import conversions as CONVERSIONS
12+
from memsql.common.conversions import CONVERSIONS
1713

1814
MySQLError = _mysql.MySQLError
1915
OperationalError = _mysql.OperationalError
@@ -302,16 +298,10 @@ def escape_query(query, parameters):
302298
else:
303299
assert False, 'not sure what to do with parameters of type %s' % type(parameters)
304300

305-
return _escape_unicode(query)
306-
307-
def _escape_unicode(param):
308-
if not six.PY3 and isinstance(param, unicode):
309-
return param.encode('utf-8')
310-
return param
301+
return query
311302

312303
def _escape(param):
313304
if isinstance(param, (list, tuple)):
314-
param = [_escape_unicode(p) for p in param]
315-
return ','.join(_mysql.escape_sequence(param, CONVERSIONS))
305+
return ','.join(_mysql.escape(p, CONVERSIONS) for p in param)
316306
else:
317-
return _mysql.escape(_escape_unicode(param), CONVERSIONS)
307+
return _mysql.escape(param, CONVERSIONS)

memsql/common/sql_lock.py

Lines changed: 0 additions & 123 deletions
This file was deleted.

memsql/common/sql_step_queue/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

memsql/common/sql_step_queue/errors.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)