gOdoo-cli 0.12.9__tar.gz → 0.13.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/PKG-INFO +4 -4
  2. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/pyproject.toml +38 -57
  3. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/cli_common.py +2 -2
  4. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/db/connection.py +3 -1
  5. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/source_get.py +8 -4
  6. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/git/git_odoo.py +5 -2
  7. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/git/git_odoo_addons.py +28 -20
  8. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/git/git_repo.py +1 -1
  9. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/modules.py +3 -2
  10. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/modules_py.py +3 -2
  11. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/odoo_manifest.py +9 -0
  12. godoo_cli-0.13.1/src/godoo_cli/version.py +1 -0
  13. godoo_cli-0.12.9/src/godoo_cli/version.py +0 -1
  14. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/LICENSE +0 -0
  15. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/README.md +0 -0
  16. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/__init__.py +0 -0
  17. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/__main__.py +0 -0
  18. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/cli.py +0 -0
  19. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/__init__.py +0 -0
  20. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/backup/__init__.py +0 -0
  21. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/backup/cli.py +0 -0
  22. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/backup/dump.py +0 -0
  23. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/backup/load.py +0 -0
  24. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/backup/pull.py +0 -0
  25. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/backup/util.py +0 -0
  26. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/bootstrap.py +0 -0
  27. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/config.py +0 -0
  28. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/db/__init__.py +0 -0
  29. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/db/cli.py +0 -0
  30. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/db/passwords.py +0 -0
  31. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/db/query.py +0 -0
  32. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/launch.py +0 -0
  33. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/rpc/__init__.py +0 -0
  34. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/rpc/cli.py +0 -0
  35. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/rpc/config_parameters.py +0 -0
  36. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/rpc/importer.py +0 -0
  37. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/rpc/modules.py +0 -0
  38. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/rpc/translations.py +0 -0
  39. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/shell/scripts/odoo_banner.py +0 -0
  40. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/shell/shell.py +0 -0
  41. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/test/__init__.py +0 -0
  42. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/test/cli.py +0 -0
  43. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/test/test_load_data.py +0 -0
  44. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/commands/test/test_run.py +0 -0
  45. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/git/__init__.py +0 -0
  46. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/git/git_url.py +0 -0
  47. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/git/zip_download.py +0 -0
  48. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/__init__.py +0 -0
  49. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/cli.py +0 -0
  50. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/modules_git.py +0 -0
  51. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/odoo_files.py +0 -0
  52. {godoo_cli-0.12.9 → godoo_cli-0.13.1}/src/godoo_cli/helpers/system.py +0 -0
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: gOdoo-cli
3
- Version: 0.12.9
3
+ Version: 0.13.1
4
4
  Summary: Wrapper around Odoo-Bin with some convinience RPC functions.
5
- Home-page: https://github.com/OpenJKSoftware/gOdoo
6
5
  License: LGPL-3
7
6
  Keywords: odoo,godoo,devcontainer
8
7
  Author: Joshua Kreuder
@@ -28,7 +27,8 @@ Requires-Dist: isort (>=5.10.1) ; extra == "codequality"
28
27
  Requires-Dist: mock (>=4.0.3) ; extra == "devcontainer"
29
28
  Requires-Dist: openupgradelib (>=3.3.4)
30
29
  Requires-Dist: passlib (>=1.7.3)
31
- Requires-Dist: psycopg2-binary (>=2.9.10,<3.0.0)
30
+ Requires-Dist: pre-commit (>=3.4.0) ; extra == "codequality"
31
+ Requires-Dist: psycopg2-binary (>=2.9.10)
32
32
  Requires-Dist: py-spy (>=0.3.11) ; extra == "devcontainer"
33
33
  Requires-Dist: pydevd-odoo (>=1.2.1) ; extra == "devcontainer"
34
34
  Requires-Dist: pylint-odoo (>=8.0.16) ; extra == "codequality"
@@ -1,72 +1,53 @@
1
- [tool.poetry]
1
+ [build-system]
2
+ requires = ["poetry-core>=2.0.0"]
3
+ build-backend = "poetry.core.masonry.api"
4
+
5
+ [project]
2
6
  name = "gOdoo-cli"
3
- version = "0.12.9"
7
+ version = "0.13.1"
4
8
  description = "Wrapper around Odoo-Bin with some convinience RPC functions."
5
- authors = ["Joshua Kreuder <Joshua_Kreuder@outlook.com>"]
9
+ authors = [{name="Joshua Kreuder", email="Joshua_Kreuder@outlook.com"}]
6
10
  license = "LGPL-3"
7
11
  readme = "README.md"
8
12
  packages = [{include = "godoo_cli", from = "src"}]
9
- repository = "https://github.com/OpenJKSoftware/gOdoo"
10
13
  keywords = ["odoo", "godoo","devcontainer"]
14
+ requires-python = ">=3.9"
15
+ urls= {repository = "https://github.com/OpenJKSoftware/gOdoo"}
16
+ scripts = {godoo = "godoo_cli:launch_cli"}
17
+ dependencies = [
18
+ "python-dotenv>=0.20.0",
19
+ "ruamel-yaml>=0.17.21",
20
+ "gitpython>=3.1.27",
21
+ "godoo-rpc>=0.1.4",
22
+ "openupgradelib>=3.3.4",
23
+ "psycopg2-binary>=2.9.10",
24
+ "passlib>=1.7.3", # Mirror Odoo Reqs
25
+ "typer-common-functions>=0.0.12",
26
+ "typer>=0.9.0",
27
+ ]
11
28
 
12
- [tool.poetry.group.dev.dependencies]
13
- pre-commit = ">=3.4.0"
14
-
15
- [tool.poetry_bumpversion.file."src/godoo_cli/version.py"]
16
-
17
- [tool.poetry.scripts]
18
- godoo = "godoo_cli:launch_cli"
19
-
20
- [tool.poetry.dependencies]
21
- python = ">=3.9"
22
- python-dotenv = ">=0.20.0"
23
- ruamel-yaml = ">=0.17.21"
24
- gitpython = ">=3.1.27"
25
- godoo-rpc = ">=0.1.4"
26
- openupgradelib = ">=3.3.4"
27
- psycopg2-binary = "^2.9.10"
28
- passlib = ">=1.7.3" # Mirror Odoo Reqs
29
- typer-common-functions = ">=0.0.12"
30
- typer = ">=0.9.0"
31
-
32
- pylint-odoo = { version=">=8.0.16", optional = true}
33
- ipdb = { version=">=0.13.9", optional = true}
34
- debugpy = { version=">=1.6.0", optional = true}
35
- black = { version=">=22.10.0", optional = true}
36
- isort = { version=">=5.10.1", optional = true}
37
- watchdog = { version=">=2.1.7", optional = true}
38
- py-spy = { version=">=0.3.11", optional = true}
39
- rope = { version=">=0.23.0", optional = true}
40
- flake8 = { version=">=5.0.4", optional = true}
41
- inotify = { version=">=0.2.10",optional = true}
42
- mock = { version=">=4.0.3", optional= true}
43
- pytest = { version=">=7.2.1", optional= true}
44
- pytest-cov = {version=">=4.0.0",optional=true}
45
- pydevd-odoo = { version=">=1.2.1",optional=true}
46
-
47
- [tool.poetry.extras]
29
+ [project.optional-dependencies]
48
30
  devcontainer = [
49
- "ipdb",
50
- "debugpy",
51
- "watchdog",
52
- "rope",
53
- "py-spy",
54
- "inotify",
55
- "mock",
56
- "pydevd-odoo"
31
+ "ipdb>=0.13.9",
32
+ "debugpy>=1.6.0",
33
+ "watchdog>=2.1.7",
34
+ "rope>=0.23.0",
35
+ "py-spy>=0.3.11",
36
+ "inotify>=0.2.10",
37
+ "mock>=4.0.3",
38
+ "pydevd-odoo>=1.2.1"
57
39
  ]
58
40
  codequality = [
59
- "pylint-odoo",
60
- "black",
61
- "isort",
62
- "flake8",
63
- "pytest",
64
- "pytest-cov"
41
+ "pylint-odoo>=8.0.16",
42
+ "black>=22.10.0",
43
+ "isort>=5.10.1",
44
+ "flake8>=5.0.4",
45
+ "pytest>=7.2.1",
46
+ "pytest-cov>=4.0.0",
47
+ "pre-commit>=3.4.0"
65
48
  ]
66
49
 
67
- [build-system]
68
- requires = ["poetry-core>=1.0.0"]
69
- build-backend = "poetry.core.masonry.api"
50
+ [tool.poetry_bumpversion.file."src/godoo_cli/version.py"]
70
51
 
71
52
  [tool.pytest.ini_options]
72
53
  log_cli = true
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass
2
2
  from pathlib import Path
3
- from typing import List, Optional
3
+ from typing import List
4
4
 
5
5
  from typer import Argument, Option
6
6
  from typer_common_functions import get_type_from_default, typer_retuner, typer_unpacker
@@ -162,7 +162,7 @@ class SourceGetArgs:
162
162
  help="godoo manifest path, when downloading odoo source (skip repo_url)",
163
163
  )
164
164
 
165
- source_download_archive: Optional[bool] = Option(
165
+ source_download_archive: bool = Option(
166
166
  False,
167
167
  "--source-download-archive",
168
168
  envvar="SOURCE_CLONE_ARCHIVE",
@@ -21,7 +21,9 @@ def login_db(
21
21
  db_password=CLI.database.db_password,
22
22
  ):
23
23
  """Login Interactive psql CLI using provided credentials"""
24
- command = ["psql", f"-h{db_host}", f"-p{db_port}", f"-U{db_user}", f"-d{db_name}"]
24
+ command = ["psql", f"-h {db_host}", f"-U {db_user}", f"-d {db_name}"]
25
+ if db_port != 0:
26
+ command.append(f"-p {db_port}")
25
27
  subprocess.run(command, env={"PGPASSWORD": db_password})
26
28
 
27
29
 
@@ -92,10 +92,11 @@ def update_odoo_conf_addon_paths(odoo_conf: Path, addon_paths: List[Path]):
92
92
  raise FileNotFoundError("Odoo.conf not found at: %s" % odoo_conf)
93
93
  config = configparser.ConfigParser()
94
94
  config.read(odoo_conf)
95
- addon_paths = ",".join([str(p.absolute()) for p in addon_paths])
96
- config["options"]["addons_path"] = addon_paths
95
+ path_strings = [str(p.absolute()) for p in addon_paths]
96
+ addon_path_option = ",".join(path_strings)
97
+ config["options"]["addons_path"] = addon_path_option
97
98
  LOGGER.info("Writing Addon Paths to Odoo Config.")
98
- LOGGER.debug(addon_paths)
99
+ LOGGER.debug(addon_path_option)
99
100
  config.write(odoo_conf.open("w"))
100
101
 
101
102
 
@@ -179,7 +180,7 @@ def py_depends_by_modules(
179
180
  if len(module_list) == 1 and module_list[0] == "all":
180
181
  module_list = []
181
182
  module_reg = godooModules(odoo_addon_paths)
182
- modules = module_reg.get_modules(module_list)
183
+ modules = list(module_reg.get_modules(module_list))
183
184
  _install_py_reqs_for_modules(modules, module_reg)
184
185
 
185
186
 
@@ -227,6 +228,7 @@ def get_source(
227
228
  add_compare_comments: bool = typer.Option(
228
229
  False, "--add-compare-comments", help="Wether to add github.com three dot compare links as comments."
229
230
  ),
231
+ pin_commits: bool = typer.Option(False, "--pin-commits", help="Pin commits in manifest to current commit in repo"),
230
232
  remove_unspecified_addons: bool = typer.Option(
231
233
  False, "--remove-unspecified-addons", help="Remove Addon folders that are not in YML or thirdparty.zip"
232
234
  ),
@@ -250,6 +252,7 @@ def get_source(
250
252
  force_fetch=force_fetch,
251
253
  add_compare_comment=add_compare_comments,
252
254
  download_archive=download_zipmode,
255
+ pin_commit=pin_commits,
253
256
  )
254
257
 
255
258
  if update_mode in ["all", "thirdparty"]:
@@ -258,6 +261,7 @@ def get_source(
258
261
  git_yml_path=manifest_path,
259
262
  generate_yml_compare_comments=add_compare_comments,
260
263
  download_archive=download_zipmode,
264
+ pin_commits=pin_commits,
261
265
  )
262
266
  if remove_unspecified_addons:
263
267
  remove_unused_folders(
@@ -13,6 +13,7 @@ def git_ensure_odoo_repo(
13
13
  force_fetch: bool,
14
14
  add_compare_comment: bool,
15
15
  download_archive: bool,
16
+ pin_commit: bool = False,
16
17
  ):
17
18
  yaml = yaml_roundtrip_loader()
18
19
  git_repos = yaml.load(manifest_file.resolve())
@@ -32,16 +33,18 @@ def git_ensure_odoo_repo(
32
33
  else:
33
34
  yaml_remove_compare_commit(odoo_data)
34
35
 
35
- git_ensure_repo(
36
+ clone_ret = git_ensure_repo(
36
37
  target_folder=target_folder,
37
38
  repo_src=odoo_url,
38
39
  branch=odoo_branch,
39
40
  commit=odoo_commit,
40
- pull=force_fetch,
41
+ pull=odoo_commit or odoo_branch if force_fetch else "",
41
42
  zip_mode=download_archive,
42
43
  filter="blob:none",
43
44
  single_branch=True,
44
45
  )
46
+ if pin_commit and clone_ret:
47
+ odoo_data["commit"] = clone_ret.head.commit.hexsha
45
48
 
46
49
  # make sure odoo-bin is executable
47
50
  odoo_bin = target_folder / "odoo-bin"
@@ -1,9 +1,9 @@
1
1
  import concurrent.futures
2
2
  import logging
3
3
  from pathlib import Path
4
- from typing import Dict
4
+ from typing import Dict, List
5
5
 
6
- from git import Commit
6
+ from git import Repo
7
7
 
8
8
  from ..helpers.odoo_manifest import update_yml, yaml_roundtrip_loader
9
9
  from .git_repo import git_ensure_repo
@@ -17,6 +17,7 @@ def git_ensure_addon_repos(
17
17
  git_yml_path: Path,
18
18
  generate_yml_compare_comments: bool = False,
19
19
  download_archive: bool = False,
20
+ pin_commits: bool = False,
20
21
  ):
21
22
  """
22
23
  Clone repos specified in Yml.
@@ -31,11 +32,15 @@ def git_ensure_addon_repos(
31
32
  wether to add three dot compare on remote to repo urls
32
33
  download_archive : bool, optional
33
34
  wether to download as .zip (fast but no history), by default False
35
+ pin_commits : bool, optional
36
+ pin commits in yml, by default False
34
37
  """
35
38
  yaml = yaml_roundtrip_loader()
36
39
  git_repos = yaml.load(git_yml_path.resolve())
37
- if _git_clone_addon_repos(root_folder=root_folder, git_repos=git_repos, download_archive=download_archive):
38
- update_yml(git_repos, generate_yml_compare_comments)
40
+ if result := _git_clone_addon_repos(
41
+ root_folder=root_folder, git_repos=git_repos, download_archive=download_archive
42
+ ):
43
+ update_yml(git_repos, result, generate_yml_compare_comments, pin_commits)
39
44
  LOGGER.info("Updating Git Thirdparty Repo Commit hashes")
40
45
  yaml.dump(git_repos, git_yml_path)
41
46
 
@@ -46,7 +51,7 @@ def _git_clone_addon_repos(
46
51
  root_folder: Path,
47
52
  git_repos: Dict[str, Dict[str, str]],
48
53
  download_archive: bool = False,
49
- ) -> Dict[str, Commit]:
54
+ ) -> Dict[str, Repo]:
50
55
  """
51
56
  Clones Git repos specified in dict into Root folder.
52
57
  Ensures repo names are prefixed and uses 8 threads to clone.
@@ -66,30 +71,33 @@ def _git_clone_addon_repos(
66
71
  Dict[str:Commit]
67
72
  dict of {git_src_url:HeadCommit}
68
73
  """
69
- default_branch = git_repos["odoo"].get("branch")
74
+ default_branch = git_repos["odoo"].get("branch", "master")
70
75
  LOGGER.info("Cloning Thirdparty Addons source.")
71
76
  with concurrent.futures.ThreadPoolExecutor(8) as executor:
72
77
  futures = []
73
- thirdparty_repos = git_repos.get("thirdparty")
78
+ thirdparty_repos: Dict[str, List[Dict[str, str]]] = git_repos.get("thirdparty") # type: ignore
74
79
  if not thirdparty_repos:
75
80
  LOGGER.info("No Thirdparty Key in manifest. Skipping...")
76
- return
81
+ return {}
77
82
  for prefix, repos in thirdparty_repos.items():
78
83
  for repo in repos:
79
- repo_url = GitUrl(repo["url"])
84
+ url = repo["url"]
85
+ repo_url = GitUrl(url)
80
86
  name = f"{prefix}_{repo_url.name}"
81
87
  futures.append(
82
- executor.submit(
83
- git_ensure_repo,
84
- target_folder=Path(root_folder / name),
85
- repo_src=repo_url.url,
86
- branch=repo.get("branch", default_branch),
87
- commit=repo.get("commit"),
88
- zip_mode=download_archive,
89
- filter="blob:none",
90
- single_branch=True,
88
+ (
89
+ url,
90
+ executor.submit(
91
+ git_ensure_repo,
92
+ target_folder=Path(root_folder / name),
93
+ repo_src=repo_url.url,
94
+ branch=repo.get("branch", default_branch),
95
+ commit=repo.get("commit"), # type: ignore
96
+ zip_mode=download_archive,
97
+ filter="blob:none",
98
+ single_branch=True,
99
+ ),
91
100
  )
92
101
  )
93
- clone_results = [f.result() for f in futures]
94
- clone_results = {r[0]: r[1] for r in clone_results if r}
102
+ clone_results: Dict[str, Repo] = {r: f.result() for r, f in futures if r}
95
103
  return clone_results
@@ -148,7 +148,7 @@ def git_ensure_ref(
148
148
  repo.active_branch.name if not repo.head.is_detached else "Detached",
149
149
  repo.head.commit,
150
150
  )
151
- return repo_src, repo.head.commit
151
+ return repo
152
152
 
153
153
 
154
154
  def git_ensure_repo(
@@ -26,7 +26,7 @@ class godooModule:
26
26
  raise NotAValidModuleError(f"{self.path} is not a valid odoo module")
27
27
 
28
28
  def __repr__(self) -> str:
29
- return f"godooModule({str(self.path.absolute())})"
29
+ return f"godooModule({str(self.path.name)})"
30
30
 
31
31
  def __eq__(self, __value: object) -> bool:
32
32
  if isinstance(__value, godooModule):
@@ -50,7 +50,8 @@ class godooModule:
50
50
 
51
51
  @property
52
52
  def py_depends(self) -> List[str]:
53
- return self.manifest.get("external_dependencies", {}).get("python", [])
53
+ module_depends = self.manifest.get("external_dependencies", {}).get("python", [])
54
+ return module_depends
54
55
 
55
56
  @property
56
57
  def odoo_depends(self) -> List[str]:
@@ -24,7 +24,7 @@ def _install_py_reqs_for_modules(modules: List[godooModule], module_reg: godooMo
24
24
  -------
25
25
  CompletedProcess
26
26
  """
27
- reqs = []
27
+ reqs: list[str] = []
28
28
  if isinstance(modules, GeneratorType):
29
29
  modules = list(modules)
30
30
  all_modules = modules + module_reg.get_module_dependencies(modules)
@@ -32,7 +32,7 @@ def _install_py_reqs_for_modules(modules: List[godooModule], module_reg: godooMo
32
32
  for mod in all_modules:
33
33
  reqs += mod.py_depends
34
34
  if reqs:
35
- return pip_install(set(reqs))
35
+ return pip_install(list(set(reqs)))
36
36
 
37
37
 
38
38
  def _install_py_reqs_by_odoo_cmd(addon_paths: List[Path], odoo_bin_cmd: str):
@@ -56,4 +56,5 @@ def _install_py_reqs_by_odoo_cmd(addon_paths: List[Path], odoo_bin_cmd: str):
56
56
  LOGGER.debug("Found Modules to install in odoo-bin command: %s", install_modules)
57
57
  module_reg = godooModules(addon_paths)
58
58
  modules = [module_reg.get_module(m) for m in install_modules]
59
+ modules = [m for m in modules if m]
59
60
  return _install_py_reqs_for_modules(modules, module_reg)
@@ -3,6 +3,7 @@ import shutil
3
3
  from pathlib import Path
4
4
  from typing import List
5
5
 
6
+ from git import Repo
6
7
  from ruamel.yaml import YAML
7
8
 
8
9
  from ..git.git_url import GitUrl
@@ -36,7 +37,9 @@ def remove_unused_folders(thirdparty_addon_path: Path, thirdparty_repos, keep_fo
36
37
 
37
38
  def update_yml(
38
39
  repo_yml,
40
+ clone_results: dict[str, Repo],
39
41
  generate_yml_compare_comments: bool = False,
42
+ generate_yml_commit_pins: bool = False,
40
43
  ):
41
44
  """Process yaml after thirdparty clone.
42
45
 
@@ -44,8 +47,12 @@ def update_yml(
44
47
  ----------
45
48
  repo_yml : Yaml Dict
46
49
  Ruamel Yaml Dict of prefix and list of repos (url,commit,branch)
50
+ clone_results: dict[str,Commit]
51
+ Git url to currently cloned commit. Gets returned from Git Downloader
47
52
  generate_yml_compare_comments : bool, optional
48
53
  add github compare links as comment to repo yml, by default False
54
+ generate_yml_commit_pins: bool, optional
55
+ adds commit pins to currently checked out head commit
49
56
  """
50
57
  thirdparty_repos = repo_yml["thirdparty"]
51
58
  odoo_default_branch = repo_yml["odoo"].get("branch")
@@ -55,6 +62,8 @@ def update_yml(
55
62
 
56
63
  for prefix in thirdparty_repos:
57
64
  for repo in thirdparty_repos[prefix]:
65
+ if generate_yml_commit_pins and (c := clone_results.get(repo.get("url"))):
66
+ repo["commit"] = c.head.commit.hexsha
58
67
  if generate_yml_compare_comments:
59
68
  yaml_add_compare_commit(repo, odoo_default_branch)
60
69
  else:
@@ -0,0 +1 @@
1
+ __version__ = "0.13.1"
@@ -1 +0,0 @@
1
- __version__ = "0.12.9"
File without changes
File without changes