Skip to content

Conditional builds falls back on Python2 if needed #1435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions ci/rebuild_updated_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"""
import sh
import os
from pythonforandroid.build import Context
from pythonforandroid.graph import get_recipe_order_and_bootstrap
from pythonforandroid.toolchain import current_directory
from ci.constants import TargetPython, CORE_RECIPES, BROKEN_RECIPES

Expand Down Expand Up @@ -77,11 +79,21 @@ def main():
target_python = TargetPython.python3crystax
recipes = modified_recipes()
print('recipes modified:', recipes)
broken_recipes = BROKEN_RECIPES[target_python]
recipes = recipes - (CORE_RECIPES | broken_recipes)
recipes -= CORE_RECIPES
print('recipes to build:', recipes)
context = Context()
build_order, python_modules, bs = get_recipe_order_and_bootstrap(
context, recipes, None)
# fallback to python2 if default target is not compatible
if target_python.name not in build_order:
print('incompatible with {}'.format(target_python.name))
target_python = TargetPython.python2
print('falling back to {}'.format(target_python.name))
# removing the known broken recipe for the given target
broken_recipes = BROKEN_RECIPES[target_python]
recipes -= broken_recipes
print('recipes to build (no broken):', recipes)
build(target_python, recipes)
print(recipes)


if __name__ == '__main__':
Expand Down
12 changes: 2 additions & 10 deletions pythonforandroid/recipes/vispy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@

from pythonforandroid.recipe import PythonRecipe


class VispyRecipe(PythonRecipe):
# version = 'v0.4.0'
version = 'master'
url = 'https://github.com/vispy/vispy/archive/{version}.tar.gz'
# version = 'campagnola-scenegraph-update'
# url = 'https://github.com/campagnola/vispy/archive/scenegraph-update.zip'
# version = '???'
# url = 'https://github.com/inclement/vispy/archive/Eric89GXL-arcball.zip'

version = '0.4.0'
url = 'https://github.com/vispy/vispy/archive/v{version}.tar.gz'
depends = ['python2', 'numpy', 'pysdl2']

patches = ['disable_freetype.patch',
'disable_font_triage.patch',
'use_es2.patch',
Expand Down
2 changes: 1 addition & 1 deletion testapps/setup_testapp_python2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from distutils.core import setup
from setuptools import find_packages

options = {'apk': {'debug': None,
options = {'apk': {
'requirements': 'sdl2,pyjnius,kivy,python2',
'android-api': 19,
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
Expand Down
2 changes: 1 addition & 1 deletion testapps/setup_testapp_python3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from distutils.core import setup
from setuptools import find_packages

options = {'apk': {'debug': None,
options = {'apk': {
'requirements': 'sdl2,pyjnius,kivy,python3crystax',
'android-api': 19,
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
Expand Down