Updates p4a deps parsing

Now deals with conditional statements introduced in:
https://github.com/kivy/python-for-android/pull/1418
This commit is contained in:
Andre Miras 2018-10-20 11:53:50 +02:00
parent 5af135fca4
commit 10a3915c67

View file

@ -521,13 +521,13 @@ class TargetAndroid(Target):
try:
with open(join(self.pa_dir, "setup.py")) as fd:
setup = fd.read()
deps = re.findall("install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[1]
deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
deps = ast.literal_eval(deps)
except Exception:
deps = []
pip_deps = []
for dep in deps:
pip_deps.append('"{}"'.format(dep))
pip_deps.append("'{}'".format(dep))
# in virtualenv or conda env
options = "--user"