Skip to content

Commit c79e6fe

Browse files
authored
Release 0.1.15 (#21)
* changelog * bump version * run on undeprecated pythons * use latest dev dependencies * yield_fixture no longer required * no longer need 'U' flag when opening files * update mock imports * note about python versions in changelog
1 parent 7b7abc9 commit c79e6fe

File tree

8 files changed

+54
-53
lines changed

8 files changed

+54
-53
lines changed

.travis.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ install:
1010
matrix:
1111
include:
1212
- stage: test
13-
python: 2.7
14-
env: TOX_ENV=py27
15-
- stage: test
16-
python: 3.3
17-
env: TOX_ENV=py33
13+
python: 3.6
14+
env: TOX_ENV=py36
1815
- stage: test
19-
python: 3.4
20-
env: TOX_ENV=py34
16+
python: 3.7
17+
env: TOX_ENV=py37
2118
- stage: test
22-
python: 3.5
23-
env: TOX_ENV=py35
19+
python: 3.8
20+
env: TOX_ENV=py38
2421
- stage: test
25-
python: 3.6
26-
env: TOX_ENV=py36
22+
python: 3.9
23+
env: TOX_ENV=py39
2724
- stage: deploy
2825
script: skip
2926
deploy:

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 0.1.5
2+
-------------
3+
4+
* Drop support for deprecated Python versions
5+
* Support for comparing Enum types (#11, thanks @charness)
6+
* Support for comparing Primary Key constraint names (#12, thanks @erikced)
7+
8+
(Sorry it took three years :-/)
9+
110
Version 0.1.4
211
-------------
312

setup.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,23 @@
1313

1414
setup(
1515
name='sqlalchemy-diff',
16-
version='0.1.4',
16+
version='0.1.5',
1717
description='Compare two database schemas using sqlalchemy.',
1818
long_description=readme,
1919
author='student.com',
2020
author_email='[email protected]',
2121
url='https://github.com/gianchub/sqlalchemy-diff',
2222
packages=find_packages(exclude=['docs', 'test', 'test.*']),
2323
install_requires=[
24-
"six>=1.10.0",
2524
"sqlalchemy-utils>=0.32.4",
2625
],
2726
extras_require={
2827
'dev': [
29-
"mock==2.0.0",
3028
"mysql-connector-python-rf==2.2.2",
31-
"pytest==3.0.3",
32-
"pylint==1.5.1",
33-
"flake8==3.0.4",
34-
"coverage==4.2",
29+
"pytest==6.2.2",
30+
"pylint==2.7.2",
31+
"flake8==3.8.4",
32+
"coverage==5.5",
3533
],
3634
'docs': [
3735
"sphinx==1.4.1",
@@ -43,13 +41,11 @@
4341
"Programming Language :: Python",
4442
"Operating System :: POSIX",
4543
"Operating System :: MacOS :: MacOS X",
46-
"Programming Language :: Python :: 2",
47-
"Programming Language :: Python :: 2.7",
4844
"Programming Language :: Python :: 3",
49-
"Programming Language :: Python :: 3.3",
50-
"Programming Language :: Python :: 3.4",
51-
"Programming Language :: Python :: 3.5",
5245
"Programming Language :: Python :: 3.6",
46+
"Programming Language :: Python :: 3.7",
47+
"Programming Language :: Python :: 3.8",
48+
"Programming Language :: Python :: 3.9",
5349
"Topic :: Internet",
5450
"Topic :: Software Development :: Libraries :: Python Modules",
5551
"Intended Audience :: Developers",

sqlalchemydiff/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from uuid import uuid4
44
import json
55

6-
import six
76
from sqlalchemy import inspect, create_engine
87
from sqlalchemy_utils import create_database, drop_database, database_exists
98

@@ -138,7 +137,7 @@ def is_table_name(self, data):
138137
return data.count(self.separator) == 0
139138

140139
def validate_type(self, data):
141-
if not isinstance(data, six.string_types):
140+
if not isinstance(data, str):
142141
raise TypeError('{} is not a string'.format(data))
143142

144143
def validate_clause(self, data):

test/endtoend/test_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def uri_right(db_uri):
2727
return get_temporary_uri(db_uri)
2828

2929

30-
@pytest.yield_fixture
30+
@pytest.fixture
3131
def new_db_left(uri_left):
3232
new_db(uri_left)
3333
yield
3434
destroy_database(uri_left)
3535

3636

37-
@pytest.yield_fixture
37+
@pytest.fixture
3838
def new_db_right(uri_right):
3939
new_db(uri_right)
4040
yield

test/unit/test_comparer.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
import pytest
33

4-
from mock import Mock, patch, call
4+
from unittest.mock import Mock, patch, call
55

66
from sqlalchemydiff.comparer import (
77
_compile_errors,
@@ -35,7 +35,7 @@
3535
from test import assert_items_equal
3636

3737

38-
@pytest.yield_fixture
38+
@pytest.fixture
3939
def mock_inspector_factory():
4040
with patch.object(InspectorFactory, 'from_uri') as from_uri:
4141
from_uri.side_effect = [
@@ -50,7 +50,7 @@ class TestCompareCallsChain(object):
5050
"""This test class makes sure the `compare` function inside process
5151
works as expected.
5252
"""
53-
@pytest.yield_fixture
53+
@pytest.fixture
5454
def _get_inspectors_mock(self):
5555
with patch('sqlalchemydiff.comparer._get_inspectors') as m:
5656
m.return_value = [
@@ -59,12 +59,12 @@ def _get_inspectors_mock(self):
5959
]
6060
yield m
6161

62-
@pytest.yield_fixture
62+
@pytest.fixture
6363
def _get_tables_data_mock(self):
6464
with patch('sqlalchemydiff.comparer._get_tables_data') as m:
6565
yield m
6666

67-
@pytest.yield_fixture
67+
@pytest.fixture
6868
def _compile_errors_mock(self):
6969
with patch('sqlalchemydiff.comparer._compile_errors') as m:
7070

@@ -81,7 +81,7 @@ def info_side_effect(info):
8181
m.side_effect = info_side_effect
8282
yield m
8383

84-
@pytest.yield_fixture
84+
@pytest.fixture
8585
def _get_tables_info_mock(self):
8686
with patch('sqlalchemydiff.comparer._get_tables_info') as m:
8787
m.return_value = TablesInfo(
@@ -93,7 +93,7 @@ def _get_tables_info_mock(self):
9393
)
9494
yield m
9595

96-
@pytest.yield_fixture
96+
@pytest.fixture
9797
def _get_enums_data_mock(self):
9898
with patch('sqlalchemydiff.comparer._get_enums_data') as m:
9999
m.return_value = []
@@ -172,67 +172,67 @@ class TestCompareInternals(object):
172172

173173
# FIXTURES
174174

175-
@pytest.yield_fixture
175+
@pytest.fixture
176176
def _get_table_data_mock(self):
177177
with patch('sqlalchemydiff.comparer._get_table_data') as m:
178178
yield m
179179

180-
@pytest.yield_fixture
180+
@pytest.fixture
181181
def _diff_dicts_mock(self):
182182
with patch('sqlalchemydiff.comparer._diff_dicts') as m:
183183
yield m
184184

185-
@pytest.yield_fixture
185+
@pytest.fixture
186186
def _get_foreign_keys_mock(self):
187187
with patch('sqlalchemydiff.comparer._get_foreign_keys') as m:
188188
yield m
189189

190-
@pytest.yield_fixture
190+
@pytest.fixture
191191
def _get_primary_keys_mock(self):
192192
with patch('sqlalchemydiff.comparer._get_primary_keys') as m:
193193
yield m
194194

195-
@pytest.yield_fixture
195+
@pytest.fixture
196196
def _get_indexes_mock(self):
197197
with patch('sqlalchemydiff.comparer._get_indexes') as m:
198198
yield m
199199

200-
@pytest.yield_fixture
200+
@pytest.fixture
201201
def _get_columns_mock(self):
202202
with patch('sqlalchemydiff.comparer._get_columns') as m:
203203
yield m
204204

205-
@pytest.yield_fixture
205+
@pytest.fixture
206206
def _process_types_mock(self):
207207
with patch('sqlalchemydiff.comparer._process_types') as m:
208208
yield m
209209

210-
@pytest.yield_fixture
210+
@pytest.fixture
211211
def _process_type_mock(self):
212212
with patch('sqlalchemydiff.comparer._process_type') as m:
213213
yield m
214214

215-
@pytest.yield_fixture
215+
@pytest.fixture
216216
def _get_foreign_keys_info_mock(self):
217217
with patch('sqlalchemydiff.comparer._get_foreign_keys_info') as m:
218218
yield m
219219

220-
@pytest.yield_fixture
220+
@pytest.fixture
221221
def _get_primary_keys_info_mock(self):
222222
with patch('sqlalchemydiff.comparer._get_primary_keys_info') as m:
223223
yield m
224224

225-
@pytest.yield_fixture
225+
@pytest.fixture
226226
def _get_indexes_info_mock(self):
227227
with patch('sqlalchemydiff.comparer._get_indexes_info') as m:
228228
yield m
229229

230-
@pytest.yield_fixture
230+
@pytest.fixture
231231
def _get_columns_info_mock(self):
232232
with patch('sqlalchemydiff.comparer._get_columns_info') as m:
233233
yield m
234234

235-
@pytest.yield_fixture
235+
@pytest.fixture
236236
def _get_constraints_info_mock(self):
237237
with patch('sqlalchemydiff.comparer._get_constraints_info') as m:
238238
yield m

test/unit/test_util.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77

88
from sqlalchemydiff.util import CompareResult, InspectorFactory, IgnoreManager
9-
from mock import Mock, patch
9+
from unittest.mock import Mock, patch
1010

1111

1212
class TestCompareResult(object):
@@ -35,7 +35,7 @@ def test_dump_info(self):
3535

3636
result.dump_info(filename=filename)
3737

38-
with open(filename, 'rU') as stream:
38+
with open(filename, 'r') as stream:
3939
assert info == json.loads(stream.read())
4040

4141
os.unlink(filename)
@@ -47,7 +47,7 @@ def test_dump_errors(self):
4747

4848
result.dump_errors(filename=filename)
4949

50-
with open(filename, 'rU') as stream:
50+
with open(filename, 'r') as stream:
5151
assert errors == json.loads(stream.read())
5252

5353
os.unlink(filename)
@@ -62,12 +62,12 @@ def test_dump_with_null_filename(self):
6262

6363
class TestInspectorFactory(object):
6464

65-
@pytest.yield_fixture
65+
@pytest.fixture
6666
def create_engine_mock(self):
6767
with patch('sqlalchemydiff.util.create_engine') as m:
6868
yield m
6969

70-
@pytest.yield_fixture
70+
@pytest.fixture
7171
def inspect_mock(self):
7272
with patch('sqlalchemydiff.util.inspect') as m:
7373
yield m

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = {py27,py33,py34,py35,py36}-test
2+
envlist = {py36,py37,py38,py39}-test
33
skipdist=True
44

55
[testenv]

0 commit comments

Comments
 (0)