Skip to content
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

Release 2019.10.06 #1998

Merged
merged 30 commits into from
Dec 22, 2019
Merged

Release 2019.10.06 #1998

merged 30 commits into from
Dec 22, 2019

Conversation

inclement
Copy link
Member

@inclement inclement commented Oct 6, 2019

We'd better do a buildozer release before actually merging this, but it looks like NDK 19 is working well enough to prepare a p4a release. If anyone has objections or extra things they think should be merged first, please note them here.

  • Check that the build is passing

  • Run the tests locally via tox: this performs some long-running tests that are skipped on Travis.

  • [] Build and run the on_device_unit_tests app using buildozer. Check that they all pass.

  • [] Build and run the following testapps for arch armeabi-v7a and arm64-v8a:

    • python3 setup_testapp_python3_sqlite_openssl.py apk
      • [] armeabi-v7a
      • [] arm64-v8a
    • python3 setup_testapp_python2.py apk
      • [] armeabi-v7a
      • [] arm64-v8a
  • Check that the version number is correct

opacam and others added 30 commits August 15, 2019 14:01
The error was: build/other_builds/hostpython3/desktop/hostpython3/Include/Python.h:39:19: fatal error: crypt.h: No such file or directory
Fix and update regex's recipe
to avoid quotes being replaced by fancy ones
Merge release-2019.08.09 branch into develop
* [python] Fix build for case-insensitive FS 🍎

It turns out that the generated python binary for some builds are named `python.exe` instead of `python`. This depends on the File System where the build happens. It will be named `python.exe` when the FS is case-insensitive (Mac OSX and Cygwin), but it will be named `python` when the FS is case-sensitive (most GNU Linux distributions). The proposed solution consists in make a copy of the generated python binary with a given name (python3 or python2) so this way

To achieve this goal we refactor a little our `HostPythonRecipe`:
  - add private property `HostPythonRecipe._exe_name` (the name of the python executable based on major version)
  - add public property `HostPythonRecipe.python_exe` (the full path of the python executable)
  - implement `HostPythonRecipe.should_build`

And also it's affected the `GuestPythonRecipe`, because we need to use the generated python executable by `HostPythonRecipe`:
  - add private property `GuestPythonRecipe._libpython` (python's library name with extension...hardcoded for now...)
  - implement `GuestPythonRecipe.should_build`... to check the library instead of the executable so we avoid conflicts with case-insensitive FS

We also need:
  - fix `PythonRecipe.real_hostpython_location` because the name of our host python executable will depend on major version
  - fix python2 interpreter (fix-interpreter-version.patch)

Note: the variation of the name of the python's executable is mentioned at python's build docs (https://github.com/python/cpython/blob/3.7/README.rst#build-instructions)

Note: @TheSin- , ¡¡¡thanks for your debugging sessions!!!

* [ci] Add Mac OSX CI's test & refactor android's NDK/SDK installation

To do so we:
  - create a makefile to install the necessary dependencies for Mac OS X: `ci/makefiles/osx.mk`
  - create a makefile to install android's SDK/NDK: `ci/makefiles/android.mk`
  - refactor docker files: make use of android's makefile
  - change OS, from `linux` to `osx`, for CI test `Python 3 armeabi-v7a`, so we don't increase the overall build time and jobs
  - rename the `Python 2` test to `Python 2 armeabi-v7a (with numpy)` to reflect the build arch and numpy's build.
* customizability options - added compile-options

* apptheme option for all bootstraps
* [ndk19] Rework of the arch environment to work with ndk r19+

Things done here:

  - Modifies target so we can use the toolchains `in-place` (as if we were using a standalone toolchain)
  - Removes some cflags that we don't need anymore
  - Move `macros` and `includes` from `CFLAGS` to `CPPFLAGS` (because this is the way it's supposed to be)
  - Move libraries from `LDFLAGS` to `LDLIBS` (again, the same as above)
  - Refactor `Arch`'s variables into class attributes, to make `get_env` smaller and to be more readable/maintainable:
    + class attributes for flags:
      * common_cflags
      * common_cppflags
      * common_ldflags
      * common_ldlibs
      * common_ldshared
      * arch_cflags
    + class attributes for compiler:
      * clang_path
      * clang_exe
      * clang_exe_cxx
  - Remove hardcoded cpu count in `MAKE`
  - Remove `gcc` of environment (because it has been partially removed in ndk r18)
  - Shorten long line to be pep8 friendly (line where we define env['BUILDLIB_PATH'])
  - Commented lines for `ArchAarch_64` that it seems tha we don't need anymore (not removed because I'm not sure if we need them)

Note: This will force us to use a minimal ndk version of 19

See also: https://developer.android.com/ndk/guides/other_build_systems

* [ndk19] Update `test_archs` to ndk's r19+ build system

Also add some more tests. Now we check if some of the functions we mock, `glob` and `find_executable`, are called with the expected arguments

* [ndk19] Update `test_bootstrap` to ndk's r19+ build system

Because `clang` is the new default compiler and the affected tests were made thinking in `gcc` compiler

* [ndk19] Remove `clang` of `get_recipe_env`

Because as per ndk r19 the default compiler is clang and gcc has been partially removed

* [ndk19] Adapt python recipes to ndk's r19+ build system

We move python recipe to use a minimal ndk version of 19 because it will simplify the python's cross compilation (this way we can remove some environment variables that we don't need anymore). The only side effect detected is that the python's `zlib` module isn't built anymore. This is caused because python3 and python2 build systems contains libz's hardcoded version, which does not match the version used in ndk 19 (may be this the cause of some `zip/unzip` errors reported in python-for-android's issues?). We will take care later of this zlib problem, or we will get a runtime crash...so it seems that zlib is an `essential module` to successfully run a python-for-android app

* [ndk19] Update libffi to version post `v3.3RC0`

and adapt it to be ndk r19+ compatible

* [ndk19] Fix build of python's zlib module

Because python has a hardcoded zlib version which does not match android's ndk r19, and that prevents the build of zlib's module

Note: it seems that we have to point to the right lib and headers, otherwise we won't succeed in building python's zlib module

* [ndk19] Fix build of python2's _ctypes module for ndk r19+

* [ndk19] Fix numpy for ndk r19+

Note: because of the new build system recently introduced, we can safely remove some of the patches that we needed because it seems that it builds and runs fine without them

* [ndk19] Update docs with the new ndk requirements

* [ndk19] Set min/max/recommended android's NDK

* [ndk19] Make CI tests with android's NDK `r19b`

Because it's our minimum supported android NDK

* [ndk19] Fix png recipe for NDK r19+

We remove `get_recipe_env` because we don't need anymore to specify the flags set in there.

Note: As per new NDK r19+ build system implemented in p4a, the removed `flags` should be automatically set by the android's NDK

* [ndk19] Add `-fPIC` to `armeabi-v7a`'s arch cflags...

...force `Position-Independent Code`

To solve the kivy's build error detected in travis `OSX` test (https://travis-ci.org/kivy/python-for-android/jobs/576204088#L1105). But also detected the same error in  my local tests (linux os in this case) for `freetype` and `harfbuzz` recipes...so I have the feeling that this is better to set as global 🤞..is it?
This commit will introduce a new cls attribute: `built_libraries`.
This `built_libraries` attribute must be a dictionary. The keys are the full library name, e.g.: `libffi.so`. And the values must be the relative path of the library, e.g: `.libs`. So the this cls attribute for libffi recipe it would look like:
    ```built_libraries = {'libffi.so': '.libs'}```

This new cls attribute will allow us to detect library recipes and to refactor common operations that we do for those kind of recipes:
  - copy library into right location
  - implement `should_build` for library recipes

Those two things will make that our rebuilds to be more consistent and I hope that it will be easier to maintain. 

**So, once explained a little this PR, in here we do:**
  - [x] Add attribute `built_libraries`
  - [x] Add methods to refactor common library operations:
    - [x] install_libraries
    - [x] get_libraries
  - [x] implement `should_build` for library recipes
  - [x] implement basic tests for the newly introduced `Recipe` methods
  - [x] Make use of those Library attributes/methods for some basic set of recipes:
    - [x] libffi
    - [x] openssl
    - [x] png
    - [x] jpeg
    - [x] freetype
    - [x] harfbuzz
    - [x] libcurl
    - [x] libzbar
    - [x] libiconv
    - [x] libexpat
    - [x] libogg
    - [x] libxml2
    - [x] libxslt
    - [x] libshine
    - [x] libx264
    - [x] libglob
    - [x] libsodium
    - [x] libsecp256k1

**Things to do in separate PRs**, to be easy to review and because those points will start to conflict with the `NDK r19 migration` thing just merged:
  - Make use of Library attributes/methods introduced in this PR for un covered library recipes in here. Here we have two situations:
     - library recipes that depends on android's STL library (almost all the work done in here will depend of the `NDK r19 migration` thing)
     - all remaining library recipes, which are not STL lib dependent and that are not implemented in here (because I was unable to perform a successful build with them using arch `arm64-v8a`...so I think it would  be better to deal with those recipes in separate PRs and later...with the `NDK r19 migration` thing merged)

**Notes about changed recipes:** all the recipes touched in here almost have the same changes:
  - remove `should_build` method (to make use of the one implemented in base class for library recipes)
  - remove the copy of the library (because that will be done automatically by the method `install_libraries` implemented in base class)
  - fixed the imports due to refactoring

* [recipe-lib] Add attribute Recipe.built_libraries

so we can refactor some essential operations performed for library recipes (like copy the library into the right location, or decide if we should build the library recipe again)

* [recipe-lib] Add method Recipe.get_libraries

This function will allows us to get a list of the built/context libraries.
This will be useful to check if we have to built a library recipe or which library should be rebuild

* [recipe-lib] Make `Recipe.should_build` decide the library build

In case that the attribute built_libraries has been set, we will check the need of the recipe build, otherwise we will act as usual, forcing the build unless overwrote in subclass

* [recipe-lib] Add method `Recipe.install_libraries`

So we can:
  - control the copy of the library recipe
  - refactor the install of the lib for all library recipes

* [recipe-lib] Make libffi a library recipe

* [recipe-lib] Make openssl a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make png a library recipe

* [recipe-lib] Make jpeg a library recipe

* [recipe-lib] Make freetype a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make harfbuzz a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libcurl a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libzbar a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libiconv a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libexpat a library recipe and ...

also:
  - make the imports from the right module
  - remove hardcoded arch

* [recipe-lib] Make libogg a library recipe

* [recipe-lib] Make libxml2 a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libxslt a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libshine a library recipe and ...

also:
  - make the imports from the right module
  - remove the hardcoded cpu count when compiling

* [recipe-lib] Make libx264 a library recipe and ...

also:
  - make the imports from the right module
  - remove the hardcoded cpu count when compiling

* [recipe-lib] Make libglob a library recipe

* [recipe-lib] Make libsodium a library recipe and ...

also:
  - make the imports from the right module
  - fix hardcoded arch
  - enable cpu count when compiling

* [recipe-lib] Make libsecp256k1 a library recipe and ...

also make the imports from the right module

* [tests] Add tests for library recipe

* [NDK19] Fix libglob for android NDK r19

- change the `ARG_MAX` define, because it's already defined at `sysroot/usr/include/linux/limits.h`
- Replaced `size_t` by Including the <stddef.h> header. Because found the solution at stackoverflow:

As per C99, §7.17, size_t is not a builtin type but defined in <stddef.h>

See also:
  - https://travis-ci.org/kivy/python-for-android/jobs/576392711#L5992-L6013
  - https://stackoverflow.com/questions/26410466/gcc-linaro-compiler-throws-error-unknown-type-name-size-t
Because `--sysroot` flag is not needed anymore and make it fails the build since we migrated to new android's build system (implemented in NDK r19)

See also:
  - https://developer.android.com/ndk/guides/other_build_systems
…tion (#1947)

* [recipe-stl] Add android's STL lib support to `Recipe`

To allow us to refactor some common operations that we use in our recipes that depends on android's STL library.

Note: This commit will allow us to begin the migration to `c++_shared`. This is a must when we move to android's NDK r19+, because as for android NDK >= 18 is the only one supported STL library.

* [recipe-stl] Make CppCompiledComponentsPythonRecipe use Recipe's STL support

* [recipe-stl] Make icu a library recipe with STL support (rework)

Also done here:
  - Remove hardcoded version in url
  - Disable versioned shared libraries
  - Make it to be build as a shared libraries (instead of static)
  - Disable the build of static libraries (because we build them as shared ones, so we avoid to link with them without our consents)
  - Shorten long lines to be pep8's friendly
  - Remove icu from ci/constants
  - Remove `RuntimeError` about the need to use NDK api <= 19 (because that is not the case anymore)
  - consider host's number of cpu to perform the build

* [recipe-stl] Rework pyicu recipe to match latest icu changes

Also done here:
  - Remove icu.patch because now we don't have the version in our icu libraries
  - Shorten long lines to be pep8's friendly

* [tests] Add tests for recipe with STL support

* [tests] Add tests for icu recipe

* [tests] Add tests for pyicu recipe
* [recipe-lib] Make snappy a library recipe

* [recipe-stl] Make leveldb a library recipe and...

make it work with the reworked snappy recipe

* [recipe-stl] Fix pyleveldb for reworked leveldb/snappy
* [recipe-stl] Make libgeos a library recipe

* [recipe-stl] Fix shapely for reworked libgeos
which:
  - fix build for android's NDK r19+
  - allow us to build `boost+libtorrent` for any arch
  - Update boost to version `1.69.0`
  - update libtorrent to version `1.2.1`

The build method needs to be changed because one of the scripts used in `boost+libtorrent` build (make-standalone-toolchain.sh), has been removed from android's NDK. [This is because](https://developer.android.com/ndk/guides/standalone_toolchain):

`As of r19, the NDK's default toolchains are standalone toolchains, which renders this process unnecessary.`

Note: since 3887d2b, `python-for-android` uses android's NDK r19 as the minimum supported and also changed the build method used by p4a as [described in here](https://developer.android.com/ndk/guides/other_build_systems)
In here we do:
  - inherit from CppCompiledComponentsPythonRecipe Because depends on android's STL library
  - make use of the base class methods for library recipes
  - Split build_arch into proper methods
  - Shorten some long lines (to be PEP8 friendly)
  - make generated library shared
  - remove recipe from CI/constants
* 📚 Updated README.dm to clarify NDK versions

* 🔧 Change back to r19b
The main idea is to test as many recipes as we can with the less code possible and without creating any file/directory so our tests can be performed as fast as possible (all this tests will only add between 2 and 3 seconds to our CI tests and will cover almost 100% of the code for each tested recipe)

To do so, we create a couple of modules:

    tests.recipe_ctx: allow us to create a proper Context to test our recipes
    tests.recipe_lib_test: which holds some base classes to be used to test a recipe depending on the build method used. For starters we introduce two kind of base classes:
        BaseTestForMakeRecipe: To test an standard library build (this will iinclude the recipes which requires the classical build commandsconfigure/make)
        BaseTestForCmakeRecipe: To test an library recipe which is compiled with cmake

We also refactor the existing recipes tests, so we can remove some lines in there...the ones that creates a Context.

* [test] Add module `tests.recipe_ctx`

A helper module to test recipes.
Here we will initialize a `Context` to test recipes.

* [test] Refactor `setUp/tearDown` for `test_icu`

* [test] Refactor `setUp/tearDown` for `test_pyicu`

* [test] Refactor `setUp` for `test_reportlab`

* [test] Refactor `setUp` for `test_gevent`

* [test] Add module `tests.recipe_lib_test`

A helper module to test recipes which will allow to test any recipe using `configure/make` commands.

* [test] Add test for `libffi`

* [test] Add test for `libexpat`

* [test] Add test for `libcurl`

* [test] Add test for `libiconv`

* [test] Add test for `libogg`

* [test] Add test for `libpq`

* [test] Add test for `libsecp256k1`

* [test] Add test for `libshine`

* [test] Add test for `libvorbis`

* [test] Add test for `libx264`

* [test] Add test for `libxml2`

* [test] Add test for `libxslt`

* [test] Add test for `png`

* [test] Add test for `freetype`

* [test] Add test for `harfbuzz`

* [test] Add test for `openssl`

* [test] Add `BaseTestForCmakeRecipe`

* [test] Add test for `jpeg` and clean code

We can remove the `get_recipe_env` because the environment that we use is already using a clang as default compiler (not the case when we migrated the jpeg recipe to use `cmake`)...so we can do a little refactor :)

* [test] Add test for `snappy`

* [test] Add test for `leveldb`

* [test] Add test for `libgeos`

* [test] Add test for `libmysqlclient`

* [test] Add test for `openal`

* [test] Make the `super` calls Python3 style

* [test] Move mock tests outside context manager...

Because there is no need to do it there.

Also rewrote the inline comments.
This is a follow up of #1982

In here we do:
  - Move from `__new__` to `__init__` for `BaseTestForMakeRecipe` ([discussed at here](#1982 (comment)))
  - Convert cls attributes to instance attributes ([discussed at here](#1982 (comment)))
  -  Remove `mock` dependency for py3 tests (Because, as per Python 3.3+, `mock` it's a built-in-module). (Unfortunately we still will have a couple of `import mock` entries that we cannot remove until we completely remove python2 from our tests)

* [test] From `__new__` to `__init__` for `BaseTestForMakeRecipe`

* [test] Remove mock dependency for py3 tests

Because, as per Python 3.3+, `mock` it's a built-in-module

* [test] Convert cls attributes to instance attributes

Because we may have some side effects without willing, considering that cls attributes are shared between instances.
Recent pep517 release seems to break tests.
* Made p4a use per-arch dist build dirs

* Fixed up check on existing folder when overwriting distributions

* Improved Distribution.get_distribution api

* Fixed test_archs.py

* Fixed test_bootstrap.py

* Fixed test_distribution.py

* Fixed recipes tests

* Fixed formatting

* Made sure whole build process accesses dist_dir correctly

* Fixed apk output name formatting by moving version to end of string

* Further test fixes following dist_dir changes

* Removed unnecessary variable
Having `--host=x86` was making the configure script fail at enabling
shared library build on `x86`. This was resulting in failing to copy
`libiconv.so` and `libzbar.so` on `x86` arch.
Adds the NoClassDefFoundError XmlSchema case and groups related cases
together. Gives instructions for both Ubuntu and macOS to fix.
…ar_configure_host

Fixes libiconv & libzbar configure host
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍

@opacam
Copy link
Member

opacam commented Oct 8, 2019

Tox tests OK, here the log:

opacam@DEPOBOX:~/Devel/python-for-android$ tox -- tests/
GLOB sdist-make: /home/opacam/Devel/python-for-android/setup.py
pep8 create: /home/opacam/Devel/python-for-android/.tox/pep8
pep8 installdeps: flake8
pep8 inst: /home/opacam/Devel/python-for-android/.tox/.tmp/package/1/python-for-android-2019.10.6.zip
pep8 installed: appdirs==1.4.3,colorama==0.4.1,entrypoints==0.3,flake8==3.7.8,importlib-metadata==0.23,Jinja2==2.10.3,MarkupSafe==1.1.1,mccabe==0.6.1,more-itertools==7.2.0,pep517==0.6.0,pycodestyle==2.5.0,pyflakes==2.1.1,python-for-android==2019.10.6,pytoml==0.1.21,sh==1.12.14,six==1.12.0,virtualenv==16.7.5,zipp==0.6.0
pep8 run-test-pre: PYTHONHASHSEED='1864134374'
pep8 run-test: commands[0] | flake8 pythonforandroid/ tests/ ci/
py27 create: /home/opacam/Devel/python-for-android/.tox/py27
py27 installdeps: mock, pytest, virtualenv, backports.tempfile
py27 inst: /home/opacam/Devel/python-for-android/.tox/.tmp/package/1/python-for-android-2019.10.6.zip
py27 installed: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.,appdirs==1.4.3,atomicwrites==1.3.0,attrs==19.2.0,backports.tempfile==1.0,backports.weakref==1.0.post1,colorama==0.4.1,configparser==4.0.2,contextlib2==0.6.0,enum34==1.1.6,funcsigs==1.0.2,importlib-metadata==0.23,Jinja2==2.10.3,MarkupSafe==1.1.1,mock==3.0.5,more-itertools==5.0.0,packaging==19.2,pathlib2==2.3.5,pep517==0.6.0,pluggy==0.13.0,py==1.8.0,pyparsing==2.4.2,pytest==4.6.5,python-for-android==2019.10.6,pytoml==0.1.21,scandir==1.10.0,sh==1.12.14,six==1.12.0,virtualenv==16.7.5,wcwidth==0.1.7,zipp==0.6.0
py27 run-test-pre: PYTHONHASHSEED='1864134374'
py27 run-test: commands[0] | pytest tests/test_androidmodule_ctypes_finder.py tests/test_entrypoints_python2.py
========================================================================================================================= test session starts ==========================================================================================================================
platform linux2 -- Python 2.7.16+, pytest-4.6.5, py-1.8.0, pluggy-0.13.0
cachedir: .tox/py27/.pytest_cache
rootdir: /home/opacam/Devel/python-for-android
collected 4 items                                                                                                                                                                                                                                                      

tests/test_androidmodule_ctypes_finder.py ...                                                                                                                                                                                                                    [ 75%]
tests/test_entrypoints_python2.py .                                                                                                                                                                                                                              [100%]

======================================================================================================================= 4 passed in 0.04 seconds =======================================================================================================================
py3 create: /home/opacam/Devel/python-for-android/.tox/py3
py3 installdeps: pytest, virtualenv, coveralls, backports.tempfile
py3 inst: /home/opacam/Devel/python-for-android/.tox/.tmp/package/1/python-for-android-2019.10.6.zip
py3 installed: appdirs==1.4.3,atomicwrites==1.3.0,attrs==19.2.0,backports.tempfile==1.0,backports.weakref==1.0.post1,certifi==2019.9.11,chardet==3.0.4,colorama==0.4.1,coverage==4.5.4,coveralls==1.8.2,docopt==0.6.2,idna==2.8,importlib-metadata==0.23,Jinja2==2.10.3,MarkupSafe==1.1.1,more-itertools==7.2.0,packaging==19.2,pep517==0.6.0,pluggy==0.13.0,py==1.8.0,pyparsing==2.4.2,pytest==5.2.1,python-for-android==2019.10.6,pytoml==0.1.21,requests==2.22.0,sh==1.12.14,six==1.12.0,urllib3==1.25.6,virtualenv==16.7.5,wcwidth==0.1.7,zipp==0.6.0
py3 run-test-pre: PYTHONHASHSEED='1864134374'
py3 run-test: commands[0] | coverage run --branch --source=pythonforandroid -m pytest tests
========================================================================================================================= test session starts ==========================================================================================================================
platform linux -- Python 3.7.5rc1, pytest-5.2.1, py-1.8.0, pluggy-0.13.0
cachedir: .tox/py3/.pytest_cache
rootdir: /home/opacam/Devel/python-for-android
collected 187 items                                                                                                                                                                                                                                                    

tests/test_androidmodule_ctypes_finder.py ...                                                                                                                                                                                                                    [  1%]
tests/test_archs.py ......                                                                                                                                                                                                                                       [  4%]
tests/test_bootstrap.py ..........................                                                                                                                                                                                                               [ 18%]
tests/test_build.py .                                                                                                                                                                                                                                            [ 19%]
tests/test_distribution.py ..........                                                                                                                                                                                                                            [ 24%]
tests/test_entrypoints_python2.py .                                                                                                                                                                                                                              [ 25%]
tests/test_graph.py ............................                                                                                                                                                                                                                 [ 40%]
tests/test_logger.py .                                                                                                                                                                                                                                           [ 40%]
tests/test_pythonpackage.py ....                                                                                                                                                                                                                                 [ 42%]
tests/test_pythonpackage_basic.py ..........                                                                                                                                                                                                                     [ 48%]
tests/test_recipe.py ................                                                                                                                                                                                                                            [ 56%]
tests/test_recommendations.py ..........                                                                                                                                                                                                                         [ 62%]
tests/test_toolchain.py .....                                                                                                                                                                                                                                    [ 64%]
tests/test_util.py .......                                                                                                                                                                                                                                       [ 68%]
tests/recipes/test_freetype.py ..                                                                                                                                                                                                                                [ 69%]
tests/recipes/test_gevent.py .                                                                                                                                                                                                                                   [ 70%]
tests/recipes/test_harfbuzz.py ..                                                                                                                                                                                                                                [ 71%]
tests/recipes/test_icu.py ......                                                                                                                                                                                                                                 [ 74%]
tests/recipes/test_jpeg.py ..                                                                                                                                                                                                                                    [ 75%]
tests/recipes/test_leveldb.py ..                                                                                                                                                                                                                                 [ 76%]
tests/recipes/test_libcurl.py ..                                                                                                                                                                                                                                 [ 77%]
tests/recipes/test_libexpat.py ..                                                                                                                                                                                                                                [ 78%]
tests/recipes/test_libffi.py ...                                                                                                                                                                                                                                 [ 80%]
tests/recipes/test_libgeos.py ..                                                                                                                                                                                                                                 [ 81%]
tests/recipes/test_libiconv.py ..                                                                                                                                                                                                                                [ 82%]
tests/recipes/test_libmysqlclient.py ..                                                                                                                                                                                                                          [ 83%]
tests/recipes/test_libogg.py ..                                                                                                                                                                                                                                  [ 84%]
tests/recipes/test_libpq.py ..                                                                                                                                                                                                                                   [ 85%]
tests/recipes/test_libsecp256k1.py ..                                                                                                                                                                                                                            [ 86%]
tests/recipes/test_libshine.py ..                                                                                                                                                                                                                                [ 87%]
tests/recipes/test_libvorbis.py ..                                                                                                                                                                                                                               [ 88%]
tests/recipes/test_libx264.py ..                                                                                                                                                                                                                                 [ 89%]
tests/recipes/test_libxml2.py ..                                                                                                                                                                                                                                 [ 90%]
tests/recipes/test_libxslt.py ..                                                                                                                                                                                                                                 [ 91%]
tests/recipes/test_openal.py ...                                                                                                                                                                                                                                 [ 93%]
tests/recipes/test_openssl.py ......                                                                                                                                                                                                                             [ 96%]
tests/recipes/test_png.py ..                                                                                                                                                                                                                                     [ 97%]
tests/recipes/test_pyicu.py .                                                                                                                                                                                                                                    [ 98%]
tests/recipes/test_reportlab.py .                                                                                                                                                                                                                                [ 98%]
tests/recipes/test_snappy.py ..                                                                                                                                                                                                                                  [100%]

=========================================================================================================================== warnings summary ===========================================================================================================================
pythonforandroid/util.py:22
  /home/opacam/Devel/python-for-android/pythonforandroid/util.py:22: DeprecationWarning: WgetDownloader style of invoking requests is deprecated. Use newer urlopen functions/methods
    urlretrieve = WgetDownloader().retrieve

pythonforandroid/toolchain.py:85
  /home/opacam/Devel/python-for-android/pythonforandroid/toolchain.py:85: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

-- Docs: https://docs.pytest.org/en/latest/warnings.html
============================================================================================================= 187 passed, 2 warnings in 781.25s (0:13:01) ==============================================================================================================
py3 run-test: commands[1] | coverage report -m
Name                                                                     Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------------------------------------
pythonforandroid/__init__.py                                                 1      0      0      0   100%
pythonforandroid/archs.py                                                  112      1     18      1    98%   115, 114->115
pythonforandroid/bdistapk.py                                                97     97     60      0     0%   1-146
pythonforandroid/bootstrap.py                                              265     14    128      9    94%   34, 137-138, 206-207, 277, 281, 285, 356-361, 28->34, 115->113, 251->248, 276->277, 280->281, 284->285, 346->349, 355->356, 370->372
pythonforandroid/bootstraps/__init__.py                                      0      0      0      0   100%
pythonforandroid/bootstraps/empty/__init__.py                                9      0      0      0   100%
pythonforandroid/bootstraps/sdl2/__init__.py                                32      1      4      2    92%   21, 20->21, 46->50
pythonforandroid/bootstraps/service_only/__init__.py                        34      1      4      2    92%   29, 28->29, 44->48
pythonforandroid/bootstraps/webview/__init__.py                             33      1      4      2    92%   26, 25->26, 41->45
pythonforandroid/build.py                                                  583    353    242     27    34%   31-41, 45-57, 61-71, 75-79, 130, 169, 185, 198, 211, 224, 248, 269-275, 283-284, 286-287, 303, 314-316, 318-320, 322-324, 327-336, 338, 345-346, 348-349, 362, 370, 390, 409-411, 430, 434, 482, 499, 511-531, 539, 546-608, 612-619, 623-733, 765-854, 860-895, 905-948, 952-1080, 168->169, 184->185, 197->198, 210->211, 223->224, 247->248, 268->269, 282->283, 285->286, 299->303, 310->313, 313->314, 317->318, 321->322, 325->327, 337->338, 344->345, 347->348, 361->362, 369->370, 389->390, 398->397, 402->409, 429->430, 433->434, 481->482, 756->765
pythonforandroid/distribution.py                                           114      8     52     11    89%   118, 121, 136, 138, 140, 173, 206, 282, 115->118, 120->121, 135->136, 137->138, 139->140, 141->134, 172->173, 205->206, 210->209, 218->220, 281->282
pythonforandroid/entrypoints.py                                              9      2      0      0    78%   17-18
pythonforandroid/graph.py                                                  178     18    111      9    91%   34-35, 47, 50, 74, 76, 91, 94-98, 135, 289-292, 300, 321, 335-336, 46->47, 49->50, 73->74, 75->76, 90->91, 134->135, 263->259, 299->300, 319->321
pythonforandroid/logger.py                                                 155     42     60     13    63%   15-17, 20, 42, 118, 131-132, 139, 155-156, 160, 173, 182, 185-187, 200, 205-243, 14->15, 19->20, 38->42, 51->58, 117->118, 154->155, 159->160, 169->173, 181->182, 183->200, 184->185, 192->180, 193->180
pythonforandroid/patching.py                                                47     29      4      0    35%   5-7, 11-13, 18, 27-29, 33-35, 39-41, 45-47, 51-53, 57-59, 64, 69-71
pythonforandroid/python.py                                                 179    124     36      1    26%   110-138, 144-198, 203-206, 209, 212-213, 216-257, 274-279, 288-353, 395, 407-411, 429-459, 394->395
pythonforandroid/pythonpackage.py                                          320     93    142     24    68%   52-54, 96, 99, 143-146, 170, 176, 193-194, 201-202, 216, 243-248, 259-261, 279, 311, 324-326, 335-336, 342-343, 376-377, 383, 403-413, 426, 451-532, 608-610, 639, 661-662, 696, 727-732, 785, 95->96, 98->99, 142->143, 166->170, 173->176, 215->216, 235->243, 256->259, 274->279, 276->274, 309->311, 379->383, 391->420, 393->403, 394->396, 420->426, 605->608, 611->650, 634->642, 636->639, 695->696, 723->727, 738->740, 783->785
pythonforandroid/recipe.py                                                 673    331    273     34    47%   26-32, 43-44, 184, 192, 196, 201-208, 211, 227-244, 261-264, 267-273, 285-289, 301-302, 305, 342-344, 366-371, 383-395, 406-415, 418-490, 496, 520, 533-552, 564, 570-572, 581, 594, 605, 621-639, 644-645, 650, 662, 669, 715, 724, 737-741, 760, 763-766, 769, 772-783, 792-798, 801, 804, 807-811, 877-887, 896-897, 903, 908-911, 939, 943, 949-954, 959-960, 966-983, 986-988, 991-993, 1008-1010, 1013-1023, 1027-1029, 1032-1036, 1056-1058, 1061-1089, 1092-1098, 1104-1118, 1122-1128, 1131-1152, 1164-1165, 1192-1199, 1205-1208, 25->26, 36->43, 163->exit, 183->184, 191->192, 195->196, 199->227, 210->211, 300->301, 304->305, 341->342, 365->366, 382->383, 398->415, 405->406, 495->496, 505->508, 519->520, 560->564, 580->581, 593->594, 596->exit, 643->644, 661->662, 664->669, 712->715, 723->724, 892->896, 901->903, 922->946, 931->934, 938->939, 941->946, 942->943
pythonforandroid/recipes/Pillow/__init__.py                                 39     28      2      0    27%   17-56
pythonforandroid/recipes/__init__.py                                         0      0      0      0   100%
pythonforandroid/recipes/android/__init__.py                                46     31     10      0    27%   22-24, 27-83
pythonforandroid/recipes/android/src/android/__init__.py                     1      0      0      0   100%
pythonforandroid/recipes/android/src/android/_ctypes_library_finder.py      35      2     19      5    87%   20, 53, 16->19, 19->20, 49->51, 52->53, 61->56
pythonforandroid/recipes/apsw/__init__.py                                   23     11      0      0    52%   14-23, 26-31
pythonforandroid/recipes/atom/__init__.py                                    7      0      0      0   100%
pythonforandroid/recipes/audiostream/__init__.py                            18      9      0      0    50%   13-25
pythonforandroid/recipes/babel/__init__.py                                   9      0      0      0   100%
pythonforandroid/recipes/boost/__init__.py                                  48     29      6      0    35%   52-54, 60, 63-67, 73-80, 85-110
pythonforandroid/recipes/brokenrecipe/__init__.py                            5      0      0      0   100%
pythonforandroid/recipes/cdecimal/__init__.py                               16      6      4      0    50%   16-22
pythonforandroid/recipes/cffi/__init__.py                                   33     21      2      0    34%   22-26, 29-49
pythonforandroid/recipes/cherrypy/__init__.py                                8      0      0      0   100%
pythonforandroid/recipes/coverage/__init__.py                                9      0      0      0   100%
pythonforandroid/recipes/cryptography/__init__.py                           15      6      0      0    60%   13-20
pythonforandroid/recipes/cymunk/__init__.py                                  6      0      0      0   100%
pythonforandroid/recipes/dateutil/__init__.py                                9      0      0      0   100%
pythonforandroid/recipes/decorator/__init__.py                               9      0      0      0   100%
pythonforandroid/recipes/enaml/__init__.py                                   8      0      0      0   100%
pythonforandroid/recipes/enum34/__init__.py                                 12      3      2      0    64%   12-19
pythonforandroid/recipes/ethash/__init__.py                                  5      0      0      0   100%
pythonforandroid/recipes/evdev/__init__.py                                  13      3      0      0    77%   20-22
pythonforandroid/recipes/feedparser/__init__.py                              8      0      0      0   100%
pythonforandroid/recipes/ffmpeg/__init__.py                                 59     45      8      0    21%   15-16, 19, 22-24, 27-133
pythonforandroid/recipes/ffpyplayer/__init__.py                             19      9      0      0    53%   13-25
pythonforandroid/recipes/ffpyplayer_codecs/__init__.py                       6      1      0      0    83%   8
pythonforandroid/recipes/flask/__init__.py                                   9      0      0      0   100%
pythonforandroid/recipes/fontconfig/__init__.py                             13      3      0      0    77%   13-16
pythonforandroid/recipes/freetype/__init__.py                               48     17     12      4    58%   34-45, 63, 78-89, 101-104, 110-112, 33->34, 58->63, 73->78, 100->101
pythonforandroid/recipes/genericndkbuild/__init__.py                        19      7      0      0    63%   14, 17-20, 23-26
pythonforandroid/recipes/gevent-websocket/__init__.py                        8      0      0      0   100%
pythonforandroid/recipes/gevent/__init__.py                                 20      0      0      0   100%
pythonforandroid/recipes/greenlet/__init__.py                                7      0      0      0   100%
pythonforandroid/recipes/groestlcoin_hash/__init__.py                        7      0      0      0   100%
pythonforandroid/recipes/harfbuzz/__init__.py                               30      7      4      2    74%   31-40, 68-70, 30->31, 66->68
pythonforandroid/recipes/hostpython2/__init__.py                             6      0      0      0   100%
pythonforandroid/recipes/hostpython3/__init__.py                             6      0      0      0   100%
pythonforandroid/recipes/icu/__init__.py                                    60      1     12      4    93%   61, 47->49, 57->61, 74->91, 92->exit
pythonforandroid/recipes/idna/__init__.py                                    8      0      0      0   100%
pythonforandroid/recipes/ifaddrs/__init__.py                                37     22      8      0    33%   21-24, 28-51
pythonforandroid/recipes/ipaddress/__init__.py                               7      0      0      0   100%
pythonforandroid/recipes/jedi/__init__.py                                    7      0      0      0   100%
pythonforandroid/recipes/jpeg/__init__.py                                   19      0      0      0   100%
pythonforandroid/recipes/kivy/__init__.py                                   31     17      8      0    36%   16-28, 34-37, 40-51
pythonforandroid/recipes/kiwisolver/__init__.py                              7      0      0      0   100%
pythonforandroid/recipes/leveldb/__init__.py                                21      0      0      0   100%
pythonforandroid/recipes/libcurl/__init__.py                                21      0      0      0   100%
pythonforandroid/recipes/libexpat/__init__.py                               20      0      0      0   100%
pythonforandroid/recipes/libffi/__init__.py                                 23      0      2      1    96%   39->41
pythonforandroid/recipes/libgeos/__init__.py                                23      0      0      0   100%
pythonforandroid/recipes/libglob/__init__.py                                38     22      8      0    35%   30, 34-37, 41-63
pythonforandroid/recipes/libiconv/__init__.py                               16      0      0      0   100%
pythonforandroid/recipes/libmysqlclient/__init__.py                         21      1      0      0    95%   23
pythonforandroid/recipes/libnacl/__init__.py                                 8      0      0      0   100%
pythonforandroid/recipes/libogg/__init__.py                                 15      0      0      0   100%
pythonforandroid/recipes/libpq/__init__.py                                  17      1      0      0    94%   12
pythonforandroid/recipes/librt/__init__.py                                  21     12      8      0    31%   23, 27-50
pythonforandroid/recipes/libsecp256k1/__init__.py                           17      0      2      1    95%   18->20
pythonforandroid/recipes/libshine/__init__.py                               19      0      0      0   100%
pythonforandroid/recipes/libsodium/__init__.py                              22      8      0      0    64%   16-27, 30-32
pythonforandroid/recipes/libtorrent/__init__.py                             64     46     20      0    21%   15-21, 57-60, 64-67, 71-134, 139-145
pythonforandroid/recipes/libtribler/__init__.py                              9      0      0      0   100%
pythonforandroid/recipes/libvorbis/__init__.py                              23      0      0      0   100%
pythonforandroid/recipes/libx264/__init__.py                                21      1      2      1    91%   20, 17->20
pythonforandroid/recipes/libxml2/__init__.py                                27      0      2      1    97%   19->21
pythonforandroid/recipes/libxslt/__init__.py                                36      0      2      1    97%   31->33
pythonforandroid/recipes/libzbar/__init__.py                                26     11      0      0    58%   22-27, 30-50
pythonforandroid/recipes/libzmq/__init__.py                                 21      8      0      0    62%   16-39
pythonforandroid/recipes/lxml/__init__.py                                   44     32      4      0    25%   15-24, 27-63
pythonforandroid/recipes/m2crypto/__init__.py                               26     12      2      0    50%   16-31, 35-37
pythonforandroid/recipes/matplotlib/__init__.py                             15      4      0      0    73%   25-29
pythonforandroid/recipes/msgpack-python/__init__.py                          7      0      0      0   100%
pythonforandroid/recipes/mysqldb/__init__.py                                31     18      0      0    42%   19-23, 26-29, 32-49
pythonforandroid/recipes/netifaces/__init__.py                               9      0      0      0   100%
pythonforandroid/recipes/numpy/__init__.py                                  19      6      0      0    68%   22-24, 27-29
pythonforandroid/recipes/omemo-backend-signal/__init__.py                    9      0      0      0   100%
pythonforandroid/recipes/omemo/__init__.py                                   9      0      0      0   100%
pythonforandroid/recipes/openal/__init__.py                                 21      3      0      0    86%   16-18
pythonforandroid/recipes/opencv/__init__.py                                 38     22      2      0    40%   38, 41-44, 47-129
pythonforandroid/recipes/openssl/__init__.py                                54      2     12      2    94%   63, 114, 62->63, 112->114
pythonforandroid/recipes/pbkdf2/__init__.py                                  5      0      0      0   100%
pythonforandroid/recipes/pil/__init__.py                                    10      3      0      0    70%   16-20
pythonforandroid/recipes/png/__init__.py                                    18      0      0      0   100%
pythonforandroid/recipes/preppy/__init__.py                                  8      0      0      0   100%
pythonforandroid/recipes/protobuf_cpp/__init__.py                           80     55     14      0    27%   28-69, 72-94, 98-101, 107-124, 130-137
pythonforandroid/recipes/psycopg2/__init__.py                               26     13      2      0    46%   20-24, 29-32, 37-45
pythonforandroid/recipes/pyaml/__init__.py                                   8      0      0      0   100%
pythonforandroid/recipes/pyasn1/__init__.py                                  6      0      0      0   100%
pythonforandroid/recipes/pycparser/__init__.py                               9      0      0      0   100%
pythonforandroid/recipes/pycrypto/__init__.py                               29     16      0      0    45%   19-30, 33-41
pythonforandroid/recipes/pycryptodome/__init__.py                            6      0      0      0   100%
pythonforandroid/recipes/pyethereum/__init__.py                              7      0      0      0   100%
pythonforandroid/recipes/pyicu/__init__.py                                  17      0      2      0   100%
pythonforandroid/recipes/pyjnius/__init__.py                                18      4      0      0    78%   21-24
pythonforandroid/recipes/pyleveldb/__init__.py                              17      8      0      0    53%   13-24
pythonforandroid/recipes/pymunk/__init__.py                                 16      6      0      0    62%   13-18
pythonforandroid/recipes/pynacl/__init__.py                                 16      6      0      0    62%   14-26
pythonforandroid/recipes/pyogg/__init__.py                                   9      0      0      0   100%
pythonforandroid/recipes/pyopenal/__init__.py                                9      0      0      0   100%
pythonforandroid/recipes/pyopenssl/__init__.py                               8      0      0      0   100%
pythonforandroid/recipes/pyproj/__init__.py                                  7      0      0      0   100%
pythonforandroid/recipes/pyrxp/__init__.py                                   7      0      0      0   100%
pythonforandroid/recipes/pysdl2/__init__.py                                  6      0      0      0   100%
pythonforandroid/recipes/pysha3/__init__.py                                 17      8      0      0    53%   13-22
pythonforandroid/recipes/python2/__init__.py                                34     16      6      0    45%   57-61, 64-66, 69-80
pythonforandroid/recipes/python3/__init__.py                                20      6      4      1    62%   29, 47-52, 28->29
pythonforandroid/recipes/pytz/__init__.py                                    9      0      0      0   100%
pythonforandroid/recipes/pyusb/__init__.py                                   9      0      0      0   100%
pythonforandroid/recipes/pyyaml/__init__.py                                  7      0      0      0   100%
pythonforandroid/recipes/pyzbar/__init__.py                                 17      8      0      0    53%   16-23
pythonforandroid/recipes/pyzmq/__init__.py                                  28     12      0      0    57%   22-31, 34-55
pythonforandroid/recipes/regex/__init__.py                                   8      0      0      0   100%
pythonforandroid/recipes/reportlab/__init__.py                              43      4     12      4    78%   25-27, 46, 15->exit, 24->25, 45->46, 48->exit
pythonforandroid/recipes/requests/__init__.py                                8      0      0      0   100%
pythonforandroid/recipes/ruamel.yaml/__init__.py                             9      0      0      0   100%
pythonforandroid/recipes/scrypt/__init__.py                                 17      8      0      0    53%   16-23
pythonforandroid/recipes/sdl2/__init__.py                                   18      6      0      0    67%   16-19, 22-25
pythonforandroid/recipes/sdl2_image/__init__.py                              7      0      0      0   100%
pythonforandroid/recipes/sdl2_mixer/__init__.py                              7      0      0      0   100%
pythonforandroid/recipes/sdl2_ttf/__init__.py                                6      0      0      0   100%
pythonforandroid/recipes/secp256k1/__init__.py                              16      6      0      0    62%   27-32
pythonforandroid/recipes/setuptools/__init__.py                              7      0      0      0   100%
pythonforandroid/recipes/shapely/__init__.py                                17      6      0      0    65%   26-36
pythonforandroid/recipes/simple-crypt/__init__.py                            7      0      0      0   100%
pythonforandroid/recipes/six/__init__.py                                     6      0      0      0   100%
pythonforandroid/recipes/snappy/__init__.py                                 16      0      0      0   100%
pythonforandroid/recipes/spine/__init__.py                                   9      0      0      0   100%
pythonforandroid/recipes/sqlalchemy/__init__.py                              9      0      0      0   100%
pythonforandroid/recipes/sqlite3/__init__.py                                22      9      0      0    59%   14, 17-20, 24-26, 30-32
pythonforandroid/recipes/storm/__init__.py                                  12      2      0      0    83%   13-17
pythonforandroid/recipes/sympy/__init__.py                                   8      0      0      0   100%
pythonforandroid/recipes/twisted/__init__.py                                16      5      0      0    69%   15-17, 20-26
pythonforandroid/recipes/ujson/__init__.py                                   6      0      0      0   100%
pythonforandroid/recipes/vispy/__init__.py                                   7      0      0      0   100%
pythonforandroid/recipes/vlc/__init__.py                                    49     33     12      0    26%   21-43, 53-72
pythonforandroid/recipes/websocket-client/__init__.py                        6      0      0      0   100%
pythonforandroid/recipes/wsaccel/__init__.py                                 7      0      0      0   100%
pythonforandroid/recipes/x3dh/__init__.py                                   10      0      0      0   100%
pythonforandroid/recipes/xeddsa/__init__.py                                 19      6      0      0    68%   20-30
pythonforandroid/recipes/zbar/__init__.py                                   18      8      0      0    56%   23-30
pythonforandroid/recipes/zbarlight/__init__.py                              17      8      0      0    53%   16-23
pythonforandroid/recipes/zeroconf/__init__.py                                8      0      0      0   100%
pythonforandroid/recipes/zope/__init__.py                                   14      4      0      0    71%   14-19, 22
pythonforandroid/recipes/zope_interface/__init__.py                         21      6      0      0    71%   17-23, 26-28
pythonforandroid/recommendations.py                                         78      0     24      1    99%   105->exit
pythonforandroid/toolchain.py                                              550    277    208     25    43%   43-52, 58-59, 61-63, 66-67, 111, 152, 250-251, 303, 396, 578, 580, 591, 598-602, 612-639, 647-649, 677-678, 691-702, 706, 709, 713-723, 727-730, 737-744, 757, 762-767, 788-792, 796-811, 816-818, 823-825, 829-830, 845-852, 863-867, 877-892, 902-912, 925-1075, 1086-1089, 1093, 1098-1106, 1110-1115, 1124-1134, 1141, 1146, 1151-1164, 1168-1192, 60->61, 65->66, 110->111, 112->115, 122->127, 150->156, 151->152, 180->182, 203->206, 247->250, 302->303, 395->396, 576->578, 579->580, 590->591, 597->598, 605->654, 610->612, 646->647, 676->677, 687->691, 705->706, 708->709, 735->737, 756->757
pythonforandroid/util.py                                                    63      2     22      4    93%   12-13, 64->66, 66->68, 68->70, 116->118
--------------------------------------------------------------------------------------------------------------------
TOTAL                                                                     6091   2153   1607    192    60%
_______________________________________________________________________________________________________________________________ summary ________________________________________________________________________________________________________________________________
  pep8: commands succeeded
  py27: commands succeeded
  py3: commands succeeded
  congratulations :)
opacam@DEPOBOX:~/Devel/python-for-android$ 

@opacam
Copy link
Member

opacam commented Oct 10, 2019

Tested python3 setup_testapp_python3_sqlite_openssl.py (adding numpy to requeriments) for arch arm64-v8a and armeabi-v7a:

  • OK the build and app execution on android device (9.0):
    • test ctypes button...OK
    • test numpy button...OK
    • test pyjnius button...FAILS

I expected this vibration test failure, this is not new (if I remember well), pyjnius is imported fine, but the call to vibration fails, so I suspect that this maybe related to the deprecation of vibrate

Tried to fix this pyjnius issue (without success) with the following code in testapps/testapp_sqlite_openssl/main.py (line 193):

    def test_pyjnius(self, *args):
        try:
            from jnius import autoclass
        except ImportError:
            raise_error('Could not import pyjnius')
            return

        print('Attempting to vibrate with pyjnius')
        PythonActivity = autoclass('org.kivy.android.PythonActivity')
        mActivity = PythonActivity.mActivity
        VibrationEffect = autoclass('android.os.VibrationEffect')
        Context = autoclass('android.content.Context')
        print("Context is: {}".format(Context))
        vibrator = mActivity.getSystemService(Context.VIBRATOR_SERVICE)
        print("vibrator is: {}".format(vibrator))
        print("VibrationEffect is: {}".format(VibrationEffect))
        try:
            print('trying new vibration method')
            # First argument is the time in milliseconds, the second one is the
            # vibration intensity, which should be between 1 and 255
            ve = VibrationEffect.createOneShot(
                1000,
                VibrationEffect.DEFAULT_AMPLITUDE,
            )
            print('VibrationEffect.createOneShot is: {}'.format(ve))
            vibrator.vibrate(ve)
        except Exception as e:
            print('new vibration method failed: {}'.format(e))
            print('trying deprecated vibration method')
            vibrator.vibrate(1000)

Whith this traceback in adb logcat:

10-10 12:08:35.036 21889 21917 I python  : Attempting to vibrate with pyjnius
10-10 12:08:35.068 21889 21917 I python  : Context is: <class 'jnius.reflect.android.content.Context'>
10-10 12:08:35.086 21889 21917 I python  : vibrator is: <android.os.SystemVibrator at 0xcb0c8990 jclass=android/os/SystemVibrator jself=<LocalRef obj=0x5726 at 0xd0ff5550>>
10-10 12:08:35.086 21889 21917 I python  : VibrationEffect is: <class 'jnius.reflect.android.os.VibrationEffect'>
10-10 12:08:35.086 21889 21917 I python  : trying new vibration method
10-10 12:08:35.086 21889 21917 I python  : VibrationEffect.createOneShot is: <android.os.VibrationEffect at 0xd1148e70 jclass=android/os/VibrationEffect jself=<LocalRef obj=0x56fa at 0xcd65bad0>>
10-10 12:08:35.086 21889 21917 I python  : new vibration method failed: Invalid call, number of argument mismatch, got 1 need 4
10-10 12:08:35.086 21889 21917 I python  : trying deprecated vibration method
10-10 12:08:35.092 21889 21917 I python  : [INFO   ] [Base        ] Leaving application in progress...
10-10 12:08:35.093 21889 21917 I python  :  Traceback (most recent call last):
10-10 12:08:35.093 21889 21917 I python  :    File "/home/opacam/Devel/python-for-android/testapps/build/bdist.android-armeabi-v7a/testapp_sqlite_openssl/main.py", line 219, in test_pyjnius
10-10 12:08:35.094 21889 21917 I python  :    File "jnius/jnius_export_class.pxi", line 742, in jnius.jnius.JavaMethod.__call__
10-10 12:08:35.095 21889 21917 I python  :  jnius.jnius.JavaException: Invalid call, number of argument mismatch, got 1 need 4
10-10 12:08:35.096 21889 21917 I python  :  
10-10 12:08:35.096 21889 21917 I python  :  During handling of the above exception, another exception occurred:
10-10 12:08:35.097 21889 21917 I python  :  
10-10 12:08:35.097 21889 21917 I python  :  Traceback (most recent call last):
10-10 12:08:35.097 21889 21917 I python  :    File "/home/opacam/Devel/python-for-android/testapps/build/bdist.android-armeabi-v7a/testapp_sqlite_openssl/main.py", line 236, in <module>
10-10 12:08:35.099 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/app.py", line 855, in run
10-10 12:08:35.100 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/base.py", line 504, in runTouchApp
10-10 12:08:35.101 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/core/window/window_sdl2.py", line 747, in mainloop
10-10 12:08:35.102 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/core/window/window_sdl2.py", line 479, in _mainloop
10-10 12:08:35.103 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/base.py", line 342, in idle
10-10 12:08:35.104 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/base.py", line 327, in dispatch_input
10-10 12:08:35.106 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/base.py", line 233, in post_dispatch_input
10-10 12:08:35.107 21889 21917 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.108 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/core/window/__init__.py", line 1406, in on_motion
10-10 12:08:35.109 21889 21917 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.110 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/core/window/__init__.py", line 1442, in on_touch_up
10-10 12:08:35.111 21889 21917 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.113 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/uix/scrollview.py", line 895, in on_touch_up
10-10 12:08:35.114 21889 21917 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.116 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/uix/scrollview.py", line 934, in on_scroll_stop
10-10 12:08:35.117 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/uix/scrollview.py", line 642, in simulate_touch_down
10-10 12:08:35.119 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/uix/widget.py", line 549, in on_touch_down
10-10 12:08:35.120 21889 21917 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.121 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/uix/widget.py", line 549, in on_touch_down
10-10 12:08:35.122 21889 21917 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.124 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/uix/behaviors/button.py", line 151, in on_touch_down
10-10 12:08:35.125 21889 21917 I python  :    File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch
10-10 12:08:35.126 21889 21917 I python  :    File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
10-10 12:08:35.127 21889 21917 I python  :    File "kivy/_event.pyx", line 1098, in kivy._event.EventObservers._dispatch
10-10 12:08:35.128 21889 21917 I python  :    File "/home/opacam/.local/share/python-for-android/build/python-installs/bdisttest_python3_sqlite_openssl_googlendk/kivy/lang/builder.py", line 64, in custom_callback
10-10 12:08:35.129 21889 21917 I python  :    File "<string>", line 17, in <module>
10-10 12:08:35.131 21889 21917 I python  :    File "/home/opacam/Devel/python-for-android/testapps/build/bdist.android-armeabi-v7a/testapp_sqlite_openssl/main.py", line 223, in test_pyjnius
10-10 12:08:35.132 21889 21917 I python  :    File "jnius/jnius_export_class.pxi", line 742, in jnius.jnius.JavaMethod.__call__
10-10 12:08:35.133 21889 21917 I python  :  jnius.jnius.JavaException: Invalid call, number of argument mismatch, got 1 need 4
10-10 12:08:35.133 21889 21917 I python  : Python for android ended.

Anyway, I don't think that this is a p4a problem, looks like a pyjnius issue, but since I'm not sure if I correctly implemented the new vibration method, I did not created any issue/pr at pyjnius or p4a, just noting that we have a test case in p4a (testapp_sqlite_openssl) that could help us to investigate this pyjnius issue.

@inclement, I checked tox at the first post, I think that we could also check the python3 setup_testapp_python3_sqlite_openssl.py apk for both archs but, given the above situation, I leave this to your judgement 😉

References:

@AndreMiras
Copy link
Member

I've been using it for weeks now and it compiles fine for both armeabi-v7a and arm64-v8a archs at least on Linux. Also the apps run fine with armeabi-v7a. So I'd say let's merge it

@inclement inclement merged commit b1f6064 into master Dec 22, 2019
@inclement
Copy link
Member Author

New buildozer release made, so merged. Thanks all :)

AndreMiras added a commit that referenced this pull request Apr 1, 2020
inclement added a commit that referenced this pull request Apr 1, 2020
* Release 2019.10.06 (#1998)

* [recipes] Fix compilation for  regex recipe

The error was: build/other_builds/hostpython3/desktop/hostpython3/Include/Python.h:39:19: fatal error: crypt.h: No such file or directory

* [recipes] Update regex's recipe

* put the sdk manager command in a code block (#1956)

to avoid quotes being replaced by fancy ones

* Updated version number for develop branch following 2019.08.09 release (#1960)

*  Fix build for case-insensitive FS and add CI test for OSX (#1951)

* [python] Fix build for case-insensitive FS 🍎

It turns out that the generated python binary for some builds are named `python.exe` instead of `python`. This depends on the File System where the build happens. It will be named `python.exe` when the FS is case-insensitive (Mac OSX and Cygwin), but it will be named `python` when the FS is case-sensitive (most GNU Linux distributions). The proposed solution consists in make a copy of the generated python binary with a given name (python3 or python2) so this way

To achieve this goal we refactor a little our `HostPythonRecipe`:
  - add private property `HostPythonRecipe._exe_name` (the name of the python executable based on major version)
  - add public property `HostPythonRecipe.python_exe` (the full path of the python executable)
  - implement `HostPythonRecipe.should_build`

And also it's affected the `GuestPythonRecipe`, because we need to use the generated python executable by `HostPythonRecipe`:
  - add private property `GuestPythonRecipe._libpython` (python's library name with extension...hardcoded for now...)
  - implement `GuestPythonRecipe.should_build`... to check the library instead of the executable so we avoid conflicts with case-insensitive FS

We also need:
  - fix `PythonRecipe.real_hostpython_location` because the name of our host python executable will depend on major version
  - fix python2 interpreter (fix-interpreter-version.patch)

Note: the variation of the name of the python's executable is mentioned at python's build docs (https://github.com/python/cpython/blob/3.7/README.rst#build-instructions)

Note: @TheSin- , ¡¡¡thanks for your debugging sessions!!!

* [ci] Add Mac OSX CI's test & refactor android's NDK/SDK installation

To do so we:
  - create a makefile to install the necessary dependencies for Mac OS X: `ci/makefiles/osx.mk`
  - create a makefile to install android's SDK/NDK: `ci/makefiles/android.mk`
  - refactor docker files: make use of android's makefile
  - change OS, from `linux` to `osx`, for CI test `Python 3 armeabi-v7a`, so we don't increase the overall build time and jobs
  - rename the `Python 2` test to `Python 2 armeabi-v7a (with numpy)` to reflect the build arch and numpy's build.

* customizability (#1869)

* customizability options - added compile-options

* apptheme option for all bootstraps

* Initial migration to NDK r19 (Part I - The core) (#1722)

* [ndk19] Rework of the arch environment to work with ndk r19+

Things done here:

  - Modifies target so we can use the toolchains `in-place` (as if we were using a standalone toolchain)
  - Removes some cflags that we don't need anymore
  - Move `macros` and `includes` from `CFLAGS` to `CPPFLAGS` (because this is the way it's supposed to be)
  - Move libraries from `LDFLAGS` to `LDLIBS` (again, the same as above)
  - Refactor `Arch`'s variables into class attributes, to make `get_env` smaller and to be more readable/maintainable:
    + class attributes for flags:
      * common_cflags
      * common_cppflags
      * common_ldflags
      * common_ldlibs
      * common_ldshared
      * arch_cflags
    + class attributes for compiler:
      * clang_path
      * clang_exe
      * clang_exe_cxx
  - Remove hardcoded cpu count in `MAKE`
  - Remove `gcc` of environment (because it has been partially removed in ndk r18)
  - Shorten long line to be pep8 friendly (line where we define env['BUILDLIB_PATH'])
  - Commented lines for `ArchAarch_64` that it seems tha we don't need anymore (not removed because I'm not sure if we need them)

Note: This will force us to use a minimal ndk version of 19

See also: https://developer.android.com/ndk/guides/other_build_systems

* [ndk19] Update `test_archs` to ndk's r19+ build system

Also add some more tests. Now we check if some of the functions we mock, `glob` and `find_executable`, are called with the expected arguments

* [ndk19] Update `test_bootstrap` to ndk's r19+ build system

Because `clang` is the new default compiler and the affected tests were made thinking in `gcc` compiler

* [ndk19] Remove `clang` of `get_recipe_env`

Because as per ndk r19 the default compiler is clang and gcc has been partially removed

* [ndk19] Adapt python recipes to ndk's r19+ build system

We move python recipe to use a minimal ndk version of 19 because it will simplify the python's cross compilation (this way we can remove some environment variables that we don't need anymore). The only side effect detected is that the python's `zlib` module isn't built anymore. This is caused because python3 and python2 build systems contains libz's hardcoded version, which does not match the version used in ndk 19 (may be this the cause of some `zip/unzip` errors reported in python-for-android's issues?). We will take care later of this zlib problem, or we will get a runtime crash...so it seems that zlib is an `essential module` to successfully run a python-for-android app

* [ndk19] Update libffi to version post `v3.3RC0`

and adapt it to be ndk r19+ compatible

* [ndk19] Fix build of python's zlib module

Because python has a hardcoded zlib version which does not match android's ndk r19, and that prevents the build of zlib's module

Note: it seems that we have to point to the right lib and headers, otherwise we won't succeed in building python's zlib module

* [ndk19] Fix build of python2's _ctypes module for ndk r19+

* [ndk19] Fix numpy for ndk r19+

Note: because of the new build system recently introduced, we can safely remove some of the patches that we needed because it seems that it builds and runs fine without them

* [ndk19] Update docs with the new ndk requirements

* [ndk19] Set min/max/recommended android's NDK

* [ndk19] Make CI tests with android's NDK `r19b`

Because it's our minimum supported android NDK

* [ndk19] Fix png recipe for NDK r19+

We remove `get_recipe_env` because we don't need anymore to specify the flags set in there.

Note: As per new NDK r19+ build system implemented in p4a, the removed `flags` should be automatically set by the android's NDK

* [ndk19] Add `-fPIC` to `armeabi-v7a`'s arch cflags...

...force `Position-Independent Code`

To solve the kivy's build error detected in travis `OSX` test (https://travis-ci.org/kivy/python-for-android/jobs/576204088#L1105). But also detected the same error in  my local tests (linux os in this case) for `freetype` and `harfbuzz` recipes...so I have the feeling that this is better to set as global 🤞..is it?

* [LIBS - PART I] Initial refactor of library recipes (#1944)

This commit will introduce a new cls attribute: `built_libraries`.
This `built_libraries` attribute must be a dictionary. The keys are the full library name, e.g.: `libffi.so`. And the values must be the relative path of the library, e.g: `.libs`. So the this cls attribute for libffi recipe it would look like:
    ```built_libraries = {'libffi.so': '.libs'}```

This new cls attribute will allow us to detect library recipes and to refactor common operations that we do for those kind of recipes:
  - copy library into right location
  - implement `should_build` for library recipes

Those two things will make that our rebuilds to be more consistent and I hope that it will be easier to maintain. 

**So, once explained a little this PR, in here we do:**
  - [x] Add attribute `built_libraries`
  - [x] Add methods to refactor common library operations:
    - [x] install_libraries
    - [x] get_libraries
  - [x] implement `should_build` for library recipes
  - [x] implement basic tests for the newly introduced `Recipe` methods
  - [x] Make use of those Library attributes/methods for some basic set of recipes:
    - [x] libffi
    - [x] openssl
    - [x] png
    - [x] jpeg
    - [x] freetype
    - [x] harfbuzz
    - [x] libcurl
    - [x] libzbar
    - [x] libiconv
    - [x] libexpat
    - [x] libogg
    - [x] libxml2
    - [x] libxslt
    - [x] libshine
    - [x] libx264
    - [x] libglob
    - [x] libsodium
    - [x] libsecp256k1

**Things to do in separate PRs**, to be easy to review and because those points will start to conflict with the `NDK r19 migration` thing just merged:
  - Make use of Library attributes/methods introduced in this PR for un covered library recipes in here. Here we have two situations:
     - library recipes that depends on android's STL library (almost all the work done in here will depend of the `NDK r19 migration` thing)
     - all remaining library recipes, which are not STL lib dependent and that are not implemented in here (because I was unable to perform a successful build with them using arch `arm64-v8a`...so I think it would  be better to deal with those recipes in separate PRs and later...with the `NDK r19 migration` thing merged)

**Notes about changed recipes:** all the recipes touched in here almost have the same changes:
  - remove `should_build` method (to make use of the one implemented in base class for library recipes)
  - remove the copy of the library (because that will be done automatically by the method `install_libraries` implemented in base class)
  - fixed the imports due to refactoring

* [recipe-lib] Add attribute Recipe.built_libraries

so we can refactor some essential operations performed for library recipes (like copy the library into the right location, or decide if we should build the library recipe again)

* [recipe-lib] Add method Recipe.get_libraries

This function will allows us to get a list of the built/context libraries.
This will be useful to check if we have to built a library recipe or which library should be rebuild

* [recipe-lib] Make `Recipe.should_build` decide the library build

In case that the attribute built_libraries has been set, we will check the need of the recipe build, otherwise we will act as usual, forcing the build unless overwrote in subclass

* [recipe-lib] Add method `Recipe.install_libraries`

So we can:
  - control the copy of the library recipe
  - refactor the install of the lib for all library recipes

* [recipe-lib] Make libffi a library recipe

* [recipe-lib] Make openssl a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make png a library recipe

* [recipe-lib] Make jpeg a library recipe

* [recipe-lib] Make freetype a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make harfbuzz a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libcurl a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libzbar a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libiconv a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libexpat a library recipe and ...

also:
  - make the imports from the right module
  - remove hardcoded arch

* [recipe-lib] Make libogg a library recipe

* [recipe-lib] Make libxml2 a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libxslt a library recipe and ...

also make the imports from the right module

* [recipe-lib] Make libshine a library recipe and ...

also:
  - make the imports from the right module
  - remove the hardcoded cpu count when compiling

* [recipe-lib] Make libx264 a library recipe and ...

also:
  - make the imports from the right module
  - remove the hardcoded cpu count when compiling

* [recipe-lib] Make libglob a library recipe

* [recipe-lib] Make libsodium a library recipe and ...

also:
  - make the imports from the right module
  - fix hardcoded arch
  - enable cpu count when compiling

* [recipe-lib] Make libsecp256k1 a library recipe and ...

also make the imports from the right module

* [tests] Add tests for library recipe

* [NDK19] Fix libglob for android NDK r19

- change the `ARG_MAX` define, because it's already defined at `sysroot/usr/include/linux/limits.h`
- Replaced `size_t` by Including the <stddef.h> header. Because found the solution at stackoverflow:

As per C99, §7.17, size_t is not a builtin type but defined in <stddef.h>

See also:
  - https://travis-ci.org/kivy/python-for-android/jobs/576392711#L5992-L6013
  - https://stackoverflow.com/questions/26410466/gcc-linaro-compiler-throws-error-unknown-type-name-size-t

* [NDK19] Remove `--sysroot` from LDFLAGS for cffi and pymunk (#1965)

Because `--sysroot` flag is not needed anymore and make it fails the build since we migrated to new android's build system (implemented in NDK r19)

See also:
  - https://developer.android.com/ndk/guides/other_build_systems

* Added libffi headers troubleshooting note to doc (#1972)

* [LIBS - PART II] Part II of NDK r19 migration - Initial STL lib migration (#1947)

* [recipe-stl] Add android's STL lib support to `Recipe`

To allow us to refactor some common operations that we use in our recipes that depends on android's STL library.

Note: This commit will allow us to begin the migration to `c++_shared`. This is a must when we move to android's NDK r19+, because as for android NDK >= 18 is the only one supported STL library.

* [recipe-stl] Make CppCompiledComponentsPythonRecipe use Recipe's STL support

* [recipe-stl] Make icu a library recipe with STL support (rework)

Also done here:
  - Remove hardcoded version in url
  - Disable versioned shared libraries
  - Make it to be build as a shared libraries (instead of static)
  - Disable the build of static libraries (because we build them as shared ones, so we avoid to link with them without our consents)
  - Shorten long lines to be pep8's friendly
  - Remove icu from ci/constants
  - Remove `RuntimeError` about the need to use NDK api <= 19 (because that is not the case anymore)
  - consider host's number of cpu to perform the build

* [recipe-stl] Rework pyicu recipe to match latest icu changes

Also done here:
  - Remove icu.patch because now we don't have the version in our icu libraries
  - Shorten long lines to be pep8's friendly

* [tests] Add tests for recipe with STL support

* [tests] Add tests for icu recipe

* [tests] Add tests for pyicu recipe

* [WIP][LIBS - PART III] Rework of pyleveldb, leveldb and snappy (#1966)

* [recipe-lib] Make snappy a library recipe

* [recipe-stl] Make leveldb a library recipe and...

make it work with the reworked snappy recipe

* [recipe-stl] Fix pyleveldb for reworked leveldb/snappy

* [WIP][LIBS - PART IV] Rework of shapely and libgeos (#1967)

* [recipe-stl] Make libgeos a library recipe

* [recipe-stl] Fix shapely for reworked libgeos

* [recipe-stl] Make libzmq a library recipe (#1968)

* [recipe-stl] Rework of libtorrent and boost (#1971)

which:
  - fix build for android's NDK r19+
  - allow us to build `boost+libtorrent` for any arch
  - Update boost to version `1.69.0`
  - update libtorrent to version `1.2.1`

The build method needs to be changed because one of the scripts used in `boost+libtorrent` build (make-standalone-toolchain.sh), has been removed from android's NDK. [This is because](https://developer.android.com/ndk/guides/standalone_toolchain):

`As of r19, the NDK's default toolchains are standalone toolchains, which renders this process unnecessary.`

Note: since 3887d2b, `python-for-android` uses android's NDK r19 as the minimum supported and also changed the build method used by p4a as [described in here](https://developer.android.com/ndk/guides/other_build_systems)

* Also copy the service/main.py when building with setup.py (#1936)

* [recipe-stl] Rework of protobuf_cpp recipe (#1969)

In here we do:
  - inherit from CppCompiledComponentsPythonRecipe Because depends on android's STL library
  - make use of the base class methods for library recipes
  - Split build_arch into proper methods
  - Shorten some long lines (to be PEP8 friendly)
  - make generated library shared
  - remove recipe from CI/constants

* [CI] Fix CI's test for `arm64-v8a` (#1977)

* Updated README.md to clarify NDK versions (#1981)

* 📚 Updated README.dm to clarify NDK versions

* 🔧 Change back to r19b

* A bunch of tests for library recipes (#1982)

The main idea is to test as many recipes as we can with the less code possible and without creating any file/directory so our tests can be performed as fast as possible (all this tests will only add between 2 and 3 seconds to our CI tests and will cover almost 100% of the code for each tested recipe)

To do so, we create a couple of modules:

    tests.recipe_ctx: allow us to create a proper Context to test our recipes
    tests.recipe_lib_test: which holds some base classes to be used to test a recipe depending on the build method used. For starters we introduce two kind of base classes:
        BaseTestForMakeRecipe: To test an standard library build (this will iinclude the recipes which requires the classical build commandsconfigure/make)
        BaseTestForCmakeRecipe: To test an library recipe which is compiled with cmake

We also refactor the existing recipes tests, so we can remove some lines in there...the ones that creates a Context.

* [test] Add module `tests.recipe_ctx`

A helper module to test recipes.
Here we will initialize a `Context` to test recipes.

* [test] Refactor `setUp/tearDown` for `test_icu`

* [test] Refactor `setUp/tearDown` for `test_pyicu`

* [test] Refactor `setUp` for `test_reportlab`

* [test] Refactor `setUp` for `test_gevent`

* [test] Add module `tests.recipe_lib_test`

A helper module to test recipes which will allow to test any recipe using `configure/make` commands.

* [test] Add test for `libffi`

* [test] Add test for `libexpat`

* [test] Add test for `libcurl`

* [test] Add test for `libiconv`

* [test] Add test for `libogg`

* [test] Add test for `libpq`

* [test] Add test for `libsecp256k1`

* [test] Add test for `libshine`

* [test] Add test for `libvorbis`

* [test] Add test for `libx264`

* [test] Add test for `libxml2`

* [test] Add test for `libxslt`

* [test] Add test for `png`

* [test] Add test for `freetype`

* [test] Add test for `harfbuzz`

* [test] Add test for `openssl`

* [test] Add `BaseTestForCmakeRecipe`

* [test] Add test for `jpeg` and clean code

We can remove the `get_recipe_env` because the environment that we use is already using a clang as default compiler (not the case when we migrated the jpeg recipe to use `cmake`)...so we can do a little refactor :)

* [test] Add test for `snappy`

* [test] Add test for `leveldb`

* [test] Add test for `libgeos`

* [test] Add test for `libmysqlclient`

* [test] Add test for `openal`

* [test] Make the `super` calls Python3 style

* [test] Move mock tests outside context manager...

Because there is no need to do it there.

Also rewrote the inline comments.

* Recipes tests enhancements (#1984)

This is a follow up of #1982

In here we do:
  - Move from `__new__` to `__init__` for `BaseTestForMakeRecipe` ([discussed at here](#1982 (comment)))
  - Convert cls attributes to instance attributes ([discussed at here](#1982 (comment)))
  -  Remove `mock` dependency for py3 tests (Because, as per Python 3.3+, `mock` it's a built-in-module). (Unfortunately we still will have a couple of `import mock` entries that we cannot remove until we completely remove python2 from our tests)

* [test] From `__new__` to `__init__` for `BaseTestForMakeRecipe`

* [test] Remove mock dependency for py3 tests

Because, as per Python 3.3+, `mock` it's a built-in-module

* [test] Convert cls attributes to instance attributes

Because we may have some side effects without willing, considering that cls attributes are shared between instances.

* Fixes test_virtualenv and test_venv failing, closes #1994 (#1995)

Recent pep517 release seems to break tests.

* Made p4a use per-arch dist build dirs (#1986)

* Made p4a use per-arch dist build dirs

* Fixed up check on existing folder when overwriting distributions

* Improved Distribution.get_distribution api

* Fixed test_archs.py

* Fixed test_bootstrap.py

* Fixed test_distribution.py

* Fixed recipes tests

* Fixed formatting

* Made sure whole build process accesses dist_dir correctly

* Fixed apk output name formatting by moving version to end of string

* Further test fixes following dist_dir changes

* Removed unnecessary variable

* Fixes libiconv & libzbar configure host

Having `--host=x86` was making the configure script fail at enabling
shared library build on `x86`. This was resulting in failing to copy
`libiconv.so` and `libzbar.so` on `x86` arch.

* Updates Java version troubleshooting (#1991)

Adds the NoClassDefFoundError XmlSchema case and groups related cases
together. Gives instructions for both Ubuntu and macOS to fix.

* Made on-device unit tests app use the develop branch by default (#1985)

* Updated version to 2019.10.06

Co-authored-by: Pol Canelles <[email protected]>
Co-authored-by: Gabriel Pettier <[email protected]>
Co-authored-by: Philipp Auersperg-Castell <[email protected]>
Co-authored-by: Richard Larkin <[email protected]>
Co-authored-by: Andre Miras <[email protected]>

* Bumps openssl to 1.1.1f

* Updated version to 2019.10.06.post0

Co-authored-by: Pol Canelles <[email protected]>
Co-authored-by: Gabriel Pettier <[email protected]>
Co-authored-by: Philipp Auersperg-Castell <[email protected]>
Co-authored-by: Richard Larkin <[email protected]>
Co-authored-by: Andre Miras <[email protected]>
Co-authored-by: Andre Miras <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants