From e8b20d5beb701515443234d7e7e598bd8870a203 Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Sat, 6 Jun 2020 14:52:01 +0200 Subject: [PATCH] :fire: Drops garden support Garden are now installed like normal packages, refs: https://kivy.org/doc/stable/api-kivy.garden.html#update-to-garden-structure --- buildozer/__init__.py | 51 +++------------------------------- buildozer/default.spec | 3 -- docs/source/specifications.rst | 10 ------- 3 files changed, 4 insertions(+), 60 deletions(-) diff --git a/buildozer/__init__.py b/buildozer/__init__.py index 36e833cfe..bb3266c07 100644 --- a/buildozer/__init__.py +++ b/buildozer/__init__.py @@ -14,6 +14,7 @@ import select import codecs import textwrap +import warnings from buildozer.jsonstore import JsonStore from sys import stdout, stderr, exit from re import search @@ -171,7 +172,6 @@ def prepare_for_build(self): self.info('Check application requirements') self.check_application_requirements() - self.info('Check garden requirements') self.check_garden_requirements() self.info('Compile platform') @@ -509,44 +509,10 @@ def _install_application_requirement(self, module): cwd=self.buildozer_dir) def check_garden_requirements(self): - '''Ensure required garden packages are available to be included. - ''' garden_requirements = self.config.getlist('app', - 'garden_requirements', '') - - # have we installed the garden packages? - if exists(self.gardenlibs_dir) and \ - self.state.get('cache.gardenlibs', '') == garden_requirements: - self.debug('Garden requirements already installed, pass') - return - - # we're going to reinstall all the garden libs. - self.rmdir(self.gardenlibs_dir) - - # but if we don't have requirements, or if the user removed everything, - # don't do anything. - if not garden_requirements: - self.state['cache.gardenlibs'] = garden_requirements - return - - self._ensure_virtualenv() - self.cmd('pip install Kivy-Garden==0.1.1', env=self.env_venv) - - # recreate gardenlibs - self.mkdir(self.gardenlibs_dir) - - for requirement in garden_requirements: - self._install_garden_package(requirement) - - # save gardenlibs state - self.state['cache.gardenlibs'] = garden_requirements - - def _install_garden_package(self, package): - self._ensure_virtualenv() - self.debug('Install garden package {} in buildozer_dir'.format(package)) - self.cmd('garden install --app {}'.format(package), - env=self.env_venv, - cwd=self.buildozer_dir) + 'garden_requirements', '') + if garden_requirements: + warnings.warn("`garden_requirements` settings is deprecated, use `requirements` instead", DeprecationWarning) def _ensure_virtualenv(self): if hasattr(self, 'venv'): @@ -715,7 +681,6 @@ def get_version(self): def build_application(self): self._copy_application_sources() self._copy_application_libs() - self._copy_garden_libs() self._add_sitecustomize() def _copy_application_sources(self): @@ -816,10 +781,6 @@ def _copy_application_libs(self): # copy also the libs copytree(self.applibs_dir, join(self.app_dir, '_applibs')) - def _copy_garden_libs(self): - if exists(self.gardenlibs_dir): - copytree(self.gardenlibs_dir, join(self.app_dir, 'libs')) - def _add_sitecustomize(self): copyfile(join(dirname(__file__), 'sitecustomize.py'), join(self.app_dir, 'sitecustomize.py')) @@ -889,10 +850,6 @@ def app_dir(self): def applibs_dir(self): return join(self.buildozer_dir, 'applibs') - @property - def gardenlibs_dir(self): - return join(self.buildozer_dir, 'libs') - @property def global_buildozer_dir(self): return join(expanduser('~'), '.buildozer') diff --git a/buildozer/default.spec b/buildozer/default.spec index f1d7b234b..ad2639587 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -42,9 +42,6 @@ requirements = python3,kivy # Sets custom source for any requirements with recipes # requirements.source.kivy = ../../kivy -# (list) Garden requirements -#garden_requirements = - # (str) Presplash of the application #presplash.filename = %(source.dir)s/data/presplash.png diff --git a/docs/source/specifications.rst b/docs/source/specifications.rst index 35a0cebec..f1bfe923d 100644 --- a/docs/source/specifications.rst +++ b/docs/source/specifications.rst @@ -98,16 +98,6 @@ Section [app] the compilation here. If you want to make it work, contribute to the Python-for-android project by creating a recipe. See :doc:`contribute`. -- `garden_requirements`: List, Garden packages to include. - - Add here the list of Kivy's garden packages to include. For example:: - - garden_requirements = graph - - Please note that if it doesn't work, it might be because of the garden - package itself. Refer to the author of the package if he already tested - it on your target platform, not us. - - `presplash.filename`: String, loading screen of your application. Presplash is the image shown on the device during application loading.