1*3c875a21SAndroid Build Coastguard Worker# external_updater developer documentation 2*3c875a21SAndroid Build Coastguard Worker 3*3c875a21SAndroid Build Coastguard WorkerThe documentation on this page is for developers of `external_updater`. If 4*3c875a21SAndroid Build Coastguard Workeryou're looking for user documentation, see the [README.md]. 5*3c875a21SAndroid Build Coastguard Worker 6*3c875a21SAndroid Build Coastguard Worker## Development environment 7*3c875a21SAndroid Build Coastguard Worker 8*3c875a21SAndroid Build Coastguard WorkerDevelopment of `external_updater` requires a full checkout of the main branch of 9*3c875a21SAndroid Build Coastguard WorkerAOSP, and a lunched target (any target). See [Get started with Android 10*3c875a21SAndroid Build Coastguard WorkerDevelopment] for a guide on setting up an AOSP build environment. 11*3c875a21SAndroid Build Coastguard Worker 12*3c875a21SAndroid Build Coastguard WorkerNote: This project uses Python 3.11. You may find [pyenv] helpful for installing 13*3c875a21SAndroid Build Coastguard Workerand managing multiple versions of Python. 14*3c875a21SAndroid Build Coastguard Worker 15*3c875a21SAndroid Build Coastguard WorkerNot all the Python tools used here are available in AOSP. For managing those, we 16*3c875a21SAndroid Build Coastguard Workerrecommend using Poetry. To install the necessary Python dependencies: 17*3c875a21SAndroid Build Coastguard Worker 18*3c875a21SAndroid Build Coastguard Worker```bash 19*3c875a21SAndroid Build Coastguard Worker$ poetry install 20*3c875a21SAndroid Build Coastguard Worker``` 21*3c875a21SAndroid Build Coastguard Worker 22*3c875a21SAndroid Build Coastguard Worker[README.md]: ../README.md 23*3c875a21SAndroid Build Coastguard Worker[pyenv]: https://github.com/pyenv/pyenv 24*3c875a21SAndroid Build Coastguard Worker[Get started with Android Development]: https://source.android.com/docs/setup 25*3c875a21SAndroid Build Coastguard Worker 26*3c875a21SAndroid Build Coastguard Worker## Development tasks 27*3c875a21SAndroid Build Coastguard Worker 28*3c875a21SAndroid Build Coastguard WorkerThe easiest way to activate the virtual environment is 29*3c875a21SAndroid Build Coastguard Workerto create a nested shell with: 30*3c875a21SAndroid Build Coastguard Worker 31*3c875a21SAndroid Build Coastguard Worker```bash 32*3c875a21SAndroid Build Coastguard Worker$ poetry shell 33*3c875a21SAndroid Build Coastguard Worker``` 34*3c875a21SAndroid Build Coastguard Worker 35*3c875a21SAndroid Build Coastguard Worker`poetry shell` will activate the virtual environment by creating a nested shell. 36*3c875a21SAndroid Build Coastguard WorkerTo deactivate this virtual environment simply use `deactivate` or `exit`. If you 37*3c875a21SAndroid Build Coastguard Workerprefer not to use `poetry shell`, you must prefix all Python commands with 38*3c875a21SAndroid Build Coastguard Worker`poetry run`, e.g. `poetry run pytest`. It's easier to just use `poetry shell`. 39*3c875a21SAndroid Build Coastguard Worker 40*3c875a21SAndroid Build Coastguard WorkerRun the type checker and linter with `make lint`. 41*3c875a21SAndroid Build Coastguard Worker 42*3c875a21SAndroid Build Coastguard WorkerRun the tests with `make test`. 43*3c875a21SAndroid Build Coastguard Worker 44*3c875a21SAndroid Build Coastguard WorkerRun all of the above with `make check` or just `make`. 45