diff options
author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-11-16 11:41:17 +0100 |
---|---|---|
committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-12-04 13:06:41 +0100 |
commit | 0e81f0eb1d340d3a73ebe3c57bf935b357fd2dbc (patch) | |
tree | eb4ffd50b01aa45b9a4412bfcaf8e5a1df1e1854 /sources/pyside-tools/pyside_tool.py | |
parent | e7e46d0516e079c20c77da12e1cb63d0973fa648 (diff) |
Android Deployment: Add requirements.txt
- Adds a requirements-android.txt file
- Simplifies code in pyside_tool.py
- Sets up installing requirements in tests without redundantly
listing the dependent packages
Task-number: PYSIDE-1612
Pick-to: 6.6
Change-Id: If98f6458673bc72103c898e078e6a16f1cf38b12
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/pyside_tool.py')
-rw-r--r-- | sources/pyside-tools/pyside_tool.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py index 1648b2943..280c9ec3b 100644 --- a/sources/pyside-tools/pyside_tool.py +++ b/sources/pyside-tools/pyside_tool.py @@ -197,11 +197,13 @@ def android_deploy(): if not sys.platform == "linux": print("pyside6-android-deploy only works from a Linux host") else: - dependent_packages = ["jinja2", "pkginfo"] - for dependent_package in dependent_packages: - if not bool(importlib.util.find_spec(dependent_package)): - command = [sys.executable, "-m", "pip", "install", dependent_package] - subprocess.run(command) + android_requirements_file = Path(__file__).parent / "requirements-android.txt" + with open(android_requirements_file, 'r', encoding='UTF-8') as file: + while line := file.readline(): + dependent_package = line.rstrip() + if not bool(importlib.util.find_spec(dependent_package)): + command = [sys.executable, "-m", "pip", "install", dependent_package] + subprocess.run(command) pyside_script_wrapper("android_deploy.py") |