-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Playing with on_device_unit_test_app
#2046 - Episode II
#2088
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
Closed
Closed
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e5cd6f4
:package: Refactor (move) `PythonTestMixIn` into `tests.mixin`
opacam 52162ef
:package: Unify most of the test apps into one app
opacam 1ce7d8c
:rocket: Make test app `on_device_unit_tests` the default...
opacam 1ac5309
:pencil: Update docs
opacam f92376c
:rocket: Enhance gh-actions with a matrix for our testapps
opacam 6989cb2
:pencil: Fix typo errors and...
opacam 4dd643a
:white_check_mark: Make a `flask` testapp...
opacam ba86c92
:white_check_mark: Revert "Make a `flask` testapp..."
opacam eb8427e
:rocket: Remove `orientation` kwarg...
opacam ea402c1
:rocket: Build test app for all archs
opacam d108dd1
:rocket: Rename test app
opacam 26c95f2
:pencil: Fix a syntactical error at docstring
opacam b54d8e4
:rocket: Rename `setup_test_app.py` to `setup.py`
opacam cbebd95
:rocket: Disable gh-actions `fail-fast`
opacam 237de3f
:green_heart: Add `testapps/python3-with-numpy/%`
opacam e9c3e0a
:sparkles: Add `libbz2` recipe (libbz2.so)
opacam d404e4b
:white_check_mark: Add tests for `libbz2` recipe
opacam ee24e23
:sparkles: Add `liblzma` recipe (liblzma.so)
opacam 184c6ef
:white_check_mark: Add tests for `liblzma` recipe
opacam 5686941
:sparkles: Add `bz2` and `lzma` support to `Python3`
opacam a0c1a92
:sparkles: Add `pandas` recipe
opacam 5da75de
:white_check_mark: Add tests for `pandas` recipe
opacam 1a4deb7
:sparkles: Add `mplfinance` recipe
opacam 9228336
:rocket: Add `KiwisolverTestCase` to `on_device_unit_tests_app`
opacam 51a02c0
:rocket: Add `PandasTestCase` to `on_device_unit_tests_app`
opacam 6e4972a
:rocket: Add `MplfinanceTestCase` to `on_device_unit_tests_app`
opacam 33a8a9a
:green_heart: Add new dependency (`autopoint`)
opacam 9d111d9
:bug: Remove `pandas` dependencies from `setup.py`
opacam fc0c6a6
:bug: Create install dir for `liblzma`
opacam 47bbd9f
:construction: Pass the apk's requirements from the `CI` files
opacam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from multiprocessing import cpu_count | ||
|
||
from pythonforandroid.archs import Arch | ||
from pythonforandroid.recipe import Recipe | ||
from pythonforandroid.logger import shprint | ||
from pythonforandroid.util import current_directory | ||
import sh | ||
|
||
|
||
class LibBz2Recipe(Recipe): | ||
|
||
# there is not an official release yet... | ||
# so pinned to last commit at the time of writing | ||
version = "1.0.8" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that doesn't look like a pinned commit to me 🤔 |
||
url = "https://sourceware.org/pub/bzip2/bzip2-{version}.tar.gz" | ||
built_libraries = {"libbz2.so": ""} | ||
patches = ["lib_android.patch"] | ||
|
||
def build_arch(self, arch: Arch) -> None: | ||
env = self.get_recipe_env(arch) | ||
with current_directory(self.get_build_dir(arch.arch)): | ||
shprint( | ||
sh.make, | ||
"-j", | ||
str(cpu_count()), | ||
f'CC={env["CC"]}', | ||
f'AR={env["AR"]}', | ||
f'RANLIB={env["RANLIB"]}', | ||
"-f", | ||
"Makefile-libbz2_so", | ||
_env=env, | ||
) | ||
|
||
def get_library_includes(self, arch: Arch) -> str: | ||
"""Returns a string with the appropriate `-I<lib directory>` to link | ||
with the bz2 lib. This string is usually added to the environment | ||
variable `CPPFLAGS`""" | ||
return " -I" + self.get_build_dir(arch.arch) | ||
|
||
def get_library_ldflags(self, arch: Arch) -> str: | ||
"""Returns a string with the appropriate `-L<lib directory>` to link | ||
with the bz2 lib. This string is usually added to the environment | ||
variable `LDFLAGS`""" | ||
return " -L" + self.get_build_dir(arch.arch) | ||
|
||
@staticmethod | ||
def get_library_libs_flag() -> str: | ||
"""Returns a string with the appropriate `-l<lib>` flags to link with | ||
the bz2 lib. This string is usually added to the environment | ||
variable `LIBS`""" | ||
return " -lbz2" | ||
|
||
|
||
recipe = LibBz2Recipe() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Set default compiler to `clang` and disable versioned shared library | ||
--- bzip2-1.0.8/Makefile-libbz2_so.orig 2019-07-13 19:50:05.000000000 +0200 | ||
+++ bzip2-1.0.8/Makefile-libbz2_so 2020-03-13 20:10:32.336990786 +0100 | ||
@@ -22,7 +22,7 @@ | ||
|
||
|
||
SHELL=/bin/sh | ||
-CC=gcc | ||
+CC=clang | ||
BIGFILES=-D_FILE_OFFSET_BITS=64 | ||
CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) | ||
|
||
@@ -35,13 +35,11 @@ OBJS= blocksort.o \ | ||
bzlib.o | ||
|
||
all: $(OBJS) | ||
- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) | ||
- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 | ||
- rm -f libbz2.so.1.0 | ||
- ln -s libbz2.so.1.0.8 libbz2.so.1.0 | ||
+ $(CC) -shared -Wl,-soname=libbz2.so -o libbz2.so $(OBJS) | ||
+ $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so | ||
|
||
clean: | ||
- rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared | ||
+ rm -f $(OBJS) bzip2.o libbz2.so bzip2-shared | ||
|
||
blocksort.o: blocksort.c | ||
$(CC) $(CFLAGS) -c blocksort.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
from os.path import exists, join | ||
from multiprocessing import cpu_count | ||
|
||
from pythonforandroid.archs import Arch | ||
from pythonforandroid.recipe import Recipe | ||
from pythonforandroid.logger import shprint | ||
from pythonforandroid.util import current_directory, ensure_dir | ||
import sh | ||
|
||
|
||
class LibLzmaRecipe(Recipe): | ||
|
||
version = '5.2.4' | ||
url = 'https://tukaani.org/xz/xz-{version}.tar.gz' | ||
built_libraries = {'liblzma.so': 'install/lib'} | ||
|
||
def build_arch(self, arch: Arch) -> None: | ||
env = self.get_recipe_env(arch) | ||
install_dir = join(self.get_build_dir(arch.arch), 'install') | ||
with current_directory(self.get_build_dir(arch.arch)): | ||
if not exists('configure'): | ||
shprint(sh.Command('./autogen.sh'), _env=env) | ||
shprint(sh.Command('autoreconf'), '-vif', _env=env) | ||
shprint(sh.Command('./configure'), | ||
'--host=' + arch.command_prefix, | ||
'--prefix=' + install_dir, | ||
'--disable-builddir', | ||
'--disable-static', | ||
'--enable-shared', | ||
|
||
'--disable-xz', | ||
'--disable-xzdec', | ||
'--disable-lzmadec', | ||
'--disable-lzmainfo', | ||
'--disable-scripts', | ||
'--disable-doc', | ||
|
||
_env=env) | ||
shprint( | ||
sh.make, '-j', str(cpu_count()), | ||
_env=env | ||
) | ||
|
||
ensure_dir('install') | ||
shprint(sh.make, 'install', _env=env) | ||
|
||
def get_library_includes(self, arch: Arch) -> str: | ||
"""Returns a string with the appropriate `-I<lib directory>` to link | ||
with the lzma lib. This string is usually added to the environment | ||
variable `CPPFLAGS`""" | ||
return " -I" + join( | ||
self.get_build_dir(arch.arch), 'install', 'include', | ||
) | ||
|
||
def get_library_ldflags(self, arch: Arch) -> str: | ||
"""Returns a string with the appropriate `-L<lib directory>` to link | ||
with the lzma lib. This string is usually added to the environment | ||
variable `LDFLAGS`""" | ||
return " -L" + join( | ||
self.get_build_dir(arch.arch), self.built_libraries['liblzma.so'], | ||
) | ||
|
||
@staticmethod | ||
def get_library_libs_flag() -> str: | ||
"""Returns a string with the appropriate `-l<lib>` flags to link with | ||
the lzma lib. This string is usually added to the environment | ||
variable `LIBS`""" | ||
return " -llzma" | ||
|
||
|
||
recipe = LibLzmaRecipe() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an modified
->a modified