hector-cli 0.1.0__tar.gz → 0.2.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 (34) hide show
  1. {hector_cli-0.1.0 → hector_cli-0.2.1}/PKG-INFO +13 -1
  2. {hector_cli-0.1.0 → hector_cli-0.2.1}/README.md +12 -0
  3. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/base.py +10 -0
  4. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/init.py +6 -3
  5. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/validate.py +6 -2
  6. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/core.py +1 -1
  7. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/pipeline.py +14 -5
  8. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/scaffold.py +3 -3
  9. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector_cli.egg-info/PKG-INFO +13 -1
  10. {hector_cli-0.1.0 → hector_cli-0.2.1}/setup.py +13 -1
  11. {hector_cli-0.1.0 → hector_cli-0.2.1}/LICENSE +0 -0
  12. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/__init__.py +0 -0
  13. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/__main__.py +0 -0
  14. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/__init__.py +0 -0
  15. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/export.py +0 -0
  16. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/run.py +0 -0
  17. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/commands/test.py +0 -0
  18. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/connections.py +0 -0
  19. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/dependencies.py +0 -0
  20. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/docker.py +0 -0
  21. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/generator.py +0 -0
  22. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/hubs.py +0 -0
  23. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/mappings.py +0 -0
  24. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/modules.py +0 -0
  25. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/peripherals.py +0 -0
  26. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/reporters.py +0 -0
  27. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/runners.py +0 -0
  28. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector/validator.py +0 -0
  29. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector_cli.egg-info/SOURCES.txt +0 -0
  30. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector_cli.egg-info/dependency_links.txt +0 -0
  31. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector_cli.egg-info/entry_points.txt +0 -0
  32. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector_cli.egg-info/requires.txt +0 -0
  33. {hector_cli-0.1.0 → hector_cli-0.2.1}/hector_cli.egg-info/top_level.txt +0 -0
  34. {hector_cli-0.1.0 → hector_cli-0.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hector-cli
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: YAML-driven Renode + Verilator simulation orchestrator for embedded hardware CI
5
5
  Home-page: https://hector-ci.com
6
6
  Author: Nemesis
@@ -117,6 +117,7 @@ Generated files go in `.hector/` — add it to your `.gitignore`. The Renode **b
117
117
  | Command | Behaviour |
118
118
  |---|---|
119
119
  | `hector run` | Run simulation interactively (Renode monitor) |
120
+ | `hector run -f board.yaml` | Read a config file other than `.hector.yaml` (`-f`/`--file`; works on every command) |
120
121
  | `hector run --set BIN=fw.elf` | Override a config argument at the command line |
121
122
  | `hector run --set BIN=fw.elf --set BOARD=nucleo` | Override multiple arguments |
122
123
  | `hector run --debug boardA:3333` | Halt a CPU and open a GDB server |
@@ -147,13 +148,24 @@ Generated files go in `.hector/` — add it to your `.gitignore`. The Renode **b
147
148
  | `hector export` | Generate the files and print the run command instead of executing it |
148
149
  | `hector export --no-docker` | Print the bare `renode <resc>` command instead of the `docker run …` one |
149
150
  | `hector validate` | Validate `.hector.yaml` without running anything |
151
+ | `hector validate -f board.yaml` | Validate a config file by another name |
150
152
  | `hector init` | Scaffold a starter `.hector.yaml` |
153
+ | `hector init -f board.yaml` | Scaffold the starter config under a custom name |
151
154
  | `hector --version` | Print the tool version |
152
155
 
153
156
  `hector` is structured as subcommands: `run` (simulate), `test` (run the `tests:`
154
157
  section), `export` (emit the command without running it), plus `init` and
155
158
  `validate`. Run `hector <command> --help` for the flags each one accepts.
156
159
 
160
+ Every command reads (or, for `init`, writes) `.hector.yaml` by default. Point it
161
+ at a different file with **`-f` / `--file`** — useful when one project keeps
162
+ several configs (e.g. `ci.hector.yaml`, `local.hector.yaml`):
163
+
164
+ ```bash
165
+ hector test -f ci.hector.yaml
166
+ hector run --file boards/nucleo.yaml
167
+ ```
168
+
157
169
  ### Debug mode (`--debug NODE:PORT`)
158
170
 
159
171
  Repeat the flag for each machine you want to debug. ([Renode docs: GDB debugging](https://renode.readthedocs.io/en/latest/debugging/gdb.html))
@@ -87,6 +87,7 @@ Generated files go in `.hector/` — add it to your `.gitignore`. The Renode **b
87
87
  | Command | Behaviour |
88
88
  |---|---|
89
89
  | `hector run` | Run simulation interactively (Renode monitor) |
90
+ | `hector run -f board.yaml` | Read a config file other than `.hector.yaml` (`-f`/`--file`; works on every command) |
90
91
  | `hector run --set BIN=fw.elf` | Override a config argument at the command line |
91
92
  | `hector run --set BIN=fw.elf --set BOARD=nucleo` | Override multiple arguments |
92
93
  | `hector run --debug boardA:3333` | Halt a CPU and open a GDB server |
@@ -117,13 +118,24 @@ Generated files go in `.hector/` — add it to your `.gitignore`. The Renode **b
117
118
  | `hector export` | Generate the files and print the run command instead of executing it |
118
119
  | `hector export --no-docker` | Print the bare `renode <resc>` command instead of the `docker run …` one |
119
120
  | `hector validate` | Validate `.hector.yaml` without running anything |
121
+ | `hector validate -f board.yaml` | Validate a config file by another name |
120
122
  | `hector init` | Scaffold a starter `.hector.yaml` |
123
+ | `hector init -f board.yaml` | Scaffold the starter config under a custom name |
121
124
  | `hector --version` | Print the tool version |
122
125
 
123
126
  `hector` is structured as subcommands: `run` (simulate), `test` (run the `tests:`
124
127
  section), `export` (emit the command without running it), plus `init` and
125
128
  `validate`. Run `hector <command> --help` for the flags each one accepts.
126
129
 
130
+ Every command reads (or, for `init`, writes) `.hector.yaml` by default. Point it
131
+ at a different file with **`-f` / `--file`** — useful when one project keeps
132
+ several configs (e.g. `ci.hector.yaml`, `local.hector.yaml`):
133
+
134
+ ```bash
135
+ hector test -f ci.hector.yaml
136
+ hector run --file boards/nucleo.yaml
137
+ ```
138
+
127
139
  ### Debug mode (`--debug NODE:PORT`)
128
140
 
129
141
  Repeat the flag for each machine you want to debug. ([Renode docs: GDB debugging](https://renode.readthedocs.io/en/latest/debugging/gdb.html))
@@ -30,9 +30,19 @@ class Command:
30
30
  # Reusable flag groups (shared so each command's surface stays consistent)
31
31
  # ---------------------------------------------------------------------------
32
32
 
33
+ def add_config_file_argument(parser):
34
+ """The Hector config file to read. Shared by every config-driven command
35
+ (run / test / export / validate) and `init` (which writes it)."""
36
+ parser.add_argument(
37
+ "-f", "--file", metavar="PATH", dest="file", default=".hector.yaml",
38
+ help="Path to the Hector config file (default: .hector.yaml).",
39
+ )
40
+
41
+
33
42
  def add_common_arguments(parser):
34
43
  """Flags shared by the config-driven commands (run / test / export): they all
35
44
  read .hector.yaml, pin a Renode version, expand the matrix, and collect output."""
45
+ add_config_file_argument(parser)
36
46
  parser.add_argument(
37
47
  "--set", action="append", metavar="KEY=VALUE", dest="set_args",
38
48
  help="Override a config argument. Repeatable. Takes precedence over env vars "
@@ -2,14 +2,17 @@
2
2
  """`hector init` — scaffold a new .hector.yaml in the current directory."""
3
3
 
4
4
  from ..scaffold import scaffold_init
5
- from .base import COMMANDS, Command
5
+ from .base import COMMANDS, Command, add_config_file_argument
6
6
 
7
7
 
8
8
  @COMMANDS.register("init")
9
9
  class InitCommand(Command):
10
10
  name = "init"
11
- help = "Scaffold a new .hector.yaml in the current directory."
11
+ help = "Scaffold a new config file in the current directory."
12
+
13
+ def add_arguments(self, parser):
14
+ add_config_file_argument(parser)
12
15
 
13
16
  def execute(self, args):
14
- scaffold_init()
17
+ scaffold_init(args.file)
15
18
  return 0
@@ -2,14 +2,18 @@
2
2
  """`hector validate` — check .hector.yaml without running anything; exit 1 on errors."""
3
3
 
4
4
  from .. import pipeline
5
- from .base import COMMANDS, Command
5
+ from .base import COMMANDS, Command, add_config_file_argument
6
6
 
7
7
 
8
8
  @COMMANDS.register("validate")
9
9
  class ValidateCommand(Command):
10
10
  name = "validate"
11
- help = "Validate .hector.yaml without running anything; exit 1 on errors."
11
+ help = "Validate the config file without running anything; exit 1 on errors."
12
+
13
+ def add_arguments(self, parser):
14
+ add_config_file_argument(parser)
12
15
 
13
16
  def execute(self, args):
17
+ pipeline.apply_global_flags(args) # picks up -f/--file
14
18
  # _run_validate prints a report and exits with the right code itself.
15
19
  pipeline._run_validate()
@@ -66,7 +66,7 @@ class Registry:
66
66
  # ==========================================================================
67
67
  # CONSTANTS
68
68
  # ==========================================================================
69
- TOOL_VERSION = "0.1.0"
69
+ TOOL_VERSION = "0.2.1"
70
70
  SUPPORTED_SCHEMA_VERSIONS = {"0.1"}
71
71
 
72
72
  RENODE_REPO_URL = "https://github.com/renode/renode.git"
@@ -43,8 +43,17 @@ from .validator import print_issues, validate_config
43
43
  # adding one module — no changes here.
44
44
  # ---------------------------------------------------------------------------
45
45
 
46
+ # The config file every command reads/writes. Overridable with -f/--file; set by
47
+ # apply_global_flags before any config is loaded.
48
+ CONFIG_PATH = ".hector.yaml"
49
+
50
+
46
51
  def apply_global_flags(args):
47
- """Honour --workspace-mount / --no-docker before anything touches paths."""
52
+ """Honour --file / --workspace-mount / --no-docker before anything touches paths."""
53
+ path = getattr(args, "file", None)
54
+ if path:
55
+ global CONFIG_PATH
56
+ CONFIG_PATH = path
48
57
  if getattr(args, "workspace_mount", None):
49
58
  _core.WORKSPACE_MOUNT = args.workspace_mount
50
59
  if getattr(args, "no_docker", False):
@@ -53,8 +62,8 @@ def apply_global_flags(args):
53
62
 
54
63
 
55
64
  def load_config_or_exit():
56
- """Load and sanity-check ./.hector.yaml, or print an error and exit."""
57
- config_path = ".hector.yaml"
65
+ """Load and sanity-check the config file (CONFIG_PATH), or print an error and exit."""
66
+ config_path = CONFIG_PATH
58
67
  if not os.path.exists(config_path):
59
68
  print(f"[ERROR] No '{config_path}' in the current directory ({os.getcwd()}).\n"
60
69
  " Run hector from a project that has a .hector.yaml, or create one "
@@ -198,8 +207,8 @@ def snapshot_fastpath(args):
198
207
 
199
208
 
200
209
  def _run_validate():
201
- """Load .hector.yaml and report all config errors, then exit."""
202
- config_path = ".hector.yaml"
210
+ """Load the config file (CONFIG_PATH) and report all config errors, then exit."""
211
+ config_path = CONFIG_PATH
203
212
  if not os.path.exists(config_path):
204
213
  print(f"[VALIDATE] {config_path} not found in current directory.")
205
214
  sys.exit(1)
@@ -41,9 +41,9 @@ _PLATFORMS_NOTE = """\
41
41
  """
42
42
 
43
43
 
44
- def scaffold_init():
45
- """Interactively create a starter .hector.yaml config in the current directory."""
46
- target = ".hector.yaml"
44
+ def scaffold_init(target=".hector.yaml"):
45
+ """Interactively create a starter config in the current directory (default
46
+ name .hector.yaml; override via -f/--file)."""
47
47
  if os.path.exists(target):
48
48
  print(f"[INIT] {target} already exists — not overwriting.")
49
49
  print(f"[INIT] Delete or rename it, then run 'hector init' again.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hector-cli
3
- Version: 0.1.0
3
+ Version: 0.2.1
4
4
  Summary: YAML-driven Renode + Verilator simulation orchestrator for embedded hardware CI
5
5
  Home-page: https://hector-ci.com
6
6
  Author: Nemesis
@@ -117,6 +117,7 @@ Generated files go in `.hector/` — add it to your `.gitignore`. The Renode **b
117
117
  | Command | Behaviour |
118
118
  |---|---|
119
119
  | `hector run` | Run simulation interactively (Renode monitor) |
120
+ | `hector run -f board.yaml` | Read a config file other than `.hector.yaml` (`-f`/`--file`; works on every command) |
120
121
  | `hector run --set BIN=fw.elf` | Override a config argument at the command line |
121
122
  | `hector run --set BIN=fw.elf --set BOARD=nucleo` | Override multiple arguments |
122
123
  | `hector run --debug boardA:3333` | Halt a CPU and open a GDB server |
@@ -147,13 +148,24 @@ Generated files go in `.hector/` — add it to your `.gitignore`. The Renode **b
147
148
  | `hector export` | Generate the files and print the run command instead of executing it |
148
149
  | `hector export --no-docker` | Print the bare `renode <resc>` command instead of the `docker run …` one |
149
150
  | `hector validate` | Validate `.hector.yaml` without running anything |
151
+ | `hector validate -f board.yaml` | Validate a config file by another name |
150
152
  | `hector init` | Scaffold a starter `.hector.yaml` |
153
+ | `hector init -f board.yaml` | Scaffold the starter config under a custom name |
151
154
  | `hector --version` | Print the tool version |
152
155
 
153
156
  `hector` is structured as subcommands: `run` (simulate), `test` (run the `tests:`
154
157
  section), `export` (emit the command without running it), plus `init` and
155
158
  `validate`. Run `hector <command> --help` for the flags each one accepts.
156
159
 
160
+ Every command reads (or, for `init`, writes) `.hector.yaml` by default. Point it
161
+ at a different file with **`-f` / `--file`** — useful when one project keeps
162
+ several configs (e.g. `ci.hector.yaml`, `local.hector.yaml`):
163
+
164
+ ```bash
165
+ hector test -f ci.hector.yaml
166
+ hector run --file boards/nucleo.yaml
167
+ ```
168
+
157
169
  ### Debug mode (`--debug NODE:PORT`)
158
170
 
159
171
  Repeat the flag for each machine you want to debug. ([Renode docs: GDB debugging](https://renode.readthedocs.io/en/latest/debugging/gdb.html))
@@ -1,11 +1,23 @@
1
1
  # SPDX-License-Identifier: AGPL-3.0-or-later
2
2
  import os
3
+ import re
3
4
 
4
5
  from setuptools import setup, find_packages
5
6
 
6
7
  _HERE = os.path.abspath(os.path.dirname(__file__))
7
8
 
8
9
 
10
+ def _read_version():
11
+ # Single source of truth: hector/core.py's TOOL_VERSION. Read it textually
12
+ # (no import) so the build never needs the package's runtime deps installed.
13
+ with open(os.path.join(_HERE, "hector", "core.py")) as f:
14
+ for line in f:
15
+ m = re.match(r"""^TOOL_VERSION\s*=\s*["'](.+?)["']""", line)
16
+ if m:
17
+ return m.group(1)
18
+ raise RuntimeError("Could not find TOOL_VERSION in hector/core.py")
19
+
20
+
9
21
  def _read_readme():
10
22
  # README lives at the repo root (one level above this package dir); fall back
11
23
  # gracefully so the build never crashes if it's absent.
@@ -19,7 +31,7 @@ def _read_readme():
19
31
 
20
32
  setup(
21
33
  name="hector-cli",
22
- version="0.1.0",
34
+ version=_read_version(),
23
35
  description="YAML-driven Renode + Verilator simulation orchestrator for embedded hardware CI",
24
36
  long_description=_read_readme(),
25
37
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes