Skip to content

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
wants to merge 30 commits into from

Conversation

opacam
Copy link
Member

@opacam opacam commented Mar 17, 2020

This is not to be reviewed nor merged, of course commented if you want, but the purpose of this is to play a little more with some new recipes and the on_device_unit_test_app (#2046)...so I understand this as some kind of continuation of #2076 (just to have a new start point with the current develop branch).

I'm not sure if we have to include all the changes I advance to you in here, but sure that there are some new recipes that can be very useful. I made this to make it work mplfinance, a kind of matplotlib's extension. To do so I faced several issues along the way, which forced me to introduce a couple of libraries that will allow us to build some python compiled modules that currently aren't compiled: _bz2.cpython-38.so and _lzma.cpython-38.so. Also I was forced to create a Pandas recipe...this one is interesting right?

Anyway, If you guys find this interesting, I will create separate PRs...so give me your thoughts about this:

  • should we include libraries: bz2 and lzma?
  • should we enable the built of some extra python modules: _bz2.cpython-38.so and _lzma.cpython-38.so (depends on previous steps)?
  • should we add a pandas recipe (depends on previous steps)?
  • should we introduce mplfinance recipe (again...depends on previous steps)?

I think that the first three points are worth it...the last one probably too (it doesn't seem hard to maintain).

opacam added 30 commits March 14, 2020 17:52
So depending on the supplied recipes, a different test app will be ran.

The supported test apps are:
  - kivy
  - flask
  - no-gui
for our CI providers and `rebuild_updated_recipes.py` because we recently removed
the old test app that we made use of.
Remove sentence regarding python2 compatibility...
because python2 it's almost at the end of his life
So we can get an apk via gh-actions

Notes:
  - this way the reviewers can install the flask apk without making the build
  - these changes will be reverted in the next
    commit...since we want a kivy app as our default)
in case that we detect that p4a will build an `service_only` app.

Note: if we don't do this we wil get errors once we try to create our apk with the target distribution
and:
  - remove Python 2 test apps because:
      + we already test Python 2 with travis
      + Python 2 it's almost at the end of his life
  - change gh-actions job title (because it looks better)
Because it looks better and is more readable.
Because reducing filename to `setup.py` will make our cli arguments shorter and source code cleaner
So our matrix gh-actions builds will not be cancelled if some arch fails
which is very useful to fix specific arch issues.

See also: kivy#2073
Fix our `CI` travis tests by explicitly omit the numpy build for MacOsX.
Yeah...not actually a solution for MacOsX...but at least we will have
the `green tick mark` for our `CI` tests...but we have a problem with
MacOsX and numpy recipe :<

See also: kivy#2073
To fix travis CI tests when trying to build `liblzma` recipe
Because it causes an error when running from `CI`
@opacam opacam added the WIP label Mar 17, 2020
@opacam opacam requested review from AndreMiras and inclement March 17, 2020 21:54
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.

Even though the PR is too big to my personal taste, this is some pretty impressive work again 👏
Since it's very big we may overlook a lot of things, but I'm OK to take the risk given the improvements it provides.
I wrote some minor comments, but nothing blocking from my point of view.
Thanks for your time and efforts ❤️

@@ -103,30 +103,31 @@ Using python-for-android commands directly from the pull request files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Enter inside the directory of the cloned repository in the above
step and run p4a command with proper args, eg::
step and run p4a command with proper args, eg (to test an modified
Copy link
Member

Choose a reason for hiding this comment

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

an modified -> a modified


# there is not an official release yet...
# so pinned to last commit at the time of writing
version = "1.0.8"
Copy link
Member

Choose a reason for hiding this comment

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

that doesn't look like a pinned commit to me 🤔

@@ -0,0 +1,18 @@

Copy link
Member

Choose a reason for hiding this comment

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

Typically this recipe as well as pandas could have been added in another dedicated PR, right?
This two recipe alone are simple enough to review, but in general if should try to reduce huge PR when possible to reviewers don't get scared/discouraged by the size of it or lose focus during the review. Also if large PR receive a lot of comments then the contributor might as well get discouraged or simply side tracked and drop it.
By the way line one is empty 😄

Comment on lines +9 to +10
version = 'cde5008'
url = 'https://github.com/matplotlib/mplfinance/archive/{version}.zip'
Copy link
Member

Choose a reason for hiding this comment

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

Jugging from PyPI there're some alpha releases we could use

Suggested change
version = 'cde5008'
url = 'https://github.com/matplotlib/mplfinance/archive/{version}.zip'
version = '0.12.3a3'
url = 'https://pypi.python.org/packages/source/m/mplfinance/mplfinance-{version}.tar.gz'

only the requirements you ask for (so if you build with requirements
other than those specified, the tests may fail). It also has no gui
yet, the results must be checked via logcat.
This test app can be build via `setup.py` or via buildozer. In both
Copy link
Member

Choose a reason for hiding this comment

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

can be build -> can be built

This is the `setup.py` file for the `on device unit test app`.

In this module we can control how will be built our test app. Depending on
our requirements we can build an kivy, flask or a non-gui app. We default to an
Copy link
Member

Choose a reason for hiding this comment

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

an kivy -> a kivy


In this module we can control how will be built our test app. Depending on
our requirements we can build an kivy, flask or a non-gui app. We default to an
kivy app, since the python-for-android project its a sister project of kivy.
Copy link
Member

Choose a reason for hiding this comment

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

its a sister -> is a sister

@inclement
Copy link
Member

Since I'm a little late, what's the status of this, does anything still need comments?

@opacam
Copy link
Member Author

opacam commented Mar 31, 2020

Actually we can close this because this was only a draft and, the important stuff, we have it already merged in separate PRs, anyhow...there maybe some interesting tests for the on_device_unit_tests and one recipe for mplfinance, but not to be done here...so closing this and...
¡¡thanks to be here guys!!
😄

@opacam opacam closed this Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants