Description
This is a review of the way Buildozer's (pre-run) dependencies are set-up, and how that set-up is tested.
I hope to follow up with a PR shortly.
Ideally:
- pip should be able to find all the package dependencies of a project (and only those package dependencies).
- If there are version dependencies, pip should be able to find them to select the best version - especially when there are multiple packages to install.
- If dependencies only apply to some uses (testing, generation of documentation, building for a particular platform, etc.) they should be specified in
extras_require
. They will only be installed for users who want that functionality, and allow those users to install all dependencies with relative ease. - The documentation should reflect this, so people know how to set-up their environment.
- The integration tests should confirm that all the necessary dependencies are installed.
- [Outside the scope here: It should be PEP 517 compatible.]
The current system falls short of this ideal in the following ways:
-
Buildozer does not specify the version of Cython.
- There is a known issue that Buildozer doesn't work with Cython V3 and above. See Use a pinned version of
Cython
for now, as most of the recipes are incompatible withCython==3.x.x
#1637 - The tests pre-install a version to pin to 0.29.36.
- However, the specification of acceptable versions should be done in
setup.py
, so anyone who doesn't pre-install Cython still gets the right version. - Thus, the integration tests should NOT pre-install it. They should be testing that the setup process gets it right.
- There is a known issue that Buildozer doesn't work with Cython V3 and above. See Use a pinned version of
-
Buildozer does not specify that it needs
pytest
to run the unit-tests in the/tests
directory.- This triggers warnings in some static-checkers, such as those in PyCharm
pytest
is currently named as a dependencytox.ini
, but you can run unit-tests without tox. The dependency should be added to extras_require for "tests" insetup.py
.coverage
is also installed by tox, but it is not required to run the tests, so need not be mentioned insetup.py
.- Tox still needs to install pytest because it doesn't install Buildozer; it just copies the files.
-
The Android integration test installs
automake
. This is not required for Android. It should be removed to both save time and to show it is not required. -
The Android integration messes with
ssl
links on MacOs:sudo ln -sfn /usr/local/opt/openssl /usr/local/ssl
This is not documented and not required. Notably, it doesn't appear in the ios version. It should be removed.
-
setup.py
unnecessarily requiresvirtualenv
.- It isn't used by Buildozer.
venv
has been part of Python since 3.3, and we no longer support earlier versions than that. - It can be removed. (See also existing PR dependencies: rm
virtualenv
, already usingpython3 -m venv
#1515.) - The documentation tells ios developers to manually
pip install virtualenv
. That instruction should be removed.
- It isn't used by Buildozer.
-
setup.py
unnecessarily requiressh
.- It isn't used by Buildozer.
- However, removing it can cause IOS builds to fail! Because
kivy-ios
needs it. So, the dependency should be fromkivy-ios
, not Buildozer. Unexpectedly,kivy-ios
does listsh
in its requires. It turns out Buildozer's TargetIos attempts to installkivy-ios
from Github, but doesn't actually install it (with pip). It just copies the files across. The dependencies are never resolved. - Remove 'sh' from
setup.py
. Replace it with anextras_require
for ios, that installskivy-ios
. That will install its dependencies, such as sh. - The documentation tells ios developers are to manually pip install
kivy-ios
. That instruction should be replaced with installingbuildozer[ios]
, and let the system work out the individual dependencies.
-
The ios integration test unnecessarily installs
cookiecutter
andpbxproject
.- They appear to be spurious.
- Remove.
-
Buildozer does not specify that it needs
sphinx
to generate the documents in the/docs
directory.- Add it to
extra_requires
fordocs
. - The tests of the documentation (added in Add tests of the documentation. #1683) should be updated to install buildozer[docs], and not directly install sphinx.
- Add it to
-
Tox doesn't need to special-case Python 3 any more.
-
The tests shouldn't install Buildozer as an "editable install" (i.e. the
-e
option onpip install
)- They should test the behaviour the client will see.
- It is incompatible with PEP 517 - and hopefully one day Buildozer will be compatible with PEP 517.