Skip to content

Commit

Permalink
🔥 Drops garden support
Browse files Browse the repository at this point in the history
Garden are now installed like normal packages, refs:
https://kivy.org/doc/stable/api-kivy.garden.html#update-to-garden-structure
  • Loading branch information
AndreMiras committed Jun 6, 2020
1 parent ffe73a6 commit 32b37ea
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 65 deletions.
52 changes: 0 additions & 52 deletions buildozer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,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')
self.target.compile_platform()

Expand Down Expand Up @@ -508,46 +505,6 @@ def _install_application_requirement(self, module):
env=self.env_venv,
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)

def _ensure_virtualenv(self):
if hasattr(self, 'venv'):
return
Expand Down Expand Up @@ -715,7 +672,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 +772,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 +841,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 32b37ea

Please sign in to comment.