odoo-devops-tools 1.0.0__py3-none-any.whl → 1.0.1__py3-none-any.whl

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.
@@ -1 +1 @@
1
- __version__ = "1.0.0"
1
+ __version__ = "1.0.1"
odoo_devops_tools/env.py CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  """
3
- odk-env
3
+ odt-env
4
4
 
5
5
  Provision and sync a reproducible Odoo workspace from an INI configuration file
6
6
  """
@@ -23,7 +23,7 @@ from typing import Any, Dict, Iterable, Optional
23
23
 
24
24
  from . import __version__
25
25
 
26
- _logger = logging.getLogger("odk-env")
26
+ _logger = logging.getLogger("odt-env")
27
27
 
28
28
  _DEFAULT_REQUIREMENTS = [
29
29
  "pip",
@@ -604,13 +604,13 @@ def _filter_requirements_file(
604
604
  include_rel = parts[1].strip()
605
605
  include_path = (req_path.parent / include_rel).resolve()
606
606
 
607
- out_lines.append(f"# odk-env: begin include {include_rel}")
607
+ out_lines.append(f"# odt-env: begin include {include_rel}")
608
608
  if include_path in visited:
609
- out_lines.append(f"# odk-env: skipped recursive include {include_rel}")
609
+ out_lines.append(f"# odt-env: skipped recursive include {include_rel}")
610
610
  else:
611
611
  visited.add(include_path)
612
612
  out_lines.extend(_filter_requirements_file(include_path, ignore_names, visited=visited))
613
- out_lines.append(f"# odk-env: end include {include_rel}")
613
+ out_lines.append(f"# odt-env: end include {include_rel}")
614
614
  continue
615
615
 
616
616
  # Editable installs: -e <spec> / --editable <spec>
@@ -621,7 +621,7 @@ def _filter_requirements_file(
621
621
 
622
622
  name = _extract_req_name_from_spec(spec)
623
623
  if name and name in ignore_names:
624
- out_lines.append(f"# odk-env: skipped (ignored package '{name}'): {raw}")
624
+ out_lines.append(f"# odt-env: skipped (ignored package '{name}'): {raw}")
625
625
  continue
626
626
 
627
627
  out_lines.append(raw)
@@ -641,7 +641,7 @@ def compile_all_requirements_lock(
641
641
  ) -> Path:
642
642
  """Compile a single lock file from multiple requirements sources using `uv pip compile`.
643
643
 
644
- - Collects `base_requirements` (packages listed in INI + OPM defaults)
644
+ - Collects `base_requirements` (packages listed in INI + odt-env defaults)
645
645
  - Inlines and filters each requirements.txt (supports nested -r includes)
646
646
  - Applies `requirements_ignore` consistently before compilation
647
647
  - Writes:
@@ -678,13 +678,13 @@ def compile_all_requirements_lock(
678
678
  req_lines.append("")
679
679
 
680
680
  lines: list[str] = [
681
- "# This file is generated by odk-env (DO NOT EDIT).",
682
- "# Source: Odoo + addon repository requirements, plus [virtualenv].requirements and OPM defaults.",
681
+ "# This file is generated by odt-env (DO NOT EDIT).",
682
+ "# Source: Odoo + addon repository requirements, plus [virtualenv].requirements and odt-env defaults.",
683
683
  "",
684
684
  ]
685
685
 
686
686
  if base_requirements:
687
- lines.append("# --- base requirements (from INI + OPM defaults) ---")
687
+ lines.append("# --- base requirements (from INI + odt-env defaults) ---")
688
688
  for spec in base_requirements:
689
689
  lines.append(spec)
690
690
  lines.append("")
@@ -2419,7 +2419,7 @@ def sync_project(
2419
2419
  # -----------------------------
2420
2420
 
2421
2421
  def build_parser() -> argparse.ArgumentParser:
2422
- epilog = """If no options are specified, odk-env only regenerates configs and helper scripts.
2422
+ epilog = """If no options are specified, odt-env only regenerates configs and helper scripts.
2423
2423
 
2424
2424
  ROOT selection:
2425
2425
  By default, ROOT is the directory containing the INI.
@@ -2427,16 +2427,16 @@ ROOT selection:
2427
2427
  Use --dest-root to override the ROOT path embedded into generated configs/scripts (deployment root).
2428
2428
 
2429
2429
  Examples:
2430
- odk-env /path/to/odoo-project.ini --sync-all --create-venv
2431
- odk-env /path/to/odoo-project.ini --sync-all --create-wheelhouse
2432
- odk-env /path/to/odoo-project.ini --sync-all --create-venv --root /path/to/workspace-root
2433
- odk-env /path/to/odoo-project.ini --rebuild-venv --reuse-wheelhouse
2434
- odk-env /path/to/odoo-project.ini --rebuild-venv --reuse-wheelhouse --root /path/to/workspace-root
2430
+ odt-env /path/to/odoo-project.ini --sync-all --create-venv
2431
+ odt-env /path/to/odoo-project.ini --sync-all --create-wheelhouse
2432
+ odt-env /path/to/odoo-project.ini --sync-all --create-venv --root /path/to/workspace-root
2433
+ odt-env /path/to/odoo-project.ini --rebuild-venv --reuse-wheelhouse
2434
+ odt-env /path/to/odoo-project.ini --rebuild-venv --reuse-wheelhouse --root /path/to/workspace-root
2435
2435
  """
2436
2436
 
2437
2437
  parser = argparse.ArgumentParser(
2438
- prog="odk-env",
2439
- description=f"odk-env {__version__}",
2438
+ prog="odt-env",
2439
+ description=f"odt-env {__version__}",
2440
2440
  formatter_class=argparse.RawDescriptionHelpFormatter,
2441
2441
  epilog=epilog,
2442
2442
  )
@@ -2444,7 +2444,7 @@ Examples:
2444
2444
  parser.add_argument(
2445
2445
  "--version",
2446
2446
  action="version",
2447
- version=f"odk-env {__version__}",
2447
+ version=f"odt-env {__version__}",
2448
2448
  help="Show the program version and exit.",
2449
2449
  )
2450
2450
 
@@ -2493,7 +2493,7 @@ Examples:
2493
2493
  action="store_true",
2494
2494
  help=(
2495
2495
  "Enable virtualenv provisioning (create/update ROOT/venv + wheelhouse). "
2496
- "Without this flag, OPM will not touch venv/wheelhouse."
2496
+ "Without this flag, odt-env will not touch venv/wheelhouse."
2497
2497
  ),
2498
2498
  )
2499
2499
  parser.add_argument(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odoo-devops-tools
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: A set of DevOps tools for Odoo deployments and local dev.
5
5
  Author: Roman Lacko
6
6
  License-Expression: MIT
@@ -38,7 +38,17 @@ Install with pip:
38
38
  pip install odoo-devops-tools
39
39
  ```
40
40
 
41
- ## Command: `odk-env`
41
+ Or install with uv:
42
+
43
+ ```bash
44
+ uv tool install odoo-devops-tools
45
+ ```
46
+
47
+ ```bash
48
+ odt-env --help
49
+ ```
50
+
51
+ ## Command: `odt-env`
42
52
 
43
53
  Provision and sync a reproducible Odoo workspace from an INI configuration file.
44
54
 
@@ -52,56 +62,56 @@ Provision and sync a reproducible Odoo workspace from an INI configuration file.
52
62
  Full **default** behavior (clone repositories, create venv, generate config and helper scripts):
53
63
 
54
64
  ```bash
55
- odk-env /path/to/ROOT/odoo-project.ini --sync-all --create-venv
65
+ odt-env /path/to/ROOT/odoo-project.ini --sync-all --create-venv
56
66
  ```
57
67
 
58
68
  By default, `ROOT` is the directory containing the INI file. You can override where the workspace is created with `--root` (must point to an existing directory):
59
69
 
60
70
  ```bash
61
- odk-env /path/to/odoo-project.ini --sync-all --create-venv --root /path/to/NEW-ROOT
71
+ odt-env /path/to/odoo-project.ini --sync-all --create-venv --root /path/to/NEW-ROOT
62
72
  ```
63
73
 
64
74
  If you want to **build** the workspace in one location but have the generated configs/scripts refer to a different **deployment root**, use `--dest-root`. This path does **not** need to exist on the build machine (it may only exist on the target host):
65
75
 
66
76
  ```bash
67
- odk-env /path/to/odoo-project.ini --sync-all --create-wheelhouse --root /tmp/build-root --dest-root /srv/odoo/myproject
77
+ odt-env /path/to/odoo-project.ini --sync-all --create-wheelhouse --root /tmp/build-root --dest-root /srv/odoo/myproject
68
78
  ```
69
79
 
70
80
  Sync without venv provisioning:
71
81
 
72
82
  ```bash
73
- odk-env /path/to/ROOT/odoo-project.ini --sync-all
83
+ odt-env /path/to/ROOT/odoo-project.ini --sync-all
74
84
  ```
75
85
 
76
86
  Build wheelhouse without venv provisioning:
77
87
 
78
88
  ```bash
79
- odk-env /path/to/ROOT/odoo-project.ini --sync-all --create-wheelhouse
89
+ odt-env /path/to/ROOT/odoo-project.ini --sync-all --create-wheelhouse
80
90
  ```
81
91
 
82
92
  Offline venv provisioning from an existing wheelhouse:
83
93
 
84
94
  ```bash
85
- odk-env /path/to/ROOT/odoo-project.ini --create-venv --reuse-wheelhouse
95
+ odt-env /path/to/ROOT/odoo-project.ini --create-venv --reuse-wheelhouse
86
96
  ```
87
97
 
88
98
  Hard rebuild of the venv:
89
99
 
90
100
  ```bash
91
- odk-env /path/to/ROOT/odoo-project.ini --sync-all --rebuild-venv
101
+ odt-env /path/to/ROOT/odoo-project.ini --sync-all --rebuild-venv
92
102
  ```
93
103
 
94
- If no options are specified, odk-env only regenerates config and helper scripts:
104
+ If no options are specified, odt-env only regenerates config and helper scripts:
95
105
 
96
106
  ```bash
97
- odk-env /path/to/ROOT/odoo-project.ini
107
+ odt-env /path/to/ROOT/odoo-project.ini
98
108
  ```
99
109
 
100
- ### What odk-env creates (directory layout)
110
+ ### What odt-env creates (directory layout)
101
111
 
102
112
  `ROOT` is the directory containing `odoo-project.ini` (or the path passed via `--root`).
103
113
 
104
- If you pass `--dest-root`, odk-env still creates files under `ROOT`, but **paths embedded inside generated files** are based on `DEST_ROOT`.
114
+ If you pass `--dest-root`, odt-env still creates files under `ROOT`, but **paths embedded inside generated files** are based on `DEST_ROOT`.
105
115
 
106
116
  - `ROOT/odoo/` - Odoo repository
107
117
  - `ROOT/odoo-addons/<name>/` - addon repositories
@@ -124,7 +134,7 @@ This configuration creates a ready-to-run Odoo 18.0 development workspace, inclu
124
134
  ```ini
125
135
  [virtualenv]
126
136
  python_version = 3.11
127
- # Optional (default: true): when false, odk-env will NOT install a managed CPython via `uv python install`.
137
+ # Optional (default: true): when false, odt-env will NOT install a managed CPython via `uv python install`.
128
138
  # Instead it will rely on an existing system Python that matches `python_version`.
129
139
  # managed_python = false
130
140
  build_constraints =
@@ -159,7 +169,7 @@ max_cron_threads = 0
159
169
 
160
170
  ### Using multiple configuration files with inheritance
161
171
 
162
- odk-env supports a lightweight include mechanism so you can split configuration across multiple INI files (for example a shared `base.ini` plus a local override file).
172
+ odt-env supports a lightweight include mechanism so you can split configuration across multiple INI files (for example a shared `base.ini` plus a local override file).
163
173
 
164
174
  Notes:
165
175
 
@@ -220,9 +230,9 @@ db_name = sample_odoo18_test
220
230
 
221
231
  ### Configuration variables & interpolation
222
232
 
223
- odk-env uses Python's **ExtendedInterpolation**, so you can reference values via `${section:option}` (for example `${vars:branch}`).
233
+ odt-env uses Python's **ExtendedInterpolation**, so you can reference values via `${section:option}` (for example `${vars:branch}`).
224
234
 
225
- In addition, odk-env injects a set of **runtime variables** (workspace paths) into the INI `DEFAULT` scope, so they are available from *any* section in the INI file:
235
+ In addition, odt-env injects a set of **runtime variables** (workspace paths) into the INI `DEFAULT` scope, so they are available from *any* section in the INI file:
226
236
 
227
237
  - `${ini_dir}` - directory containing the INI file
228
238
  - `${root_dir}` - workspace root directory
@@ -236,7 +246,7 @@ In addition, odk-env injects a set of **runtime variables** (workspace paths) in
236
246
 
237
247
  **Note on `--dest-root`:**
238
248
 
239
- - odk-env always *builds* under `ROOT` (filesystem workspace).
249
+ - odt-env always *builds* under `ROOT` (filesystem workspace).
240
250
  - When `--dest-root` is provided, values like `${root_dir}`, `${odoo_dir}`, `${addons_dir}` etc. are evaluated against `DEST_ROOT` **for the `[config]` section** (used to render generated files like `odoo-server.conf`).
241
251
  - Other sections (for example `[odoo]`, `[addons.*]`, `[virtualenv]`) continue to use the filesystem `ROOT` so build-time operations (git/venv/wheelhouse) are unaffected.
242
252
  - `${ini_dir}` always points to the directory containing the entry INI on the build machine (needed for includes).
@@ -271,7 +281,7 @@ logfile = ${root_dir}/odoo-logs/${vars:project}.log
271
281
 
272
282
  ### Extending `addons_path`
273
283
 
274
- odk-env always generates an `addons_path` for `odoo-server.conf` that includes:
284
+ odt-env always generates an `addons_path` for `odoo-server.conf` that includes:
275
285
 
276
286
  - Odoo core addons directory (`ROOT/odoo/addons` and/or `ROOT/odoo/odoo/addons`)
277
287
  - every synced addon repository (`ROOT/odoo-addons/<name>`)
@@ -295,7 +305,7 @@ addons_path =
295
305
 
296
306
  ### Shallow clones (`shallow_clone`)
297
307
 
298
- By default, odk-env keeps repositories as **full clones** (all branches + tags + full history). For very large repositories (especially `odoo/odoo`) you can enable a **shallow, single-branch** workflow.
308
+ By default, odt-env keeps repositories as **full clones** (all branches + tags + full history). For very large repositories (especially `odoo/odoo`) you can enable a **shallow, single-branch** workflow.
299
309
 
300
310
  Where to set it:
301
311
 
@@ -322,7 +332,7 @@ Limitations / gotchas:
322
332
 
323
333
  Switching back to a full clone:
324
334
 
325
- Set `shallow_clone = false` (or remove it) and re-run a sync. If the repo is shallow and/or single-branch, odk-env automatically converts it back to full history (unshallow) and widens the `origin` fetch refspec so a subsequent `fetch --all --tags` can pull all remote branches.
335
+ Set `shallow_clone = false` (or remove it) and re-run a sync. If the repo is shallow and/or single-branch, odt-env automatically converts it back to full history (unshallow) and widens the `origin` fetch refspec so a subsequent `fetch --all --tags` can pull all remote branches.
326
336
 
327
337
  ### Command-line Options
328
338
 
@@ -335,23 +345,23 @@ Set `shallow_clone = false` (or remove it) and re-run a sync. If the repo is sha
335
345
  - `--rebuild-venv` - delete `ROOT/venv` and recreate it (implies `--create-venv`).
336
346
  - `--reuse-wheelhouse` - reuse an existing `ROOT/wheelhouse/` and install offline only (skip lock/wheel build). Requires `--create-venv`.
337
347
  - `--create-wheelhouse` - build/update the lock file + `ROOT/wheelhouse/` **without installing** project requirements into the venv.
338
- (odk-env may create/update `ROOT/venv/` as a Python toolchain.)
348
+ (odt-env may create/update `ROOT/venv/` as a Python toolchain.)
339
349
  - `--clear-pip-wheel-cache` - remove all items from the pip's wheel cache.
340
350
  - `--no-configs` - don’t generate config files (e.g. `ROOT/odoo-configs/odoo-server.conf`).
341
351
  - `--no-scripts` - don’t generate helper scripts under `ROOT/odoo-scripts/`.
342
352
  - `--no-data-dir` - don’t create the Odoo data folder under `ROOT/odoo-data/` (or a custom path set via `[config] data_dir` in the INI file).
343
353
 
344
- If no options are specified, odk-env only regenerates configs and helper scripts.
354
+ If no options are specified, odt-env only regenerates configs and helper scripts.
345
355
 
346
356
  ### Virtualenv
347
357
 
348
- odk-env installs project Python dependencies into the venv only when you pass `--create-venv` (or `--rebuild-venv`).
358
+ odt-env installs project Python dependencies into the venv only when you pass `--create-venv` (or `--rebuild-venv`).
349
359
  You can (re)build the `ROOT/wheelhouse/` either as part of venv provisioning, or separately with `--create-wheelhouse`.
350
360
 
351
361
  - The venv is created/used at: `ROOT/venv`
352
362
  - Python version is taken from: `[virtualenv] python_version`
353
363
  - venv + installs are done via: `uv venv` and `uv pip`
354
- - If the requested Python version is not available on the machine and managed Python is enabled, odk-env installs it via `uv python install`.
364
+ - If the requested Python version is not available on the machine and managed Python is enabled, odt-env installs it via `uv python install`.
355
365
  - Requirements are resolved into a single lock file and installed into the venv from `ROOT/wheelhouse/` using offline mode (`--offline --no-index`).
356
366
 
357
367
  #### Reusing an existing wheelhouse
@@ -359,7 +369,7 @@ You can (re)build the `ROOT/wheelhouse/` either as part of venv provisioning, or
359
369
  If `ROOT/wheelhouse/` is already prepared (wheels + `all-requirements.lock.txt`), you can run (requires `--create-venv`):
360
370
 
361
371
  ```bash
362
- odk-env /path/to/odoo-project.ini --create-venv --reuse-wheelhouse
372
+ odt-env /path/to/odoo-project.ini --create-venv --reuse-wheelhouse
363
373
  ```
364
374
 
365
375
  This skips lock compilation and wheel building and does a strict offline install from the wheelhouse.
@@ -369,15 +379,15 @@ from the existing lock/wheels).
369
379
 
370
380
  ### Managed Python Install
371
381
 
372
- By default, odk-env manages the requested CPython version for you using `uv`.
382
+ By default, odt-env manages the requested CPython version for you using `uv`.
373
383
 
374
384
  - Option: `[virtualenv] managed_python`
375
385
  - Default: `true` (you can omit it)
376
386
 
377
387
  Behavior:
378
388
 
379
- - `managed_python = true` (default): when odk-env needs to create `ROOT/venv/`, it ensures the requested `python_version` exists by running `uv python install`.
380
- - `managed_python = false`: odk-env **skips** `uv python install` and relies on an already-installed system Python that matches `python_version`. If such Python is not available, venv creation will fail.
389
+ - `managed_python = true` (default): when odt-env needs to create `ROOT/venv/`, it ensures the requested `python_version` exists by running `uv python install`.
390
+ - `managed_python = false`: odt-env **skips** `uv python install` and relies on an already-installed system Python that matches `python_version`. If such Python is not available, venv creation will fail.
381
391
 
382
392
  Example:
383
393
 
@@ -391,12 +401,12 @@ managed_python = false
391
401
  ### Safety / local changes policy
392
402
 
393
403
  If any target repository (Odoo or an addon) contains local uncommitted changes
394
- (including untracked files), odk-env aborts. Commit/stash/clean your working tree
395
- before running odk-env.
404
+ (including untracked files), odt-env aborts. Commit/stash/clean your working tree
405
+ before running odt-env.
396
406
 
397
407
  ### Generated scripts
398
408
 
399
- odk-env generates helper scripts into `ROOT/odoo-scripts/`. All scripts use the generated configuration file (`odoo-configs/odoo-server.conf`) and forward any additional arguments to the underlying command.
409
+ odt-env generates helper scripts into `ROOT/odoo-scripts/`. All scripts use the generated configuration file (`odoo-configs/odoo-server.conf`) and forward any additional arguments to the underlying command.
400
410
 
401
411
  #### Linux/macOS
402
412
 
@@ -0,0 +1,8 @@
1
+ odoo_devops_tools/__init__.py,sha256=d4QHYmS_30j0hPN8NmNPnQ_Z0TphDRbu4MtQj9cT9e8,22
2
+ odoo_devops_tools/env.py,sha256=-J8ldBCd6DD5_ner1D2vHmg8M-8-T4CXqTKulZToJBw,90431
3
+ odoo_devops_tools-1.0.1.dist-info/licenses/LICENSE,sha256=3kVGxFPI-TSQGAKsrsm355Lo7Gzq015mqD2K0k3NmUQ,1068
4
+ odoo_devops_tools-1.0.1.dist-info/METADATA,sha256=gWJ1Fi1vWqXPIw1tBiAwcM2hy1pQxvTUrp6BhRpaTcI,17617
5
+ odoo_devops_tools-1.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
+ odoo_devops_tools-1.0.1.dist-info/entry_points.txt,sha256=A8yKJox6oeHmW6ymU6X27AEBnwrV_N6lKb3eqQ_5TeQ,55
7
+ odoo_devops_tools-1.0.1.dist-info/top_level.txt,sha256=3qevYYwzrLMVylX0pxsrEqG7NIllKiMYbud3mzosKmg,18
8
+ odoo_devops_tools-1.0.1.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ odt-env = odoo_devops_tools.env:main
@@ -1,8 +0,0 @@
1
- odoo_devops_tools/__init__.py,sha256=J-j-u0itpEFT6irdmWmixQqYMadNl1X91TxUmoiLHMI,22
2
- odoo_devops_tools/env.py,sha256=Z5vAssdoLSMvo7_MojotM_Ibv9Ul4sFsGOTL7wyCRhI,90415
3
- odoo_devops_tools-1.0.0.dist-info/licenses/LICENSE,sha256=3kVGxFPI-TSQGAKsrsm355Lo7Gzq015mqD2K0k3NmUQ,1068
4
- odoo_devops_tools-1.0.0.dist-info/METADATA,sha256=tk3NkzZLhO69dQoGTPm-DyVNF7JsjRi3k43RhiMPa2Q,17521
5
- odoo_devops_tools-1.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
- odoo_devops_tools-1.0.0.dist-info/entry_points.txt,sha256=he_qPZDTHB3HbefjxaaRY7rDYaI9xSD0mUPnvSdM_4g,106
7
- odoo_devops_tools-1.0.0.dist-info/top_level.txt,sha256=3qevYYwzrLMVylX0pxsrEqG7NIllKiMYbud3mzosKmg,18
8
- odoo_devops_tools-1.0.0.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- odk-env = odoo_devops_tools.env:main
3
- odoo-devops-tools-env = odoo_devops_tools.env:main