Skip to content

david-fischer/generate-p4a-recipe

Repository files navigation

Recipe Generator for python-for-android

Python-CLI to easily create recipes for python-for-android. I use it for building a kivy-app with buildozer.

This is useful if the installation with pip fails or you don't want to add all requirements manually to your buildozer.spec file, only to note on building that the dependencies itself have unmet dependencies.

  • Searches PyPI or Github for source-url by api-request
  • Prompts the user with a choice for possible versions
  • Fetches the dependencies of a package recursively by use of pipdeptree on the locally installed version of the package

The generated recipe should be seen as a template, even though in simple cases it can work out of the box. See Troubleshooting

🚧 Setup

Installation

pip install git+https://github.com/david-fischer/generate-p4a-recipe.git

Local recipes with buildozer

We need to add the path of our recipes in the apropriate place in the buildozer.spec of the project:

p4a.local_recipes = ./src/python-for-android/recipes/

🔧 Usage

Usage example:

python -m generate_p4a_recipe --package-name="some_package" --project-dir="/path/to/kivy-project/"

Help text:

python /path/to/script/generate_p4a_recipe.py -h

NAME
    generate_p4a_recipe.py - Recipe Generator for python-for-android

SYNOPSIS
    generate_p4a_recipe.py --package_name=PACKAGE_NAME <flags>

DESCRIPTION
    Obtains the necessary data to fill a recipe template for a package and saves it
    under <project_dir>/scr/python-for-android/recipes/<package_name>/__init__.py

    For full functionality <package_name> (in the desired version) and pipdeptree
    should be installed in the current python environment.

    For further info see https://github.com/david-fischer/generate-p4a-recipe#-troubleshooting .

ARGUMENTS
    PACKAGE_NAME
        Name of the package for which the recipe should be generated.

FLAGS
    --url=URL
        Source of the package. If not set, user is prompted with possible options.
    --version=VERSION
        If url is not set, user is prompted with possible options.
    --recipe_class=RECIPE_CLASS
        If not set, user is prompted with possible options.
    --project_dir=PROJECT_DIR
        Directory where the recipe should be saved. Defaults to ".".

🎯 Troubleshooting

📦 Dependencies

About

CLI to generate recipes for python-for-android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages