-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
157 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
from typing import Optional | ||
|
||
|
||
class TOMLKitError(Exception): | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
tasks/vendoring/patches/vendor/tomlkit-dump-inline-table.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
diff --git a/pipenv/vendor/tomlkit/api.py b/pipenv/vendor/tomlkit/api.py | ||
index e541c20c..0ac26752 100644 | ||
--- a/pipenv/vendor/tomlkit/api.py | ||
+++ 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 | ||
--- 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 | ||
-from typing import List | ||
-from typing import Optional | ||
-from typing import Tuple | ||
-from typing import Union | ||
- | ||
from ._compat import decode | ||
from .exceptions import KeyAlreadyPresent | ||
from .exceptions import NonExistentKey | ||
@@ -17,6 +9,7 @@ from .items import Item | ||
from .items import Key | ||
from .items import Null | ||
from .items import Table | ||
+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()) | ||
else: | ||
- self._body[idx] = (None, Null()) | ||
+ old_data = self._body[idx] | ||
+ trivia = getattr(old_data, "trivia", None) | ||
+ if trivia and trivia.comment: | ||
+ 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 | ||
--- a/pipenv/vendor/tomlkit/items.py | ||
+++ b/pipenv/vendor/tomlkit/items.py | ||
@@ -7,13 +7,6 @@ from datetime import date | ||
from datetime import datetime | ||
from datetime import time | ||
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: | ||
from pipenv.vendor.backports.functools_lru_cache import lru_cache | ||
else: | ||
from functools import lru_cache | ||
+from toml.decoder import InlineTableDict | ||
|
||
|
||
def item(value, _parent=None): | ||
@@ -40,7 +34,10 @@ def item(value, _parent=None): | ||
elif isinstance(value, float): | ||
return Float(value, Trivia(), str(value)) | ||
elif isinstance(value, dict): | ||
- val = Table(Container(), Trivia(), False) | ||
+ if isinstance(value, InlineTableDict): | ||
+ val = InlineTable(Container(), Trivia()) | ||
+ else: | ||
+ 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 | ||
-from typing import Optional | ||
-from typing import Tuple | ||
-from typing import Union | ||
- | ||
from ._compat import chr | ||
from ._compat import decode | ||
from ._utils import _escaped | ||
diff --git a/pipenv/vendor/tomlkit/source.py b/pipenv/vendor/tomlkit/source.py | ||
index 1a96e058..dcfdafd0 100644 | ||
--- a/pipenv/vendor/tomlkit/source.py | ||
+++ 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 | ||
index 3b416664..631e9959 100644 | ||
--- a/pipenv/vendor/tomlkit/toml_file.py | ||
+++ 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 | ||
|
Oops, something went wrong.