Merge pull request #736 from dbrnz/android_install_reqs

Allow for `install_reqs` line having whitespace at start, fixes #731 and #733
This commit is contained in:
Andre Miras 2018-10-30 09:12:23 +01:00 committed by GitHub
commit 4e87eaa795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -521,7 +521,7 @@ class TargetAndroid(Target):
try: try:
with open(join(self.pa_dir, "setup.py")) as fd: with open(join(self.pa_dir, "setup.py")) as fd:
setup = fd.read() setup = fd.read()
deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0] deps = re.findall("^\s*install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
deps = ast.literal_eval(deps) deps = ast.literal_eval(deps)
except IOError: except IOError:
self.buildozer.error('Failed to read python-for-android setup.py at {}'.format( self.buildozer.error('Failed to read python-for-android setup.py at {}'.format(