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

Skip to content

Commit 9ad4fae

Browse files
committed
one re.split to split them all
surviving toml
1 parent 34a025e commit 9ad4fae

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

winpython/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__ = '5.0.20220918'
31+
__version__ = '5.0.20221016'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

winpython/piptree.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import json, sys, re, platform, os
3+
import re
34
from winpython import utils
45
from collections import OrderedDict
56
from pip._vendor.packaging.markers import Marker
@@ -53,7 +54,13 @@ def __init__(self):
5354
if "requires_dist" in meta:
5455
for i in meta["requires_dist"]:
5556
det = (i + ";").split(";")
56-
req_nameextra = normalize((det[0] + " ").split(" ")[0])
57+
58+
# req_nameextra is "python-jose[cryptography]"
59+
# from fastapi "python-jose[cryptography]<4.0.0,>=3.3.0
60+
# req_nameextra is "google-cloud-storage"
61+
# from "google-cloud-storage (<2.0.0,>=1.26.0)
62+
req_nameextra = re.split(' |;|==|!|>|<', det[0]+ ";")[0]
63+
req_nameextra = normalize(req_nameextra)
5764
req_key = normalize((req_nameextra + "[").split("[")[0])
5865
req_key_extra = req_nameextra[len(req_key) + 1 :].split("]")[0]
5966
req_version = det[0][len(req_nameextra) :].translate(replacements)

0 commit comments

Comments
 (0)