Skip to content

Commit f5e0855

Browse files
committed
🐛 Adds missing requests sub dependencies
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 kivy#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 kivy#2219).
1 parent bff8a2a commit f5e0855

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ testapps-with-numpy/%: virtualenv
3838
$(eval $@_APP_ARCH := $(shell basename $*))
3939
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
4040
python setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
41-
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools,numpy \
41+
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
4242
--arch=$($@_APP_ARCH)
4343

4444
testapps/%: virtualenv

doc/source/troubleshooting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Remember to always clean the build before rebuilding (`p4a clean builds`, or wit
211211

212212
On Ubuntu and derivatives::
213213

214-
apt install openssl
214+
apt install libssl-dev
215215
p4a clean builds # or with: buildozer `buildozer android clean
216216

217217
On macOS::

testapps/on_device_unit_tests/setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
app requirements via the dictionary `options`. Here you have some examples
1313
to build the supported app modes::
1414
15-
- kivy *basic*: `sqlite3,libffi,openssl,pyjnius,kivy,python3,requests`
15+
- kivy *basic*: `sqlite3,libffi,openssl,pyjnius,kivy,python3,requests,
16+
urllib3,chardet,idna`
1617
- kivy *images/graphs*: `kivy,python3,numpy,matplotlib,Pillow`
1718
- kivy *encryption*: `kivy,python3,cryptography,pycryptodome,scrypt,
1819
m2crypto,pysha3`
@@ -39,7 +40,8 @@
3940
'apk':
4041
{
4142
'requirements':
42-
'sqlite3,libffi,openssl,pyjnius,kivy,python3,requests',
43+
'sqlite3,libffi,openssl,pyjnius,kivy,python3,requests,urllib3,'
44+
'chardet,idna',
4345
'android-api': 27,
4446
'ndk-api': 21,
4547
'dist-name': 'bdist_unit_tests_app',

0 commit comments

Comments
 (0)