Skip to main content

Python wrapper for AOSP tasks

Project description

aosp

Python wrapper around an AOSP (Android Open Source Project) source tree. Sources build/envsetup.sh, runs lunch, exposes the resulting build environment as a Python object, and provides convenience accessors for the product-out tree.

Requires sh and yautil (uses docker_sh for sandboxed builds).

Install

pip install -e .

Python ≥ 3.9.

API

from aosp import Aosp, load_aosp, get_env

Aosp

Main object representing one AOSP checkout + build target.

aosp = Aosp(path="/path/to/aosp", build_target="aosp_arm64-eng")
# or
aosp = Aosp.from_path("/path/to/aosp", build_target="aosp_arm64-eng")

Notable properties:

Member Description
path Absolute path to the AOSP root.
build_target The lunch target.
env dict of env vars exported by envsetup.sh + lunch.
build_var dict of build variables from get_build_var.
out AospProductOut — wrapper around $ANDROID_PRODUCT_OUT.
external_paths Extra PATH entries injected when running commands inside the tree.

AospProductOut

Returned by Aosp.out. Helpers for locating files under $ANDROID_PRODUCT_OUT:

Member Returns
dir Absolute path of the product-out directory.
system_dir system/ partition root.
system_lib_dirs All directories on the target's LD_LIBRARY_PATH.
system_bin_dirs All directories on the target's PATH.
rc_path Path to the target's init *.rc.
find_system_lib(basename) List of matching library files across system_lib_dirs.
find_system_bin(basename) List of matching binaries across system_bin_dirs.

load_aosp(...)

Module-level factory (see aosp.aosp.load_aosp) that constructs an Aosp from a config profile.

get_env(path, target=None) -> dict

Lower-level helper: sources build/envsetup.sh in path (and optionally runs lunch <target>), then returns the resulting environment as a dict.

env = get_env("/path/to/aosp", "aosp_arm64-eng")
print(env["ANDROID_PRODUCT_OUT"])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aosp-0.1.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aosp-0.1.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file aosp-0.1.2.tar.gz.

File metadata

  • Download URL: aosp-0.1.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aosp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 37fdb56926fedf0ef971ba6c745aa5dec25fa8a6382e6489e713395f30134b12
MD5 25621daf25a0da1b9efb90f130bda7c5
BLAKE2b-256 b3780fae867f47eccfb7bb0731e70e643f9e647301cc43a71c2624778fffdb08

See more details on using hashes here.

File details

Details for the file aosp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aosp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aosp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 10aa93b9819b157ce2902303a8f66f1e8bdf36a5ce523b1303cf8799df938b7b
MD5 efb5f23cace1ecd01a21cdf818161b4b
BLAKE2b-256 d5c41e30689ef7cf79f42b4f089093fdbe65b114a706768eb2580b954d85d290

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page