8000 Drop dependency to six. · millerlucas/python-openapi-codec@3d77388 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d77388

Browse files
committed
Drop dependency to six.
1 parent 3a9006b commit 3d77388

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

openapi_codec/converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from six.moves.urllib.parse import urlparse
1+
from coreapi.compat import urlparse
22

33

44
class DocumentToOpenAPIConverter(object):
@@ -12,7 +12,7 @@ def _generate_swagger_object(self):
1212
"""
1313
Generates root of the Swagger spec.
1414
"""
15-
parsed_url = urlparse(self.document.url)
15+
parsed_url = urlparse.urlparse(self.document.url)
1616

1717
return {
1818
'swagger': '2.0',

requirements-unfrozen.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Package requirements
22
coreapi
3-
six
43

54
# Testing requirements
65
coverage

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ pyflakes==1.2.3
1212
pytest==2.9.2
1313
requests==2.10.0
1414
simplejson==3.8.2
15-
six==1.10.0
1615
uritemplate==0.6

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
exclude = *.ropeproject

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_package_data(package):
6161
author_email='tom@tomchristie.com',
6262
packages=get_packages('openapi_codec'),
6363
package_data=get_package_data('openapi_codec'),
64-
install_requires=['six>=1.10.0'],
64+
install_requires=[],
6565
classifiers=[
6666
'Intended Audience :: Developers',
6767
'License :: OSI Approved :: BSD License',

tests/compat.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1+
from unittest import TestCase as _TestCase
2+
3+
14
try:
25
from unittest import mock # NOQA
36
except:
47
import mock # NOQA
8+
9+
10+
class TestCase(_TestCase):
11+
def assertCountEqual(self, *args, **kwargs):
12+
if hasattr(self, 'assertItemsEqual'):
13+
return self.assertItemsEqual(*args, **kwargs)
14+
15+
return super().assertCountEqual(*args, **kwargs)

tests/test_converters.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import uuid
2-
from unittest import TestCase
32

4-
import six
53
import coreapi
64
from openapi_codec.converters import DocumentToOpenAPIConverter
75

8-
from .compat import mock
6+
from .compat import mock, TestCase
97

108

119
class TestGetInfoObject(TestCase):
@@ -51,7 +49,7 @@ def test_actions_are_converted_to_keys_under_url(self):
5149
expected = [
5250
link.action for link in self.document.data['users'].values()
5351
]
54-
six.assertCountEqual(self, expected, self.sut[self.path].keys())
52+
self.assertCountEqual(expected, self.sut[self.path].keys())
5553

5654

5755
class TestGetParameters(TestCase):

0 commit comments

Comments
 (0)
0