Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor: bump dparse to 0.6.3 #5750

Merged
merged 2 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/5750.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump dparse to 0.6.3
2 changes: 1 addition & 1 deletion pipenv/vendor/dparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

__author__ = """Jannis Gebauer"""
__email__ = '[email protected]'
__version__ = '0.6.2'
__version__ = '0.6.3'

from .parser import parse # noqa
19 changes: 10 additions & 9 deletions pipenv/vendor/dparse/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
import os
from collections import OrderedDict
import re
import sys

from io import StringIO

from configparser import ConfigParser, NoOptionError
from pathlib import PurePath

try:
import tomllib as toml
except ImportError:
from pipenv.vendor import tomli as toml

from .errors import MalformedDependencyFileError
from .regex import HASH_REGEX

Expand All @@ -26,6 +22,11 @@
from pipenv.patched.pip._vendor.packaging.version import Version, InvalidVersion
import json

if sys.version_info >= (3, 11):
import tomllib
else:
import pipenv.vendor.tomli as tomllib


# this is a backport from setuptools 26.1
def setuptools_parse_requirements_backport(strs): # pragma: no cover
Expand Down Expand Up @@ -360,7 +361,7 @@ def parse(self):
:return:
"""
try:
data = toml.loads(self.obj.content, _dict=OrderedDict)
data = tomllib.loads(self.obj.content)
if data:
for package_type in ['packages', 'dev-packages']:
if package_type in data:
Expand All @@ -378,7 +379,7 @@ def parse(self):
section=package_type
)
)
except (toml.TomlDecodeError, IndexError):
except (tomllib.TOMLDecodeError, IndexError):
pass


Expand Down Expand Up @@ -447,7 +448,7 @@ def parse(self):
Parse a poetry.lock
"""
try:
data = toml.loads(self.obj.content, _dict=OrderedDict)
data = tomllib.loads(self.obj.content)
pkg_key = 'package'
if data:
try:
Expand Down Expand Up @@ -475,7 +476,7 @@ def parse(self):
section=section
)
)
except (toml.TomlDecodeError, IndexError) as e:
except (tomllib.TOMLDecodeError, IndexError) as e:
raise MalformedDependencyFileError(info=str(e))


Expand Down
11 changes: 6 additions & 5 deletions pipenv/vendor/dparse/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import json
import tempfile
import os
import sys

try:
import tomllib as toml
except ImportError:
from pipenv.vendor import tomli as toml
if sys.version_info >= (3, 11):
import tomllib
else:
import pipenv.vendor.tomli as tomllib


class RequirementsTXTUpdater(object):
Expand Down Expand Up @@ -83,7 +84,7 @@ class SetupCFGUpdater(CondaYMLUpdater):
class PipfileUpdater(object):
@classmethod
def update(cls, content, dependency, version, spec="==", hashes=()):
data = toml.loads(content)
data = tomllib.loads(content)
if data:
for package_type in ['packages', 'dev-packages']:
if package_type in data:
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/vendor.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
click-didyoumean==0.3.0
click==8.1.3
colorama==0.4.6
dparse==0.6.2
dparse==0.6.3
markupsafe==2.1.2
pep517==0.13.0
pexpect==4.8.0
Expand Down