gOdoo-cli 0.5.1__tar.gz → 0.6.0__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 (40) hide show
  1. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/PKG-INFO +3 -2
  2. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/README.md +1 -1
  3. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/pyproject.toml +3 -1
  4. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/cli_common.py +0 -7
  5. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/bootstrap.py +1 -4
  6. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/launch.py +2 -10
  7. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/test.py +0 -2
  8. godoo_cli-0.6.0/src/godoo_cli/git/git_odoo.py +89 -0
  9. godoo_cli-0.6.0/src/godoo_cli/version.py +1 -0
  10. godoo_cli-0.5.1/src/godoo_cli/git/git_odoo.py +0 -45
  11. godoo_cli-0.5.1/src/godoo_cli/version.py +0 -1
  12. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/LICENSE +0 -0
  13. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/__init__.py +0 -0
  14. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/__main__.py +0 -0
  15. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/cli.py +0 -0
  16. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/__init__.py +0 -0
  17. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/config.py +0 -0
  18. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/db/__init__.py +0 -0
  19. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/db/cli.py +0 -0
  20. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/db/connection.py +0 -0
  21. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/db/passwords.py +0 -0
  22. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/rpc/__init__.py +0 -0
  23. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/rpc/cli.py +0 -0
  24. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/rpc/config_parameters.py +0 -0
  25. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/rpc/importer.py +0 -0
  26. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/rpc/modules.py +0 -0
  27. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/rpc/translations.py +0 -0
  28. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/shell.py +0 -0
  29. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/commands/source_get.py +0 -0
  30. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/git/__init__.py +0 -0
  31. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/git/git_odoo_addons.py +0 -0
  32. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/git/git_repo.py +0 -0
  33. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/git/git_url.py +0 -0
  34. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/git/zip_download.py +0 -0
  35. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/helpers/__init__.py +0 -0
  36. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/helpers/bootstrap.py +0 -0
  37. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/helpers/cli.py +0 -0
  38. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/helpers/odoo_files.py +0 -0
  39. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/helpers/odoo_manifest.py +0 -0
  40. {godoo_cli-0.5.1 → godoo_cli-0.6.0}/src/godoo_cli/helpers/system.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: godoo-cli
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: Wrapper around Odoo-Bin with some convinience RPC functions.
5
5
  Home-page: https://github.com/OpenJKSoftware/gOdoo
6
6
  License: LGPL-3
@@ -29,6 +29,7 @@ Requires-Dist: passlib (>=1.7.3,<2.0.0)
29
29
  Requires-Dist: pre-commit (>=2.20.0,<3.0.0) ; extra == "devcontainer"
30
30
  Requires-Dist: psycopg2 (>=2.8.6,<3.0.0)
31
31
  Requires-Dist: py-spy (>=0.3.11,<0.4.0) ; extra == "devcontainer"
32
+ Requires-Dist: pydevd-odoo (>=1.2.1,<2.0.0) ; extra == "devcontainer"
32
33
  Requires-Dist: pylint-odoo (>=8.0.16,<9.0.0) ; extra == "codequality"
33
34
  Requires-Dist: pytest (>=7.2.1,<8.0.0) ; extra == "codequality"
34
35
  Requires-Dist: pytest-cov (>=4.0.0,<5.0.0) ; extra == "codequality"
@@ -161,7 +162,7 @@ There are 3 Options to reset the Dev Env.
161
162
  container. (Vscode will prompt to reconnect if still open)
162
163
  2. From **Outside** the Container run `make reset-hard` in the project root to force rebuild the main Odoo container and
163
164
  then do the same as `make reset`
164
- 3. From **Inside** the Container run `make reset` to drop the DB and delete varlib and the bootstrap flag, which is way
165
+ 3. From **Inside** the Container run `make reset` to drop the DB and delete varlib and config file, which is way
165
166
  quicker than the other options.
166
167
 
167
168
  ### Manual Reset
@@ -119,7 +119,7 @@ There are 3 Options to reset the Dev Env.
119
119
  container. (Vscode will prompt to reconnect if still open)
120
120
  2. From **Outside** the Container run `make reset-hard` in the project root to force rebuild the main Odoo container and
121
121
  then do the same as `make reset`
122
- 3. From **Inside** the Container run `make reset` to drop the DB and delete varlib and the bootstrap flag, which is way
122
+ 3. From **Inside** the Container run `make reset` to drop the DB and delete varlib and config file, which is way
123
123
  quicker than the other options.
124
124
 
125
125
  ### Manual Reset
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gOdoo-cli"
3
- version = "0.5.1"
3
+ version = "0.6.0"
4
4
  description = "Wrapper around Odoo-Bin with some convinience RPC functions."
5
5
  authors = ["Joshua Kreuder <Joshua_Kreuder@outlook.com>"]
6
6
  license = "LGPL-3"
@@ -39,6 +39,7 @@ inotify = { version="^0.2.10",optional = true}
39
39
  mock = { version="^4.0.3", optional= true}
40
40
  pytest = { version="^7.2.1", optional= true}
41
41
  pytest-cov = {version="^4.0.0",optional=true}
42
+ pydevd-odoo = { version="^1.2.1",optional=true}
42
43
 
43
44
  [tool.poetry.extras]
44
45
  devcontainer = [
@@ -50,6 +51,7 @@ devcontainer = [
50
51
  "py-spy",
51
52
  "inotify",
52
53
  "mock",
54
+ "pydevd-odoo"
53
55
  ]
54
56
  codequality = [
55
57
  "pylint-odoo",
@@ -73,13 +73,6 @@ class OdooPathCLIArgs:
73
73
  rich_help_panel="Path Options",
74
74
  )
75
75
 
76
- bootstrap_flag_location: Path = Option(
77
- ...,
78
- envvar="ODOO_BOOTSTRAP_FLAG",
79
- help="Location of the Bootstrap indicator file",
80
- rich_help_panel="Path Options",
81
- )
82
-
83
76
 
84
77
  @dataclass
85
78
  class RpcCLIArgs:
@@ -139,7 +139,6 @@ def bootstrap_odoo(
139
139
  workspace_addon_path=CLI.odoo_paths.workspace_addon_path,
140
140
  thirdparty_addon_path=CLI.odoo_paths.thirdparty_addon_path,
141
141
  odoo_conf_path=CLI.odoo_paths.conf_path,
142
- bootstrap_flag_location=CLI.odoo_paths.bootstrap_flag_location,
143
142
  db_filter=CLI.database.db_filter,
144
143
  db_host=CLI.database.db_host,
145
144
  db_port=CLI.database.db_port,
@@ -183,8 +182,6 @@ def bootstrap_odoo(
183
182
 
184
183
  LOGGER.info("Launching Bootstrap Commandline")
185
184
  ret = run_cmd(cmd_string).returncode
186
- if ret == 0:
187
- bootstrap_flag_location.touch()
188
- else:
185
+ if ret != 0:
189
186
  LOGGER.error("Odoo-Bin Returned %d", ret)
190
187
  return CLI.returner(ret)
@@ -56,7 +56,6 @@ def _launch_command(
56
56
  def pre_launch(
57
57
  odoo_main_path: Path,
58
58
  workspace_addon_path: Path,
59
- bootstrap_flag_location: Path,
60
59
  thirdparty_addon_path: Path,
61
60
  odoo_conf_path: Path,
62
61
  db_filter: str,
@@ -75,7 +74,7 @@ def pre_launch(
75
74
  install_base: bool = True,
76
75
  launch_or_bootstrap: bool = False,
77
76
  ):
78
- """Start Bootstrap if no bootstrap flag is found. And return Launch CMD.
77
+ """Start Bootstrap if no config file is found. And return Launch CMD.
79
78
 
80
79
  Parameters
81
80
  ----------
@@ -83,8 +82,6 @@ def pre_launch(
83
82
  Path to Odoo-bin folder
84
83
  workspace_addon_path : Path
85
84
  Path to workspace addons
86
- bootstrap_flag_location : Path
87
- path to bootstrap flag
88
85
  thirdparty_addon_path : Path
89
86
  path to thirdparty addons folder
90
87
  odoo_conf_path : Path
@@ -132,7 +129,7 @@ def pre_launch(
132
129
  log_file_path.unlink(missing_ok=True)
133
130
  extra_odoo_args.append("--logfile " + str(log_file_path.absolute()))
134
131
 
135
- bootstraped = bootstrap_flag_location.exists()
132
+ bootstraped = odoo_conf_path.exists()
136
133
  LOGGER.info("Bootstrap Flag Status: %s", bootstraped)
137
134
  ret = ""
138
135
  if not bootstraped:
@@ -150,7 +147,6 @@ def pre_launch(
150
147
  db_password=db_password,
151
148
  db_host=db_host,
152
149
  db_port=db_port,
153
- bootstrap_flag_location=bootstrap_flag_location,
154
150
  thirdparty_addon_path=thirdparty_addon_path,
155
151
  odoo_main_path=odoo_main_path,
156
152
  odoo_conf_path=odoo_conf_path,
@@ -193,7 +189,6 @@ def pre_launch(
193
189
  def launch_odoo(
194
190
  odoo_main_path=CLI.odoo_paths.bin_path,
195
191
  workspace_addon_path=CLI.odoo_paths.workspace_addon_path,
196
- bootstrap_flag_location=CLI.odoo_paths.bootstrap_flag_location,
197
192
  thirdparty_addon_path=CLI.odoo_paths.thirdparty_addon_path,
198
193
  odoo_conf_path=CLI.odoo_paths.conf_path,
199
194
  db_filter=CLI.database.db_filter,
@@ -218,7 +213,6 @@ def launch_odoo(
218
213
  launch_cmd = pre_launch(
219
214
  odoo_main_path=odoo_main_path,
220
215
  workspace_addon_path=workspace_addon_path,
221
- bootstrap_flag_location=bootstrap_flag_location,
222
216
  thirdparty_addon_path=thirdparty_addon_path,
223
217
  odoo_conf_path=odoo_conf_path,
224
218
  db_filter=db_filter,
@@ -253,7 +247,6 @@ def launch_import(
253
247
  ),
254
248
  odoo_main_path=CLI.odoo_paths.bin_path,
255
249
  workspace_addon_path=CLI.odoo_paths.workspace_addon_path,
256
- bootstrap_flag_location=CLI.odoo_paths.bootstrap_flag_location,
257
250
  thirdparty_addon_path=CLI.odoo_paths.thirdparty_addon_path,
258
251
  odoo_conf_path=CLI.odoo_paths.conf_path,
259
252
  db_filter=CLI.database.db_filter,
@@ -279,7 +272,6 @@ def launch_import(
279
272
  launch_cmd = pre_launch(
280
273
  odoo_main_path=odoo_main_path,
281
274
  workspace_addon_path=workspace_addon_path,
282
- bootstrap_flag_location=bootstrap_flag_location,
283
275
  thirdparty_addon_path=thirdparty_addon_path,
284
276
  odoo_conf_path=odoo_conf_path,
285
277
  db_filter=db_filter,
@@ -46,7 +46,6 @@ def odoo_test(
46
46
  ),
47
47
  odoo_main_path=CLI.odoo_paths.bin_path,
48
48
  workspace_addon_path=CLI.odoo_paths.workspace_addon_path,
49
- bootstrap_flag_location=CLI.odoo_paths.bootstrap_flag_location,
50
49
  thirdparty_addon_path=CLI.odoo_paths.thirdparty_addon_path,
51
50
  odoo_conf_path=CLI.odoo_paths.conf_path,
52
51
  db_filter=CLI.database.db_filter,
@@ -101,7 +100,6 @@ def odoo_test(
101
100
  workspace_addon_path=workspace_addon_path,
102
101
  thirdparty_addon_path=thirdparty_addon_path,
103
102
  odoo_conf_path=odoo_conf_path,
104
- bootstrap_flag_location=bootstrap_flag_location,
105
103
  db_filter=db_filter,
106
104
  db_host=db_host,
107
105
  db_port=db_port,
@@ -0,0 +1,89 @@
1
+ import json
2
+ import logging
3
+ from pathlib import Path
4
+
5
+ from ..helpers.odoo_manifest import yaml_add_compare_commit, yaml_remove_compare_commit, yaml_roundtrip_loader
6
+ from .git_repo import git_ensure_repo
7
+
8
+ LOGGER = logging.getLogger(__name__)
9
+
10
+
11
+ def git_ensure_odoo_repo(
12
+ target_folder: Path,
13
+ manifest_file: Path,
14
+ force_fetch: bool,
15
+ add_compare_comment: bool,
16
+ download_archive: bool,
17
+ ):
18
+ yaml = yaml_roundtrip_loader()
19
+ git_repos = yaml.load(manifest_file.resolve())
20
+ if not git_repos:
21
+ raise FileNotFoundError(f"Couldnt load yml file from: {str(manifest_file)}")
22
+
23
+ odoo_data = git_repos.get("odoo")
24
+ if not odoo_data:
25
+ raise KeyError(f"Could not find key 'odoo' in {str(manifest_file)}")
26
+
27
+ odoo_url = odoo_data["url"]
28
+ odoo_branch = odoo_data.get("branch", "master")
29
+ odoo_commit = odoo_data.get("commit", "")
30
+
31
+ download_stubs(target_folder, force_fetch, download_archive, odoo_data, odoo_branch)
32
+
33
+ if add_compare_comment:
34
+ yaml_add_compare_commit(odoo_data, odoo_branch)
35
+ else:
36
+ yaml_remove_compare_commit(odoo_data)
37
+
38
+ git_ensure_repo(
39
+ target_folder=target_folder,
40
+ repo_src=odoo_url,
41
+ branch=odoo_branch,
42
+ commit=odoo_commit,
43
+ pull=force_fetch,
44
+ zip_mode=download_archive,
45
+ filter="blob:none",
46
+ single_branch=True,
47
+ )
48
+
49
+ yaml.dump(git_repos, manifest_file)
50
+
51
+
52
+ def download_stubs(
53
+ target_folder: Path,
54
+ force_fetch: bool,
55
+ download_archive: bool,
56
+ odoo_data,
57
+ odoo_branch: str,
58
+ ):
59
+ """Download Odoo stubs for https://github.com/odoo-ide/vscode-odoo
60
+
61
+ Hopefully this Method will become obsolete in the future, when the vscode-odoo extension includes stubs in the extension itself.
62
+
63
+ Parameters
64
+ ----------
65
+ target_folder : Path
66
+ Stubs will be downloaded to target_folder.parent/odoo-stubs
67
+ force_fetch : bool
68
+ passed down to git_ensure_repo
69
+ download_archive : bool
70
+ passed down to git_ensure_repo
71
+ odoo_data : Dict
72
+ odoo_data from manifest.yml
73
+ odoo_branch : str
74
+ branch to download stubs from
75
+ """
76
+ odoo_stubs = odoo_data.get("stubs")
77
+ if odoo_stubs:
78
+ stub_target_path = target_folder.parent / "odoo-stubs"
79
+ git_ensure_repo(
80
+ target_folder=stub_target_path,
81
+ repo_src=odoo_stubs["url"],
82
+ branch=odoo_branch,
83
+ pull=force_fetch,
84
+ zip_mode=download_archive,
85
+ filter="blob:none",
86
+ single_branch=True,
87
+ )
88
+ if pyright_path := odoo_stubs.get("pyright_conf"):
89
+ json.dump({"stubPath": str(stub_target_path.absolute())}, Path(pyright_path).open("w"))
@@ -0,0 +1 @@
1
+ __version__ = "0.6.0"
@@ -1,45 +0,0 @@
1
- import logging
2
- from pathlib import Path
3
-
4
- from ..helpers.odoo_manifest import yaml_add_compare_commit, yaml_remove_compare_commit, yaml_roundtrip_loader
5
- from .git_repo import git_ensure_repo
6
-
7
- LOGGER = logging.getLogger(__name__)
8
-
9
-
10
- def git_ensure_odoo_repo(
11
- target_folder: Path,
12
- manifest_file: Path,
13
- force_fetch: bool,
14
- add_compare_comment: bool,
15
- download_archive: bool,
16
- ):
17
- yaml = yaml_roundtrip_loader()
18
- git_repos = yaml.load(manifest_file.resolve())
19
- if not git_repos:
20
- raise FileNotFoundError(f"Couldnt load yml file from: {str(manifest_file)}")
21
-
22
- odoo_data = git_repos.get("odoo")
23
- if not odoo_data:
24
- raise KeyError(f"Could not find key 'odoo' in {str(manifest_file)}")
25
-
26
- odoo_url = odoo_data["url"]
27
- odoo_branch = odoo_data.get("branch", "master")
28
- odoo_commit = odoo_data.get("commit", "")
29
- if add_compare_comment:
30
- yaml_add_compare_commit(odoo_data, odoo_branch)
31
- else:
32
- yaml_remove_compare_commit(odoo_data)
33
-
34
- git_ensure_repo(
35
- target_folder=target_folder,
36
- repo_src=odoo_url,
37
- branch=odoo_branch,
38
- commit=odoo_commit,
39
- pull=force_fetch,
40
- zip_mode=download_archive,
41
- filter="blob:none",
42
- single_branch=True,
43
- )
44
-
45
- yaml.dump(git_repos, manifest_file)
@@ -1 +0,0 @@
1
- __version__ = "0.5.1"
File without changes