Skip to content

Dependency specification and testing should be cleaned up. #1685

Closed
@Julian-O

Description

@Julian-O

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.

  • 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 dependency tox.ini, but you can run unit-tests without tox. The dependency should be added to extras_require for "tests" in setup.py.
    • coverage is also installed by tox, but it is not required to run the tests, so need not be mentioned in setup.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 requires virtualenv.

    • 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 using python3 -m venv #1515.)
    • The documentation tells ios developers to manually pip install virtualenv. That instruction should be removed.
  • setup.py unnecessarily requires sh.

    • 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 from kivy-ios, not Buildozer. Unexpectedly, kivy-ios does list sh in its requires. It turns out Buildozer's TargetIos attempts to install kivy-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 an extras_require for ios, that installs kivy-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 installing buildozer[ios], and let the system work out the individual dependencies.
  • The ios integration test unnecessarily installs cookiecutter and pbxproject.

    • 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 for docs.
    • 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.
  • 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 on pip 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions