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 2020.06.02 #2225

Merged
merged 62 commits into from
Jun 2, 2020
Merged

Release 2020.06.02 #2225

merged 62 commits into from
Jun 2, 2020

Conversation

AndreMiras
Copy link
Member

@AndreMiras AndreMiras commented Jun 2, 2020

  • Check that the builds are passing
  • Run the tests locally via tox: tox.log 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 (or download from github actions) and run the following testapps for arch armeabi-v7a and arm64-v8a:
    • on_device_unit_tests
      • armeabi-v7a (cd testapps/on_device_unit_tests && PYTHONPATH=.:../../ python3 setup.py apk --ndk-dir=<your-ndk-dir> --sdk-dir=<your-sdk-dir> --arch=armeabi-v7a --debug)
      • arm64-v8a (cd testapps/on_device_unit_tests && PYTHONPATH=.:../../ python3 setup.py apk --ndk-dir=<your-ndk-dir> --sdk-dir=<your-sdk-dir> --arch=arm64-v8a --debug)
  • Check that the version number is correct

AndreMiras and others added 30 commits April 29, 2020 14:21
Running the freshly compiled python binary from another Python
process (e.g. sh module or os.system()) may get wrongly detected as
if it was ran directly from the venv.
This happens when `pyvenv.cfg` is present (e.g. venv/pyvenv.cfg).
It makes `sysconfig.is_python_build()` returns `False` instead of `True`
since it's using the compiled interpreter (e.g. ./build-dir/python).
https://docs.python.org/3/library/sysconfig.html#sysconfig.is_python_build
https://github.com/python/cpython/blob/v3.8.2/Lib/sysconfig.py#L127
This is because the `sys._home` attribute is used during the detection.
The issue was first seen in macOS venv which generates the `pyvenv.cfg`.
To compare both behaviours, try the following within and without a venv:
```python
import os
os.system("./build-dir/python -E -c 'import sysconfig; print(sysconfig._sys_home)'")
```
One would return `/usr/local/bin` and the other `None`

Refs:
- kivy/kivy-ios#401
- #2063
* Switch to using Gradle srcDir props for extra source dirs.

* Add warning about only supporting source dir includes with gradle.

* Fixed typos in gradle source directory warning

Co-authored-by: Alexander Taylor <[email protected]>
* command line option to add to the assets/ directory

* allow custom destination paths

* code review suggestions

* fix bugs sleepliy introduced in commit "code review suggestions"

* flake8 compliance
As discussed on the Discord, this is a recipe to build apps based on
SDL2-based pygame.

It currently references a RC until we have an official stable
release of pygame based on SDL2 with android support.

Simple examples have been tested by other pygame users (it doesn't just
build on my own machine) but some pygame functionality is still untested,
and some dependencies like freetype, postmidi and libjpeg are currently
not part of the build. It's usable, but not complete.
Also removes deprecated error troubleshooting targeting Python 2.
…s fixed (#2113)

* Bump to SDL2 2.0.10 & make sure to extract .java from SDL2 tarball

* Made SDL2 patching do a dry run to check it will work

* Update pythonforandroid/bootstraps/common/build/build.py

Co-authored-by: Pol Canelles <[email protected]>

* Made bootstrap tests clear the Recipe cache in setup

* Made test_should_build not check non-existing storage_dir

Authored-by: Jonas Thiem <[email protected]>
Updates version number to 2020.04.29
Tries to keep the `current_directory` context manager as scoped as
possible. Also use the `contextlib.suppress` context manager when
appropriated as it's more concise.
Actually simply reverted few files:
```sh
git checkout master -- \
    pythonforandroid/recipes/sdl2/__init__.py \
    pythonforandroid/bootstraps/sdl2/build/src/patches/SDLActivity.java.patch \
    pythonforandroid/bootstraps/sdl2/build/src/main/java/org/kivy/android/PythonActivity.java
```
- fixes #2167
- fixes #2169
- Updates the PyPI release process (handled by the CI)
- Links both Travis and GitHub CI build systems
- Reformats the release checklist to blockcode for markdown
See adb logcat trace after the fix:
```
Android kivy bootstrap done. __name__ is __main__
AND: Ran string
Run user program, change dir and execute entrypoint
Imported unittest
App requirements are:  {'sqlite3', 'python3', 'openssl', 'requests', 'pyjnius', 'libffi'}
Defined test case
Adding Testcase:  tests.test_requirements.Sqlite3TestCase
Adding Testcase:  tests.test_requirements.OpensslTestCase
Adding Testcase:  tests.test_requirements.RequestsTestCase
Adding Testcase:  tests.test_requirements.PyjniusTestCase
Adding Testcase:  tests.test_requirements.LibffiTestCase
Tests to perform are:  {'sqlite3': 'tests.test_requirements.Sqlite3TestCase', 'openssl': 'tests.test_requirements.OpensslTestCase', 'requests': 'tests.test_requirements.RequestsTestCase', 'pyjnius': 'tests.test_requirements.PyjniusTestCase', 'libffi': 'tests.test_requirements.LibffiTestCase'}
..........
----------------------------------------------------------------------
Ran 10 tests in 4.130s

OK
Python for android ended.
```
Also removes unused `mActivity` member.
Note we changed the constructor input parameter to accept a `Context`
object which is a parent class of the previous `Activity` one.
Changes were tested on both kivy and service_only bootstraps.
Also removes the `get_common_dir()` as it's no longer used since #2092
…t_loading

Fixes service only unittest loading
All 3 `Hardware.java` seemed to be the same (minus some formatting).
None of the class seems to be used.
Moves kamranzafar/ java directory to common/
…oncurrency

Removes java concurrency/ folder
Got the deprecation warning message since april 2016.
#728
- Avoid duplicate imports
- Avoid importing anything from the package java.lang
- Avoid unused imports
- Avoid unused local variables
- Avoid unused private fields
- No need to import a type that lives in the same package
- Unnecessary use of fully qualified name due to existing import

In the future we may want to add a dedicated Java linting job in the CI.
AndreMiras and others added 27 commits May 12, 2020 09:16
🐛 Fixes flake8 errors post update
This helper class shares code to be reused between the `PythonActivity`
classes of the different bootstraps.
Also adds few minor adjustments to existing classes.
…va_code

PythonActivityUtil helper for unpacking data
This covers an 84% of the python recipe.
Most of the uncovered code is related with `set_lib_flags` (marked with a `todo` inline comment)
Because, I forgot to implement it when I first wrote the test at 535b39d

**Note:** I replaced `os.path.isfile` by `pathlib.Path(<any-path>).is_file()` because:
  - It seems that when trying to mock `isfile` function, doesn't work as expected (is completely ignored, unless we import the whole `os.path` module)
  - Given the above situation, we must modify the import, so better use the `pathlib` implementation, wich it has several advantages (it handles any kind of path automatically, no matter the platform)
This will cover **100%** of the code for the hostpython3 recipe.
Also we migrate `os.path.exists` and `os.path.isfile` to `pathlib.Path`'s implementation because when we mock these functions, it seems that property `return_value` is being ignored.
Merges/squash #1983
with a rebasing on develop, closes #1983
Documents how to fix the following error:
```
SSLError("Can't connect to HTTPS URL because the SSL module is not available.")
```
If we want to **keep** debug symbols from `.so` files we will use:
  `--with-debug-symbols`

Also:
  - enable debug builds for all bootstraps (AndroidManifest.tmpl.xml)
  - add log message to make it clear what kind of build we will get
* ✨ Add `opencv_extras` recipe

* 🚧 Test `opencv_extras` build via github actions

* ⏪ Revert "🚧 Test `opencv_extras` build via github actions"

This reverts commit eb6cc6b

* 👌 Remove unneeded development inline comment
📝 Attempt to improve the issue template
Using the latest released LTS.
Followed the docs as I was building a project from a fresh macOS install.
📝 Updates install and troubleshooting docs
Gradle 6 supports OpenJDK up to version 13.
Also refs: kivy/buildozer#1135
The `requests` module has `urllib3`, `chardet` and `idna` as dependencies.
This used to be handled dynamically thanks to the `requests` recipe.
This is a drawback and side effect of #2202.
The on device error was:
```
Imported unittest
loading tests...
running unittest...
unittest result is:
....EE........
======================================================================
ERROR: test_import_module (tests.test_requirements.RequestsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/app/testapps/on_device_unit_tests/build/bdist.android-armeabi-v7a/test_app/tests/mixin.py", line 17, in test_import_module
  File "/home/user/.local/share/python-for-android/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/importlib/__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/.local/share/python-for-android/build/python-installs/bdist_unit_tests_app/requests/__init__.py", line 43, in <module>
ModuleNotFoundError: No module named 'urllib3'

======================================================================
ERROR: test_run_module (tests.test_requirements.RequestsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/app/testapps/on_device_unit_tests/build/bdist.android-armeabi-v7a/test_app/tests/test_requirements.py", line 74, in test_run_module
  File "/home/user/.local/share/python-for-android/build/python-installs/bdist_unit_tests_app/requests/__init__.py", line 43, in <module>
ModuleNotFoundError: No module named 'urllib3'

----------------------------------------------------------------------
Ran 14 tests in 0.591s

FAILED (errors=2)

Ran tests
```
Also sneaked a minor documentation regression fix (bug introduced in #2219).
🐛 Adds missing requests sub dependencies
@AndreMiras AndreMiras requested a review from inclement June 2, 2020 21:10
Copy link
Member

@inclement inclement left a comment

Choose a reason for hiding this comment

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

Excellent!

@AndreMiras AndreMiras merged commit 1b3b0e3 into master Jun 2, 2020
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.

7 participants