3.2 KiB
3.2 KiB
Agent Guide
Project Shape
- This is a small Python project: the runtime entrypoint is
src/sideload.py; tests are intests/test_sideload.py. - The package requires Python 3.11+ because configuration is parsed with the standard-library
tomllib. - The
sideloadconsole command is declared inpyproject.toml; install the project editable before using it from a checkout.
Setup And Commands
- Recommended setup:
python -m venv .venv && .venv/bin/pip install -e .. - Run the full test suite with
python -m pytest tests -qorpython -m pytest tests/ -v. - Run the CLI help after editable installation with
.venv/bin/sideload --help. - Use
config.example.tomlas the template and copy it to the Git-ignoredconfig.toml; do not add a real configuration containing local devices or app choices. - No linter, formatter, type checker, code generator, or CI workflow is configured; tests and
python -m compileall -q src testsare the available local checks. README.mdis the canonical English user documentation;README.fr.mdis its French translation. Keep the language links and user-facing behavior synchronized when changing the CLI.
Runtime Constraints
- Real installations require
adband eitheraapt2oraaptinPATH; tests must continue to mock them rather than require a phone or Android SDK. aapt2 dump packagename(withaapt dump badgingfallback) is mandatory pre-install validation; never add an installation path that bypasses package-ID validation.--update-allmust read the installedversionCodewithadb shell dumpsys package, read the remote APKversionCodewithaapt2 dump badging(falling back toaapt dump badging), and install only when the remote code is strictly greater.--update-allmust report configured apps that are not installed without downloading them, continue after per-app errors, and print a final summary. Device preparation and selection must happen once per batch.- ADB commands must remain argument lists passed with
shell=False; do not construct shell command strings or useshell=True. - Multiple connected ADB devices require explicit interactive selection or
--device/-s; never silently choose the first device. - Wi-Fi ADB uses an explicit
HOST:PORTfrom[adb]; do not add network scanning or implicit device discovery. - Downloads are HTTPS-only and cached under the configured cache directory; preserve SHA-256 checks and atomic temporary-file downloads.
Source And Test Details
- Application entries use
name,package,source, andurl; GitHub/GitLab entries may needasset_patternwhen a release has multiple APKs. - F-Droid resolution reads
index-v2.jsonand versions are nested underpackages[package].versions; keep numericversionCodeordering and correct URL joining. - GitHub and GitLab release parsing must reject ambiguous APK assets instead of selecting arbitrarily; do not treat GitLab source archives as APKs.
- Network, ADB, and Android SDK tool behavior is mocked in the unit tests; add response fixtures or mocks for new integrations instead of live API tests.
- Tests for
--update-allshould cover absent packages, equal/older/newer version codes, aapt2 fallback, dry-run, partial failures, summary output, and the single-device preparation path.