aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside-tools/deploy.py')
-rw-r--r--sources/pyside-tools/deploy.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/sources/pyside-tools/deploy.py b/sources/pyside-tools/deploy.py
index 576c01f9d..6cb6d4d9c 100644
--- a/sources/pyside-tools/deploy.py
+++ b/sources/pyside-tools/deploy.py
@@ -34,13 +34,14 @@ import traceback
from pathlib import Path
from textwrap import dedent
-from deploy_lib import (MAJOR_VERSION, Config, cleanup, config_option_exists,
- finalize, create_config_file, PythonExecutable, Nuitka)
+from deploy_lib import (MAJOR_VERSION, DesktopConfig, cleanup, config_option_exists,
+ finalize, create_config_file, PythonExecutable, Nuitka,
+ HELP_EXTRA_MODULES, HELP_EXTRA_IGNORE_DIRS)
def main(main_file: Path = None, name: str = None, config_file: Path = None, init: bool = False,
loglevel=logging.WARNING, dry_run: bool = False, keep_deployment_files: bool = False,
- force: bool = False):
+ force: bool = False, extra_ignore_dirs: str = None, extra_modules_grouped: str = None):
logging.basicConfig(level=loglevel)
if config_file and not config_file.exists() and not main_file.exists():
@@ -56,6 +57,18 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
config = None
logging.info("[DEPLOY] Start")
+ if extra_ignore_dirs:
+ extra_ignore_dirs = extra_ignore_dirs.split(",")
+
+ extra_modules = []
+ if extra_modules_grouped:
+ tmp_extra_modules = extra_modules_grouped.split(",")
+ for extra_module in tmp_extra_modules:
+ if extra_module.startswith("Qt"):
+ extra_modules.append(extra_module[2:])
+ else:
+ extra_modules.append(extra_module)
+
python = PythonExecutable(dry_run=dry_run, init=init, force=force)
config_file_exists = config_file and Path(config_file).exists()
@@ -65,8 +78,9 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
config_file = create_config_file(dry_run=dry_run, config_file=config_file,
main_file=main_file)
- config = Config(config_file=config_file, source_file=main_file, python_exe=python.exe,
- dry_run=dry_run, existing_config_file=config_file_exists)
+ config = DesktopConfig(config_file=config_file, source_file=main_file, python_exe=python.exe,
+ dry_run=dry_run, existing_config_file=config_file_exists,
+ extra_ignore_dirs=extra_ignore_dirs)
# set application name
if name:
@@ -81,6 +95,8 @@ def main(main_file: Path = None, name: str = None, config_file: Path = None, ini
if python.is_pyenv_python() and add_arg not in config.extra_args:
config.extra_args += add_arg
+ config.modules += list(set(extra_modules).difference(set(config.modules)))
+
# writing config file
# in the case of --dry-run, we use default.spec as reference. Do not save the changes
# for --dry-run
@@ -153,7 +169,11 @@ if __name__ == "__main__":
parser.add_argument("--name", type=str, help="Application name")
+ parser.add_argument("--extra-ignore-dirs", type=str, help=HELP_EXTRA_IGNORE_DIRS)
+
+ parser.add_argument("--extra-modules", type=str, help=HELP_EXTRA_MODULES)
+
args = parser.parse_args()
main(args.main_file, args.name, args.config_file, args.init, args.loglevel, args.dry_run,
- args.keep_deployment_files, args.force)
+ args.keep_deployment_files, args.force, args.extra_ignore_dirs, args.extra_modules)