From fed44d043ca72c40fbc553ad26aef5c4c3157bd5 Mon Sep 17 00:00:00 2001 From: orencWaves <61931606+orencWaves@users.noreply.github.com> Date: Sun, 27 Jun 2021 11:14:25 +0300 Subject: [PATCH 1/4] add exclude option to glober (#60) --- pybatch/fileSystemBatchCommands.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pybatch/fileSystemBatchCommands.py b/pybatch/fileSystemBatchCommands.py index a1cd6c14..d2cf3572 100644 --- a/pybatch/fileSystemBatchCommands.py +++ b/pybatch/fileSystemBatchCommands.py @@ -971,6 +971,10 @@ def __init__(self, glob_pattern, class_to_run, target_param_name, *argv_for_glob self.class_to_run = class_to_run self.argv_for_glob_handler = list(argv_for_glob_handler) self.kwargs_for_glob_handler = kwargs_for_glob_handler + if "excludes" in kwargs_for_glob_handler: + self.excludes = kwargs_for_glob_handler["excludes"] + else: + self.excludes = [] pass def repr_own_args(self, all_args: List[str]) -> None: @@ -989,6 +993,7 @@ def repr_own_args(self, all_args: List[str]) -> None: def progress_msg_self(self): return f"""{self.__class__.__name__} '{self.glob_pattern}'""" + def __call__(self, *args, **kwargs): PythonBatchCommandBase.__call__(self, *args, **kwargs) self.doing = f"""running {self.class_to_run} on glob pattern'{self.glob_pattern}'""" @@ -997,7 +1002,13 @@ def __call__(self, *args, **kwargs): if not self.target_param_name: self.argv_for_glob_handler.insert(0, None) - for a_path in glob.glob(self.glob_pattern): + excluded_items = [] + for excluded_item in self.excludes: + excluded_item = str(Path(self.glob_pattern).parent) + "/" + excluded_item + excluded_items.extend(glob.glob(excluded_item)) + paths = set(glob.glob(self.glob_pattern)) - set(excluded_items) + + for a_path in paths: if self.target_param_name: self.kwargs_for_glob_handler[self.target_param_name] = a_path with self.class_to_run(*self.argv_for_glob_handler, **self.kwargs_for_glob_handler) as handler: From c2d1eb77cbff42e27b62f16ea0002992db602f0f Mon Sep 17 00:00:00 2001 From: shai Date: Sun, 27 Jun 2021 11:17:43 +0300 Subject: [PATCH 2/4] * added exclude patterns to Glober instl 2.1.11.10 --- defaults/main.yaml | 2 +- pybatch/reportingBatchCommands.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/defaults/main.yaml b/defaults/main.yaml index ead4b19e..81049878 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -4,7 +4,7 @@ __INSTL_VERSION__: - 2 # major version e.g. python-batch - 1 # new major feature e.g. new command - 11 # new minor feature e.g. new option to command, new python batch class - - 9 # bug fix + - 10 # bug fix __INSTL_VERSION_STR_SHORT__: $(__INSTL_VERSION__[0]).$(__INSTL_VERSION__[1]).$(__INSTL_VERSION__[2]).$(__INSTL_VERSION__[3]) # __INSTL_VERSION_STR_SHORT__ will be defined at run time by InstlInstanceBase.get_version_str diff --git a/pybatch/reportingBatchCommands.py b/pybatch/reportingBatchCommands.py index ceacbd8a..f9fb5539 100644 --- a/pybatch/reportingBatchCommands.py +++ b/pybatch/reportingBatchCommands.py @@ -329,7 +329,7 @@ def __init__(self, unresolved_file, resolved_file=None, config_files=None, raise :param config_files: additional files to read config_vars definitions from :param raise_if_unresolved: when True, will raise exception if any unresolved $(...) references are left :param avoid_resolve_marker: config vars marked with this char (if != '$') will be ignored and after - the resolve will be replacfed by '$'. This will enable to mark certain config vars so they are not resolved + the resolve will be replaced by '$'. This will enable to mark certain config vars so they are not resolved """ super().__init__(**kwargs) self.unresolved_file = unresolved_file @@ -401,6 +401,9 @@ def __call__(self, *args, **kwargs) -> None: class ReadConfigVarValueFromTextFile(pybatch.PythonBatchCommandBase, essential=True): + """ + Read a file and assign the file's whole contents to a configVar + """ def __init__(self, file_path_to_read, var_name, **kwargs): super().__init__(**kwargs) self.file_path_to_read = file_path_to_read From 99264d62db9aaba2a27b074046f0e6ef58070bb4 Mon Sep 17 00:00:00 2001 From: shai Date: Mon, 28 Jun 2021 14:36:48 +0300 Subject: [PATCH 3/4] * prepare_args_parser: if command is not found - try to recommend colosest match --- aYaml/augmentedYaml.py | 2 +- aYaml/test/test_all.py | 2 +- aYaml/test/test_augmentedYaml.py | 2 +- aYaml/yamlReader.py | 2 +- configVar/configVarOne.py | 2 +- configVar/configVarParser.py | 2 +- configVar/configVarStack.py | 2 +- configVar/configVarYamlReader.py | 2 +- configVar/test/testConfigVar.py | 2 +- create_venv.sh | 6 +++--- db/indexItemTable.py | 2 +- defaults/main.yaml | 2 +- help/helpHelper.py | 2 +- instl | 2 +- instl.spec | 8 ++++++-- pybatch/removeBatchCommands.py | 3 ++- pybatch/subprocessBatchCommands.py | 8 +++++--- pybatch/test/test_MacOnlyBatchCommands.py | 2 +- pybatch/test/test_PythonBatchBase.py | 2 +- pybatch/test/test_WinOnlyBatchCommands.py | 2 +- pybatch/test/test_conditionalBatchCommands.py | 2 +- pybatch/test/test_copyBatchCommands.py | 2 +- pybatch/test/test_fileSystemBatchCommands.py | 2 +- pybatch/test/test_info_mapBatchCommands.py | 2 +- pybatch/test/test_removeBatchCommands.py | 2 +- pybatch/test/test_reportingBatchCommands.py | 2 +- pybatch/test/test_subprocessBatchCommands.py | 8 ++++---- pybatch/test/test_svnBatchCommands.py | 2 +- pybatch/test/test_wtarBatchCommands.py | 2 +- pyinstl/connectionBase.py | 2 +- pyinstl/curlHelper.py | 2 +- pyinstl/installItemGraph.py | 2 +- pyinstl/instlAdmin.py | 2 +- pyinstl/instlClient.py | 2 +- pyinstl/instlClientCopy.py | 2 +- pyinstl/instlClientRemove.py | 3 +-- pyinstl/instlClientReport.py | 2 +- pyinstl/instlClientSync.py | 2 +- pyinstl/instlClientUninstall.py | 2 +- pyinstl/instlDoIt.py | 2 +- pyinstl/instlException.py | 2 +- pyinstl/instlGui.py | 3 +-- pyinstl/instlInstanceBase.py | 3 +-- pyinstl/instlInstanceBase_interactive.py | 2 +- pyinstl/instlInstanceSyncBase.py | 2 +- pyinstl/instlInstanceSync_boto.py | 2 +- pyinstl/instlInstanceSync_p4.py | 2 +- pyinstl/instlInstanceSync_svn.py | 3 +-- pyinstl/instlInstanceSync_url.py | 2 +- pyinstl/instlMisc.py | 4 ++-- pyinstl/test/test_itemTable.py | 2 +- pyinstl/test/test_utils.py | 2 +- pyinstl/test_all.py | 3 +-- python_venv_sudo.sh | 2 +- requirements.txt | 20 +++++++++---------- requirements_win_only.txt | 6 +++--- svnTree/svnTable.py | 2 +- svnTree/test/test_SVNItem.py | 3 +-- svnTree/test/test_SVNTree.py | 2 +- utils/extract_info.py | 2 +- utils/files.py | 2 +- utils/log_utils.py | 2 +- utils/ls.py | 2 +- utils/misc_utils.py | 2 +- utils/multi_file.py | 2 +- utils/parallel_run.py | 2 +- utils/searchPaths.py | 3 +-- utils/str_utils.py | 2 +- 68 files changed, 94 insertions(+), 96 deletions(-) diff --git a/aYaml/augmentedYaml.py b/aYaml/augmentedYaml.py index 60209b90..14041168 100755 --- a/aYaml/augmentedYaml.py +++ b/aYaml/augmentedYaml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 """ diff --git a/aYaml/test/test_all.py b/aYaml/test/test_all.py index 24eade00..d4081186 100755 --- a/aYaml/test/test_all.py +++ b/aYaml/test/test_all.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import unittest diff --git a/aYaml/test/test_augmentedYaml.py b/aYaml/test/test_augmentedYaml.py index f0a65ce0..dd5092a9 100644 --- a/aYaml/test/test_augmentedYaml.py +++ b/aYaml/test/test_augmentedYaml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/aYaml/yamlReader.py b/aYaml/yamlReader.py index 07de7211..5d022b01 100644 --- a/aYaml/yamlReader.py +++ b/aYaml/yamlReader.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 """ YamlReader is a base class for writing specific classes that read yaml. when reading a yaml file, one or more documents can be found, each optionally diff --git a/configVar/configVarOne.py b/configVar/configVarOne.py index 985871e3..9699b5f1 100644 --- a/configVar/configVarOne.py +++ b/configVar/configVarOne.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 """ Copyright (c) 2012, Shai Shasag diff --git a/configVar/configVarParser.py b/configVar/configVarParser.py index ba77b80b..3fecf1d2 100755 --- a/configVar/configVarParser.py +++ b/configVar/configVarParser.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import re import string diff --git a/configVar/configVarStack.py b/configVar/configVarStack.py index 6c7a8098..5b31f600 100644 --- a/configVar/configVarStack.py +++ b/configVar/configVarStack.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 """ diff --git a/configVar/configVarYamlReader.py b/configVar/configVarYamlReader.py index 0c31ee32..f41d3505 100644 --- a/configVar/configVarYamlReader.py +++ b/configVar/configVarYamlReader.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 """ ConfigVarYamlReader """ diff --git a/configVar/test/testConfigVar.py b/configVar/test/testConfigVar.py index 7abe7ce6..33285aae 100644 --- a/configVar/test/testConfigVar.py +++ b/configVar/test/testConfigVar.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys import os diff --git a/create_venv.sh b/create_venv.sh index eda5a9c8..f28b9114 100755 --- a/create_venv.sh +++ b/create_venv.sh @@ -1,6 +1,6 @@ #!/bin/bash -python3.6 -m venv venv +python3.9 -m venv venv source venv/bin/activate -python3.6 -m pip install -r requirements.txt -python3.6 -m pip install -r requirements_admin.txt +python3.9 -m pip install -r requirements.txt +python3.9 -m pip install -r requirements_admin.txt diff --git a/db/indexItemTable.py b/db/indexItemTable.py index ed91edbd..ae1c8e73 100644 --- a/db/indexItemTable.py +++ b/db/indexItemTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os diff --git a/defaults/main.yaml b/defaults/main.yaml index 81049878..64af3c2b 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -4,7 +4,7 @@ __INSTL_VERSION__: - 2 # major version e.g. python-batch - 1 # new major feature e.g. new command - 11 # new minor feature e.g. new option to command, new python batch class - - 10 # bug fix + - 10 # bug fix __INSTL_VERSION_STR_SHORT__: $(__INSTL_VERSION__[0]).$(__INSTL_VERSION__[1]).$(__INSTL_VERSION__[2]).$(__INSTL_VERSION__[3]) # __INSTL_VERSION_STR_SHORT__ will be defined at run time by InstlInstanceBase.get_version_str diff --git a/help/helpHelper.py b/help/helpHelper.py index 2ff8d32b..e8d6081a 100644 --- a/help/helpHelper.py +++ b/help/helpHelper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os diff --git a/instl b/instl index 5def66e1..3f646d6d 100755 --- a/instl +++ b/instl @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 # -*- coding: utf-8 -*- """ main executable for instl """ diff --git a/instl.spec b/instl.spec index e4ab8d78..4b3e9efe 100644 --- a/instl.spec +++ b/instl.spec @@ -9,6 +9,7 @@ import socket import datetime import re from subprocess import check_output +from pathlib import Path block_cipher = None @@ -16,7 +17,7 @@ a = Analysis(['instl'], pathex=['instl'], binaries=None, datas=None, - hiddenimports=['distutils', 'six','packaging', 'packaging.version', 'packaging.specifiers', 'packaging.requirements', 'xmltodict'], + hiddenimports=['distutils', 'packaging', 'packaging.version', 'packaging.specifiers', 'packaging.requirements'], hookspath=None, runtime_hooks=None, excludes=['PyQt4', 'matplotlib', "PIL", "numpy", "wx", "tornado", "networkx", @@ -30,6 +31,8 @@ instl_defaults_path = os.path.join("defaults") for defaults_file in os.listdir(instl_defaults_path): if fnmatch.fnmatch(defaults_file, '*.yaml') or fnmatch.fnmatch(defaults_file, '*.ddl'): a.datas += [("defaults/"+defaults_file, os.path.join(instl_defaults_path, defaults_file), "DATA")] +pip_info_path = os.path.join("defaults", "pip-freeze.txt") +a.datas += [("defaults/pip-freeze.txt", pip_info_path, "DATA")] git_branch = check_output(["git", "rev-parse", "--symbolic-full-name", "--abbrev-ref", "HEAD"]).decode('utf-8') @@ -49,6 +52,7 @@ __GITHUB_BRANCH__: {} """.format(str(datetime.datetime.now()), socket.gethostname(), platform.node(), PyInstallerVersion, git_branch)) a.datas += [("defaults/compile-info.yaml", compile_info_path, "DATA")] + instl_help_path = os.path.join("help") for help_file in os.listdir(instl_help_path): if fnmatch.fnmatch(help_file, '*.yaml'): @@ -79,4 +83,4 @@ coll = COLLECT(exe, app = BUNDLE(coll, name='instl.bundle', icon=None, - bundle_identifier=None) \ No newline at end of file + bundle_identifier=None) diff --git a/pybatch/removeBatchCommands.py b/pybatch/removeBatchCommands.py index 8796894e..d86ce5e7 100644 --- a/pybatch/removeBatchCommands.py +++ b/pybatch/removeBatchCommands.py @@ -134,6 +134,7 @@ def progress_msg_self(self): return f"""Remove '{self.path}'""" def __call__(self, *args, **kwargs): + resolved_path = None retry = kwargs.get("retry", True) try: PythonBatchCommandBase.__call__(self, *args, **kwargs) @@ -145,7 +146,7 @@ def __call__(self, *args, **kwargs): self.doing = f"""removing folder'{resolved_path}'""" shutil.rmtree(resolved_path, onerror=self.who_locks_file_error_dict) except Exception as ex: - if retry: + if retry and resolved_path is not None: kwargs["retry"] = False log.info(f"Fixing permission for removing {resolved_path}") from pybatch import FixAllPermissions diff --git a/pybatch/subprocessBatchCommands.py b/pybatch/subprocessBatchCommands.py index 6e715836..1a153c9b 100644 --- a/pybatch/subprocessBatchCommands.py +++ b/pybatch/subprocessBatchCommands.py @@ -77,7 +77,10 @@ def __call__(self, *args, **kwargs): need_to_close_out_file = False if self.out_file: if isinstance(self.out_file, (str, os.PathLike, bytes)): - out_stream = utils.utf8_open_for_write(self.out_file, "w") + out_file = Path(self.out_file).resolve() + out_file.parent.mkdir(parents=True, exist_ok=True) + out_stream = utils.utf8_open_for_write(out_file, "w") + log.info(f"output will be written to {out_file}") need_to_close_out_file = True elif hasattr(self.out_file, "write"): # out_file is already an open file out_stream = self.out_file @@ -183,7 +186,6 @@ def get_run_args(self, run_args) -> None: class ShellCommand(RunProcessBase): """ run a single command in a shell """ - def __init__(self, shell_command, message=None, ignore_specific_exit_codes=(), **kwargs): kwargs["shell"] = True super().__init__(ignore_specific_exit_codes=ignore_specific_exit_codes, **kwargs) @@ -434,7 +436,7 @@ def repr_own_args(self, all_args: List[str]): def get_run_args(self, run_args) -> None: """ Injecting the relevant OS python process into the run args instead of the empty string""" super().get_run_args(run_args) - python_executables = {'win32': ['py', '-3.6'], 'darwin': ['python3.6']} + python_executables = {'win32': ['py', '-3.9'], 'darwin': ['python3.9']} run_args.pop(0) # Removing empty string for arg in reversed(python_executables[sys.platform]): run_args.insert(0, arg) diff --git a/pybatch/test/test_MacOnlyBatchCommands.py b/pybatch/test/test_MacOnlyBatchCommands.py index 5f06f3b6..95ce7c10 100644 --- a/pybatch/test/test_MacOnlyBatchCommands.py +++ b/pybatch/test/test_MacOnlyBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pybatch/test/test_PythonBatchBase.py b/pybatch/test/test_PythonBatchBase.py index 2e9aed51..028b355a 100644 --- a/pybatch/test/test_PythonBatchBase.py +++ b/pybatch/test/test_PythonBatchBase.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pybatch/test/test_WinOnlyBatchCommands.py b/pybatch/test/test_WinOnlyBatchCommands.py index e983d787..2a6f5347 100644 --- a/pybatch/test/test_WinOnlyBatchCommands.py +++ b/pybatch/test/test_WinOnlyBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import unittest diff --git a/pybatch/test/test_conditionalBatchCommands.py b/pybatch/test/test_conditionalBatchCommands.py index f2ec9346..66ca6337 100644 --- a/pybatch/test/test_conditionalBatchCommands.py +++ b/pybatch/test/test_conditionalBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import unittest diff --git a/pybatch/test/test_copyBatchCommands.py b/pybatch/test/test_copyBatchCommands.py index dc2d017e..c3d98729 100644 --- a/pybatch/test/test_copyBatchCommands.py +++ b/pybatch/test/test_copyBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys import os diff --git a/pybatch/test/test_fileSystemBatchCommands.py b/pybatch/test/test_fileSystemBatchCommands.py index 9dfc3dd1..9a602258 100644 --- a/pybatch/test/test_fileSystemBatchCommands.py +++ b/pybatch/test/test_fileSystemBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pybatch/test/test_info_mapBatchCommands.py b/pybatch/test/test_info_mapBatchCommands.py index 97442c45..65ad6166 100644 --- a/pybatch/test/test_info_mapBatchCommands.py +++ b/pybatch/test/test_info_mapBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import unittest diff --git a/pybatch/test/test_removeBatchCommands.py b/pybatch/test/test_removeBatchCommands.py index 6d3c8543..5ca66783 100644 --- a/pybatch/test/test_removeBatchCommands.py +++ b/pybatch/test/test_removeBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pybatch/test/test_reportingBatchCommands.py b/pybatch/test/test_reportingBatchCommands.py index 6198dc90..9bccae83 100644 --- a/pybatch/test/test_reportingBatchCommands.py +++ b/pybatch/test/test_reportingBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pybatch/test/test_subprocessBatchCommands.py b/pybatch/test/test_subprocessBatchCommands.py index 80b2e032..36de1ef5 100644 --- a/pybatch/test/test_subprocessBatchCommands.py +++ b/pybatch/test/test_subprocessBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys @@ -269,8 +269,8 @@ def test_Subprocess(self): self.pbt.batch_accum.clear(section_name="doit") self.pbt.batch_accum += MakeDir(folder_) - self.pbt.batch_accum += Subprocess("python3.6", "--version") - self.pbt.batch_accum += Subprocess("python3.6", "-c", "for i in range(4): print(i)") + self.pbt.batch_accum += Subprocess("python3.9", "--version") + self.pbt.batch_accum += Subprocess("python3.9", "-c", "for i in range(4): print(i)") self.pbt.exec_and_capture_output() def test_Subprocess_detached(self): @@ -300,7 +300,7 @@ def delete_abort_file(): t = Timer(2, delete_abort_file) t.start() - cmd = ['python3.6', test_file] + cmd = ['python3.9', test_file] with self.assertRaises(ProcessTerminatedExternally): with assert_timeout(3): run_process(cmd, shell=(sys.platform == 'win32'), abort_file=abort_file) diff --git a/pybatch/test/test_svnBatchCommands.py b/pybatch/test/test_svnBatchCommands.py index fdcd94f6..0410d194 100644 --- a/pybatch/test/test_svnBatchCommands.py +++ b/pybatch/test/test_svnBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pybatch/test/test_wtarBatchCommands.py b/pybatch/test/test_wtarBatchCommands.py index 10658843..8ec7b5a1 100644 --- a/pybatch/test/test_wtarBatchCommands.py +++ b/pybatch/test/test_wtarBatchCommands.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pyinstl/connectionBase.py b/pyinstl/connectionBase.py index 433d2e0d..d336000d 100644 --- a/pyinstl/connectionBase.py +++ b/pyinstl/connectionBase.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import abc diff --git a/pyinstl/curlHelper.py b/pyinstl/curlHelper.py index adcf2671..2470292a 100644 --- a/pyinstl/curlHelper.py +++ b/pyinstl/curlHelper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os diff --git a/pyinstl/installItemGraph.py b/pyinstl/installItemGraph.py index 7aaec271..c2afbcc3 100644 --- a/pyinstl/installItemGraph.py +++ b/pyinstl/installItemGraph.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import utils from configVar import config_vars diff --git a/pyinstl/instlAdmin.py b/pyinstl/instlAdmin.py index 1cc4bb5f..f0437291 100644 --- a/pyinstl/instlAdmin.py +++ b/pyinstl/instlAdmin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import logging log = logging.getLogger() diff --git a/pyinstl/instlClient.py b/pyinstl/instlClient.py index 9537fb36..b0784df7 100644 --- a/pyinstl/instlClient.py +++ b/pyinstl/instlClient.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os import sys diff --git a/pyinstl/instlClientCopy.py b/pyinstl/instlClientCopy.py index a9996efe..d23f59a3 100644 --- a/pyinstl/instlClientCopy.py +++ b/pyinstl/instlClientCopy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pyinstl/instlClientRemove.py b/pyinstl/instlClientRemove.py index 5ac8adc2..4538d516 100644 --- a/pyinstl/instlClientRemove.py +++ b/pyinstl/instlClientRemove.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 import os diff --git a/pyinstl/instlClientReport.py b/pyinstl/instlClientReport.py index 395827db..743f4856 100644 --- a/pyinstl/instlClientReport.py +++ b/pyinstl/instlClientReport.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os diff --git a/pyinstl/instlClientSync.py b/pyinstl/instlClientSync.py index deafe981..23ddaef8 100644 --- a/pyinstl/instlClientSync.py +++ b/pyinstl/instlClientSync.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 from configVar import config_vars diff --git a/pyinstl/instlClientUninstall.py b/pyinstl/instlClientUninstall.py index 1826c70b..a589f2ff 100644 --- a/pyinstl/instlClientUninstall.py +++ b/pyinstl/instlClientUninstall.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 from collections import deque, defaultdict from configVar import config_vars diff --git a/pyinstl/instlDoIt.py b/pyinstl/instlDoIt.py index 53fbacc8..9767bfe6 100644 --- a/pyinstl/instlDoIt.py +++ b/pyinstl/instlDoIt.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import logging log = logging.getLogger() diff --git a/pyinstl/instlException.py b/pyinstl/instlException.py index bfd3e951..89a26737 100644 --- a/pyinstl/instlException.py +++ b/pyinstl/instlException.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 class InstlException(Exception): diff --git a/pyinstl/instlGui.py b/pyinstl/instlGui.py index c8f4794f..bd61e873 100644 --- a/pyinstl/instlGui.py +++ b/pyinstl/instlGui.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 import sys diff --git a/pyinstl/instlInstanceBase.py b/pyinstl/instlInstanceBase.py index 518a2348..4ef1e097 100644 --- a/pyinstl/instlInstanceBase.py +++ b/pyinstl/instlInstanceBase.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 import os import sys diff --git a/pyinstl/instlInstanceBase_interactive.py b/pyinstl/instlInstanceBase_interactive.py index fa5b30da..1b2be3a0 100644 --- a/pyinstl/instlInstanceBase_interactive.py +++ b/pyinstl/instlInstanceBase_interactive.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pyinstl/instlInstanceSyncBase.py b/pyinstl/instlInstanceSyncBase.py index d1923a38..a6a31812 100644 --- a/pyinstl/instlInstanceSyncBase.py +++ b/pyinstl/instlInstanceSyncBase.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys import os diff --git a/pyinstl/instlInstanceSync_boto.py b/pyinstl/instlInstanceSync_boto.py index c5664c79..b6176595 100644 --- a/pyinstl/instlInstanceSync_boto.py +++ b/pyinstl/instlInstanceSync_boto.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 from .instlInstanceSyncBase import InstlInstanceSync diff --git a/pyinstl/instlInstanceSync_p4.py b/pyinstl/instlInstanceSync_p4.py index e6511724..4ac559a1 100644 --- a/pyinstl/instlInstanceSync_p4.py +++ b/pyinstl/instlInstanceSync_p4.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 from .instlInstanceSyncBase import InstlInstanceSync diff --git a/pyinstl/instlInstanceSync_svn.py b/pyinstl/instlInstanceSync_svn.py index cf97c9d3..7fae37ea 100644 --- a/pyinstl/instlInstanceSync_svn.py +++ b/pyinstl/instlInstanceSync_svn.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 import utils from .instlInstanceSyncBase import InstlInstanceSync diff --git a/pyinstl/instlInstanceSync_url.py b/pyinstl/instlInstanceSync_url.py index a4aa5b41..f52df2bc 100644 --- a/pyinstl/instlInstanceSync_url.py +++ b/pyinstl/instlInstanceSync_url.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 from collections import defaultdict import urllib diff --git a/pyinstl/instlMisc.py b/pyinstl/instlMisc.py index 46046f75..00c896fe 100644 --- a/pyinstl/instlMisc.py +++ b/pyinstl/instlMisc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import shlex import threading @@ -93,7 +93,7 @@ def do_test_import(self): import importlib bad_modules = list() - for module in ("yaml", "appdirs", "configVar", "utils", "svnTree", "aYaml", "xmltodict"): + for module in ("yaml", "appdirs", "configVar", "utils", "svnTree", "aYaml"): try: importlib.import_module(module) except ImportError: diff --git a/pyinstl/test/test_itemTable.py b/pyinstl/test/test_itemTable.py index 57ce6e16..0af6a98e 100644 --- a/pyinstl/test/test_itemTable.py +++ b/pyinstl/test/test_itemTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pyinstl/test/test_utils.py b/pyinstl/test/test_utils.py index 98b1cd3b..c15c744f 100644 --- a/pyinstl/test/test_utils.py +++ b/pyinstl/test/test_utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/pyinstl/test_all.py b/pyinstl/test_all.py index 012e7163..5ec023fd 100755 --- a/pyinstl/test_all.py +++ b/pyinstl/test_all.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 import os import sys diff --git a/python_venv_sudo.sh b/python_venv_sudo.sh index 4c94ca34..4aaf8a72 100755 --- a/python_venv_sudo.sh +++ b/python_venv_sudo.sh @@ -8,4 +8,4 @@ SCRIPT_FOLDER=$(dirname $SCRIPT) echo ${PYTHONPATH} source "${SCRIPT_FOLDER}/venv/bin/activate" -sudo python3.6 "$@" +sudo python3.9 "$@" diff --git a/requirements.txt b/requirements.txt index 2bdff54a..dd163a72 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,9 @@ -appdirs==1.4.3 -future==0.17.1 -networkx==2.2 -packaging==18.0 -psutil==5.6.6 -PyInstaller==4.3 -PyYAML==5.4 -requests==2.21.0 -six==1.12.0 -xmltodict==0.12.0 -redis==2.10.6 +appdirs +future +networkx +packaging +psutil +PyInstaller +PyYAML +requests +redis diff --git a/requirements_win_only.txt b/requirements_win_only.txt index 5dd4e168..b4e2d81f 100644 --- a/requirements_win_only.txt +++ b/requirements_win_only.txt @@ -1,4 +1,4 @@ # Windows only -pypiwin32==220 -pywin32==224 -pywin32-ctypes==0.2.0 +pypiwin32 +pywin32 +pywin32-ctypes diff --git a/svnTree/svnTable.py b/svnTree/svnTable.py index 6f0247a3..fdbcffb4 100644 --- a/svnTree/svnTable.py +++ b/svnTree/svnTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os diff --git a/svnTree/test/test_SVNItem.py b/svnTree/test/test_SVNItem.py index 21c9d7d9..95c041b0 100755 --- a/svnTree/test/test_SVNItem.py +++ b/svnTree/test/test_SVNItem.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 import os import sys diff --git a/svnTree/test/test_SVNTree.py b/svnTree/test/test_SVNTree.py index 51095e8b..d915b873 100755 --- a/svnTree/test/test_SVNTree.py +++ b/svnTree/test/test_SVNTree.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os diff --git a/utils/extract_info.py b/utils/extract_info.py index 45768e20..2b0e26d5 100644 --- a/utils/extract_info.py +++ b/utils/extract_info.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import os import sys diff --git a/utils/files.py b/utils/files.py index 58c8d0ec..d9aebab9 100644 --- a/utils/files.py +++ b/utils/files.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys import os diff --git a/utils/log_utils.py b/utils/log_utils.py index 7eb547bb..256fbf53 100644 --- a/utils/log_utils.py +++ b/utils/log_utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 """ diff --git a/utils/ls.py b/utils/ls.py index 52cdb73f..89185d98 100644 --- a/utils/ls.py +++ b/utils/ls.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys import os diff --git a/utils/misc_utils.py b/utils/misc_utils.py index 4721027c..9f80357c 100644 --- a/utils/misc_utils.py +++ b/utils/misc_utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys diff --git a/utils/multi_file.py b/utils/multi_file.py index 6510c8d7..f5795469 100755 --- a/utils/multi_file.py +++ b/utils/multi_file.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import io import os diff --git a/utils/parallel_run.py b/utils/parallel_run.py index 2a32617a..26bc3128 100644 --- a/utils/parallel_run.py +++ b/utils/parallel_run.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import subprocess diff --git a/utils/searchPaths.py b/utils/searchPaths.py index 40c9f69b..006d56d9 100644 --- a/utils/searchPaths.py +++ b/utils/searchPaths.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3.6 - +#!/usr/bin/env python3.9 """ Manage list of include search paths, and help find files diff --git a/utils/str_utils.py b/utils/str_utils.py index 4bfb8f20..fca9a579 100644 --- a/utils/str_utils.py +++ b/utils/str_utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.9 import sys From 2a72e93bf6daecfa208c075ab067ac8b72358e2c Mon Sep 17 00:00:00 2001 From: shai Date: Mon, 28 Jun 2021 14:38:02 +0300 Subject: [PATCH 4/4] * instl updated to python3.9 instl 2.2.0.0 --- defaults/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/defaults/main.yaml b/defaults/main.yaml index 64af3c2b..44fcf03a 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -2,9 +2,9 @@ __INSTL_VERSION__: - 2 # major version e.g. python-batch - - 1 # new major feature e.g. new command - - 11 # new minor feature e.g. new option to command, new python batch class - - 10 # bug fix + - 2 # new major feature e.g. new command + - 0 # new minor feature e.g. new option to command, new python batch class + - 0 # bug fix __INSTL_VERSION_STR_SHORT__: $(__INSTL_VERSION__[0]).$(__INSTL_VERSION__[1]).$(__INSTL_VERSION__[2]).$(__INSTL_VERSION__[3]) # __INSTL_VERSION_STR_SHORT__ will be defined at run time by InstlInstanceBase.get_version_str