Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a984a02

Browse files
committed
Make ordereddict a direct dependency.
1 parent 203c554 commit a984a02

8 files changed

Lines changed: 17 additions & 11 deletions

File tree

pre_commit/commands/autoupdate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import sys
55

6-
from asottile.ordereddict import OrderedDict
76
from asottile.yaml import ordered_dump
87
from asottile.yaml import ordered_load
98
from plumbum import local
@@ -12,6 +11,7 @@
1211
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
1312
from pre_commit.clientlib.validate_config import load_config
1413
from pre_commit.jsonschema_extensions import remove_defaults
14+
from pre_commit.ordereddict import OrderedDict
1515
from pre_commit.repository import Repository
1616

1717

pre_commit/five.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
"""five: six, redux"""
44
# pylint:disable=invalid-name
5-
PY2 = (str is bytes)
6-
PY3 = (str is not bytes)
5+
PY2 = str is bytes
6+
PY3 = str is not bytes
77

8-
# provide a symettrical `text` type to `bytes`
9-
if PY2:
8+
if PY2: # pragma: no cover (PY2 only)
109
text = unicode # flake8: noqa
11-
else:
10+
else: # pragma: no cover (PY3 only)
1211
text = str

pre_commit/ordereddict.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from __future__ import absolute_import
2+
from __future__ import unicode_literals
3+
4+
try:
5+
from collections import OrderedDict # noqa
6+
except ImportError: # pragma: no cover (PY26)
7+
from ordereddict import OrderedDict # noqa

pre_commit/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import unicode_literals
22

3-
from asottile.ordereddict import OrderedDict
43
from cached_property import cached_property
54

65
from pre_commit.languages.all import languages
76
from pre_commit.manifest import Manifest
7+
from pre_commit.ordereddict import OrderedDict
88
from pre_commit.prefixed_command_runner import PrefixedCommandRunner
99

1010

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
},
3333
install_requires=[
3434
'argparse',
35-
'asottile.ordereddict',
3635
'asottile.yaml',
3736
'cached-property',
3837
'jsonschema',
3938
'nodeenv>=0.9.4',
39+
'ordereddict',
4040
'plumbum',
4141
'pyyaml',
4242
'simplejson',

testing/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import io
55
import os.path
6-
from asottile.ordereddict import OrderedDict
76
from asottile.yaml import ordered_dump
87
from plumbum import local
98

@@ -12,6 +11,7 @@
1211
from pre_commit.clientlib.validate_config import CONFIG_JSON_SCHEMA
1312
from pre_commit.clientlib.validate_config import validate_config_extra
1413
from pre_commit.jsonschema_extensions import apply_defaults
14+
from pre_commit.ordereddict import OrderedDict
1515
from testing.util import copy_tree_to_path
1616
from testing.util import get_head_sha
1717
from testing.util import get_resource_path

tests/clientlib/validate_base_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import unicode_literals
22

33
import pytest
4-
from asottile.ordereddict import OrderedDict
54
from asottile.yaml import ordered_load
65

76
from pre_commit.clientlib.validate_base import get_validator
7+
from pre_commit.ordereddict import OrderedDict
88
from testing.util import get_resource_path
99

1010

tests/commands/autoupdate_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import pytest
44
import shutil
5-
from asottile.ordereddict import OrderedDict
65
from plumbum import local
76

87
import pre_commit.constants as C
98
from pre_commit.commands.autoupdate import _update_repository
109
from pre_commit.commands.autoupdate import autoupdate
1110
from pre_commit.commands.autoupdate import RepositoryCannotBeUpdatedError
11+
from pre_commit.ordereddict import OrderedDict
1212
from pre_commit.runner import Runner
1313
from testing.auto_namedtuple import auto_namedtuple
1414
from testing.fixtures import make_config_from_repo

0 commit comments

Comments
 (0)