MCPcopy Create free account
hub / github.com/kivy/python-for-android / transform_dep_for_pip

Function transform_dep_for_pip

pythonforandroid/pythonpackage.py:55–74  ·  view source on GitHub ↗
(dependency)

Source from the content-addressed store, hash-verified

53
54
55def transform_dep_for_pip(dependency):
56 if dependency.find("@") > 0 and (
57 dependency.find("@") < dependency.find("://") or
58 "://" not in dependency
59 ):
60 # WORKAROUND FOR UPSTREAM BUG:
61 # https://github.com/pypa/pip/issues/6097
62 # (Please REMOVE workaround once that is fixed & released upstream!)
63 #
64 # Basically, setup_requires() can contain a format pip won't install
65 # from a requirements.txt (PEP 508 URLs).
66 # To avoid this, translate to an #egg= reference:
67 if dependency.endswith("#"):
68 dependency = dependency[:-1]
69 url = (dependency.partition("@")[2].strip().partition("#egg")[0] +
70 "#egg=" +
71 dependency.partition("@")[0].strip()
72 )
73 return url
74 return dependency
75
76
77def extract_metainfo_files_from_package(

Calls

no outgoing calls