Skip to content

Commit 606437b

Browse files
committed
no-mistakes(document): Add Python config doc pointers; fix unused-var lint
1 parent 9a5124b commit 606437b

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎docs/features/own-your-codegen.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ provider class** in each language: a JSON file could express the declarative sur
6262
| Port | How the CLI / build tool loads your provider |
6363
|---|---|
6464
| **TypeScript** | `metaobjects.config.ts` → `providers: [myProvider]`. Threaded into `meta gen`, `meta verify`, `meta docs`, **and** the offline `meta migrate` paths (baseline + generate). |
65-
| **Python** | `metaobjects gen \| verify \| docs --provider module:symbol` (repeatable). The symbol resolves to a `Provider` (or a list, or a zero-arg factory returning one) and is composed **on top of** the core providers — parity with TS `config.providers`. E.g. `metaobjects gen ./metaobjects --out ./gen --provider myapp.providers:view_provider`. |
65+
| **Python** | `metaobjects gen \| verify \| docs --provider module:symbol` (repeatable). The symbol resolves to a `Provider` (or a list, or a zero-arg factory returning one) and is composed **on top of** the core providers — parity with TS `config.providers`. E.g. `metaobjects gen ./metaobjects --out ./gen --provider myapp.providers:view_provider`. A declarative `metaobjects.config.yaml` `providers:` list is also supported (resolved config-relative, no `PYTHONPATH=` — mirroring TS's config-file providers); see [`cli.md`](cli.md). |
6666
| **Java / Kotlin** | Put your compiled `MetaDataTypeProvider` on the **project classpath** with a `META-INF/services/com.metaobjects.registry.MetaDataTypeProvider` entry. `metaobjects-maven-plugin` builds the loader with the project classloader, so **Java ServiceLoader auto-discovers it** — no plugin config needed. |
6767
| **C#** | The loader accepts providers like every port; a first-class `dotnet meta` consumer-provider hook is tracked for a future release ([#158](https://github.com/metaobjectsdev/metaobjects/issues/158)). Today, extend the metamodel from an app that constructs the loader directly. |
6868

‎docs/ports/python.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ metaobjects gen ./metadata --out ./generated # codegen → write
9595
metaobjects verify ./metadata --out ./generated # drift gate; bare verify defaults to --codegen
9696
```
9797

98+
For multi-target projects (several `outDir`s, per-target generator/entity
99+
selection, config-relative provider resolution), `metaobjects gen`/`verify` also
100+
read a declarative [`metaobjects.config.yaml`](../features/cli.md) (#267) — run
101+
either with no positional `<metadata_dir>` to use it; the flag path above stays
102+
byte-identical.
103+
98104
**Both `pydantic` and `fastapi` are consumer-installed, not transitive deps of
99105
`metaobjects` itself** — the entity/router files this emits `import pydantic`
100106
and `import fastapi`, so add them before importing the generated code:

‎server/python/tests/codegen/test_cli_config_verify.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_verify_codegen_no_args_in_sync(tmp_path: Path) -> None:
5555

5656

5757
def test_verify_codegen_bare_defaults_to_codegen(tmp_path: Path, monkeypatch) -> None:
58-
cfg = _project(tmp_path)
58+
_project(tmp_path)
5959
monkeypatch.chdir(tmp_path)
6060
assert main(["gen"]) == 0
6161
assert main(["verify"]) == 0 # bare verify → --codegen default, config-driven
@@ -84,7 +84,7 @@ def test_verify_codegen_target_scopes(tmp_path: Path) -> None:
8484

8585
def test_verify_flag_path_still_works_with_config_present(tmp_path: Path) -> None:
8686
"""Back-compat: legacy `verify <dir> --out` diff is unchanged when a config exists."""
87-
cfg = _project(tmp_path)
87+
_project(tmp_path)
8888
meta = tmp_path / "metaobjects"
8989
out = tmp_path / "flagout"
9090
assert main(["gen", str(meta), "--out", str(out)]) == 0

0 commit comments

Comments
 (0)