Skip to content

Commit

Permalink
Merge pull request #1142 from AndreMiras/feature/garden_is_deprecated
Browse files Browse the repository at this point in the history
🔥 Drops garden support
  • Loading branch information
AndreMiras authored Jun 11, 2020
2 parents 25a5a11 + e8b20d5 commit 40c79e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 60 deletions.
51 changes: 4 additions & 47 deletions buildozer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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'):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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'))
Expand Down Expand Up @@ -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')
Expand Down
3 changes: 0 additions & 3 deletions buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 0 additions & 10 deletions docs/source/specifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 40c79e5

Please sign in to comment.