mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Replace parse with a simple regex.
This makes parse obsolete, removing ~1000 LOC.
This commit is contained in:
@@ -2,7 +2,6 @@ import re
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from pipenv.patched.pip._vendor.urllib3 import util as urllib3_util
|
||||
from pipenv.vendor import parse
|
||||
|
||||
requests_session = None # type: ignore
|
||||
|
||||
@@ -121,6 +120,8 @@ def proper_case(package_name):
|
||||
if not r.ok:
|
||||
raise OSError(f"Unable to find package {package_name} in PyPI repository.")
|
||||
|
||||
r = parse.parse("https://pypi.org/pypi/{name}/json", r.url)
|
||||
good_name = r["name"]
|
||||
regex = r"https://pypi\.org/pypi/(.*)/json$"
|
||||
match = re.search(regex, r.url)
|
||||
good_name = match.group(1)
|
||||
|
||||
return good_name
|
||||
|
||||
Reference in New Issue
Block a user