Merge pull request #320 from kived/android_new-pip

let p4a revamp handle pure python requirements
This commit is contained in:
Ryan Pessa 2016-05-08 18:41:11 -05:00
commit 0af7976a64
2 changed files with 5 additions and 8 deletions

View file

@ -451,6 +451,9 @@ class Buildozer(object):
''' '''
requirements = self.config.getlist('app', 'requirements', '') requirements = self.config.getlist('app', 'requirements', '')
target_available_packages = self.target.get_available_packages() target_available_packages = self.target.get_available_packages()
if target_available_packages is True:
# target handles all packages!
return
# remove all the requirements that the target can compile # remove all the requirements that the target can compile
onlyname = lambda x: x.split('==')[0] onlyname = lambda x: x.split('==')[0]

View file

@ -25,20 +25,14 @@ class TargetAndroidNew(TargetAndroid):
return self.buildozer.cmd(self._p4a_cmd + cmd, **kwargs) return self.buildozer.cmd(self._p4a_cmd + cmd, **kwargs)
def get_available_packages(self): def get_available_packages(self):
available_modules = self._p4a( return True
"recipes --compact",
get_stdout=True)[0]
return available_modules.splitlines()[0].split()
def compile_platform(self): def compile_platform(self):
app_requirements = self.buildozer.config.getlist( app_requirements = self.buildozer.config.getlist(
'app', 'requirements', '') 'app', 'requirements', '')
available_modules = self.get_available_packages()
onlyname = lambda x: x.split('==')[0] onlyname = lambda x: x.split('==')[0]
android_requirements = [x for x in app_requirements
if onlyname(x) in available_modules]
dist_name = self.buildozer.config.get('app', 'package.name') dist_name = self.buildozer.config.get('app', 'package.name')
requirements = ','.join(android_requirements) requirements = ','.join(app_requirements)
options = [] options = []
source_dirs = { source_dirs = {