Skip to content

Commit

Permalink
Change fallback style
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Nov 10, 2018
1 parent de98b87 commit f5c7c58
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
6 changes: 2 additions & 4 deletions pipenv/vendor/tomlkit/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
from datetime import date
from datetime import datetime
from datetime import time
try:
from enum import Enum
except ImportError:
from pipenv.vendor.backports.enum import Enum

from ._compat import PY2
from ._compat import decode
Expand All @@ -18,8 +14,10 @@
from ._utils import escape_string

if PY2:
from pipenv.vendor.backports.enum import Enum
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
from enum import Enum
from functools import lru_cache
from toml.decoder import InlineTableDict

Expand Down
50 changes: 28 additions & 22 deletions tasks/vendoring/patches/vendor/tomlkit-fix.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ index e541c20c..0ac26752 100644
+++ b/pipenv/vendor/tomlkit/api.py
@@ -1,7 +1,5 @@
import datetime as _datetime

-from typing import Tuple
-
from ._utils import parse_rfc3339
from .container import Container
from .items import AoT
diff --git a/pipenv/vendor/tomlkit/container.py b/pipenv/vendor/tomlkit/container.py
index cb8af1d5..56ee2d62 100644
index cb8af1d5..9b5db5cb 100644
--- a/pipenv/vendor/tomlkit/container.py
+++ b/pipenv/vendor/tomlkit/container.py
@@ -1,13 +1,5 @@
from __future__ import unicode_literals

-from typing import Any
-from typing import Dict
-from typing import Generator
Expand All @@ -35,7 +35,7 @@ index cb8af1d5..56ee2d62 100644
+from .items import Trivia
from .items import Whitespace
from .items import item as _item

@@ -221,7 +214,12 @@ class Container(dict):
for i in idx:
self._body[i] = (None, Null())
Expand All @@ -47,46 +47,52 @@ index cb8af1d5..56ee2d62 100644
+ self._body[idx] = (None, Comment(Trivia(comment_ws="", comment=trivia.comment)))
+ else:
+ self._body[idx] = (None, Null())

super(Container, self).__delitem__(key.key)

diff --git a/pipenv/vendor/tomlkit/exceptions.py b/pipenv/vendor/tomlkit/exceptions.py
index 4fbc667b..c1a4e620 100644
--- a/pipenv/vendor/tomlkit/exceptions.py
+++ b/pipenv/vendor/tomlkit/exceptions.py
@@ -1,5 +1,3 @@
-from typing import Optional
-

class TOMLKitError(Exception):

diff --git a/pipenv/vendor/tomlkit/items.py b/pipenv/vendor/tomlkit/items.py
index 375b5f02..7035b69e 100644
index 375b5f02..cccfd4a1 100644
--- a/pipenv/vendor/tomlkit/items.py
+++ b/pipenv/vendor/tomlkit/items.py
@@ -7,13 +7,6 @@ from datetime import date
@@ -6,14 +6,6 @@ import string
from datetime import date
from datetime import datetime
from datetime import time
from enum import Enum
-from enum import Enum
-from typing import Any
-from typing import Dict
-from typing import Generator
-from typing import List
-from typing import Optional
-from typing import Union
-

from ._compat import PY2
from ._compat import decode
@@ -25,6 +18,7 @@ if PY2:
@@ -22,9 +14,12 @@ from ._compat import unicode
from ._utils import escape_string

if PY2:
+ from pipenv.vendor.backports.enum import Enum
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
+ from enum import Enum
from functools import lru_cache
+from toml.decoder import InlineTableDict


def item(value, _parent=None):
@@ -40,7 +34,10 @@ def item(value, _parent=None):
@@ -40,7 +35,10 @@ def item(value, _parent=None):
elif isinstance(value, float):
return Float(value, Trivia(), str(value))
elif isinstance(value, dict):
Expand All @@ -97,15 +103,15 @@ index 375b5f02..7035b69e 100644
+ val = Table(Container(), Trivia(), False)
for k, v in sorted(value.items(), key=lambda i: (isinstance(i[1], dict), i[0])):
val[k] = item(v, _parent=val)

diff --git a/pipenv/vendor/tomlkit/parser.py b/pipenv/vendor/tomlkit/parser.py
index 7b948331..3f507bb4 100644
--- a/pipenv/vendor/tomlkit/parser.py
+++ b/pipenv/vendor/tomlkit/parser.py
@@ -4,13 +4,6 @@ from __future__ import unicode_literals
import re
import string

-from typing import Any
-from typing import Generator
-from typing import List
Expand All @@ -122,11 +128,11 @@ index 1a96e058..dcfdafd0 100644
+++ b/pipenv/vendor/tomlkit/source.py
@@ -4,8 +4,6 @@ from __future__ import unicode_literals
import itertools

from copy import copy
-from typing import Optional
-from typing import Tuple

from ._compat import PY2
from ._compat import unicode
diff --git a/pipenv/vendor/tomlkit/toml_file.py b/pipenv/vendor/tomlkit/toml_file.py
Expand All @@ -135,10 +141,10 @@ index 3b416664..631e9959 100644
+++ b/pipenv/vendor/tomlkit/toml_file.py
@@ -1,8 +1,5 @@
import io

-from typing import Any
-from typing import Dict
-
from .api import loads
from .toml_document import TOMLDocument

0 comments on commit f5c7c58

Please sign in to comment.