MCPcopy Index your code
hub / github.com/python/cpython / setup_ci

Function setup_ci

Android/android.py:322–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

320
321
322def setup_ci():
323 if "GITHUB_ACTIONS" in os.environ:
324 # Enable emulator hardware acceleration
325 # (https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/).
326 if platform.system() == "Linux":
327 run(
328 ["sudo", "tee", "/etc/udev/rules.d/99-kvm4all.rules"],
329 input='KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n',
330 text=True,
331 )
332 run(["sudo", "udevadm", "control", "--reload-rules"])
333 run(["sudo", "udevadm", "trigger", "--name-match=kvm"])
334
335 # Free up disk space by deleting unused versions of the NDK
336 # (https://github.com/freakboy3742/pyspamsum/pull/108).
337 for line in ENV_SCRIPT.read_text().splitlines():
338 if match := re.fullmatch(r"ndk_version=(.+)", line):
339 ndk_version = match[1]
340 break
341 else:
342 raise ValueError(f"Failed to find NDK version in {ENV_SCRIPT.name}")
343
344 for item in (android_home / "ndk").iterdir():
345 if item.name[0].isdigit() and item.name != ndk_version:
346 delete_glob(item)
347
348
349def setup_sdk():

Callers 1

run_testbedFunction · 0.85

Calls 6

delete_globFunction · 0.85
isdigitMethod · 0.80
runFunction · 0.70
splitlinesMethod · 0.45
read_textMethod · 0.45
iterdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…