Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
132 lines (122 loc) · 5.72 KB
/
Copy pathpyproject.toml
File metadata and controls
132 lines (122 loc) · 5.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[project]
name = "metaobjects"
version = "1.2.0"
description = "Cross-language metadata standard: declare typed entities once, generate idiomatic drift-checked code across languages — Python port."
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [{ name = "Doug Mealing", email = "doug@metaobjects.com" }]
keywords = [
"metadata",
"code-generation",
"codegen",
"schema",
"orm",
"drift-detection",
"cross-language",
"sqlalchemy",
"pydantic",
"fastapi",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: Libraries",
"Typing :: Typed",
]
dependencies = [
# YAML authoring front-end (ADR-0006). The desugar lowers sugared YAML to
# canonical JSON before the shared tree-builder runs.
"PyYAML>=6.0",
]
[project.scripts]
# Codegen CLI (gen + verify). Named `metaobjects`, NOT `meta` — `meta` is the
# Node schema CLI. No `migrate` subcommand: schema is Node-owned (ADR-0015).
metaobjects = "metaobjects.cli:main"
[project.urls]
Homepage = "https://metaobjects.dev"
Repository = "https://github.com/metaobjectsdev/metaobjects"
Documentation = "https://github.com/metaobjectsdev/metaobjects/tree/main/docs"
Issues = "https://github.com/metaobjectsdev/metaobjects/issues"
Changelog = "https://github.com/metaobjectsdev/metaobjects/blob/main/CHANGELOG.md"
[project.optional-dependencies]
dev = ["pytest>=8", "pytest-xdist>=3.6", "mypy>=1.10", "ruff>=0.6", "pydantic>=2.8"]
# On-demand cross-language conformance suites — persistence + api-contract.
# pg8000 is pure-python so this extra installs cleanly without native deps;
# the persistence harness shells out to the docker CLI directly (matches the
# TS/Java pattern), and tests/integration/reaper.py starts Ryuk the same way to remove a
# killed run's containers; the api-contract harness drives a FastAPI Author API in-process
# via the starlette TestClient (httpx).
integration = ["pg8000>=1.31", "PyMySQL>=1.1", "fastapi>=0.110", "httpx>=0.27"]
# MySQL for the ObjectManager (`metaobjects.runtime.MySqlDriver`). PyMySQL is pure Python,
# so like pg8000 it installs without native build dependencies. SQLite needs nothing: the
# driver wraps the standard library's `sqlite3`.
mysql = ["PyMySQL>=1.1"]
# Jinja templates (ADR-0061): the second template engine beside Mustache. Imported only when a
# `.jinja` / `.j2` / `.jinja2` template is rendered or checked, so a Mustache-only project
# installs nothing extra.
jinja = ["jinja2>=3.1"]
# Pydantic 2.8 is the minimum for generated Python models (1.2.0). Generated code imports
# pydantic; the core loader does not, so it stays out of the base dependencies.
pydantic = ["pydantic>=2.8"]
[[tool.mypy.overrides]]
# PyMySQL ships no type information.
module = ["pymysql", "pymysql.*"]
ignore_missing_imports = true
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# FR-033 — the shared spec/metamodel/*.json files are COMMITTED copies under
# src/metaobjects/spec_metamodel/ (not build-time-generated), so hatchling's default
# package inclusion ships them in both the sdist and the wheel (read via
# importlib.resources, AOT-safe). A byte-identity gate
# (tests/conformance/test_spec_metamodel_embed.py) keeps the copies from drifting
# from the repo-root spec/metamodel/ source.
[tool.hatch.build.targets.wheel]
packages = ["src/metaobjects"]
exclude = ["**/KNOWN_GAPS.md"]
# No agent-context ships in this package. `metaobjects agent-docs` redirects to the Node
# scaffolder (`npx meta agent-docs --server python`), which owns that content, so the wheel
# and sdist carry none of it and an agent-context/ edit never makes PyPI publish.
# hatch_build.py is a deliberate no-op, kept only so tooling that names the hook does not break.
[tool.hatch.build.hooks.custom]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
[tool.mypy]
python_version = "3.11"
strict = true
files = ["src/metaobjects", "tests"]
# Golden expected files are generated-code fixtures (relative imports resolve only
# as an emitted package); they are validated by the golden + import-check tests, not mypy.
exclude = ["tests/codegen/golden/"]
[dependency-groups]
dev = [
"pytest>=9.0.3",
# scripts/ci-local.sh and scripts/integration-test.sh run the suite with `-n`; serial,
# the ~4,000 tests were the longest step in the full local run.
"pytest-xdist>=3.6",
# `uv run` installs THIS group (PEP 735), not [project.optional-dependencies].
# The validator-parity corpus (tests/codegen/test_validation_conformance.py)
# imports pydantic to exercise the generated Pydantic models, so it must be here
# or the CI `uv run pytest` collection fails with ModuleNotFoundError.
"pydantic>=2.8",
# ruff is the Python codegen format pass (src/metaobjects/codegen/format.py); the
# cli-registry corpus runs codegen, so without ruff in the group `uv run pytest`
# fails at format time with "No module named ruff".
"ruff>=0.6",
# The generated-router mypy gate (tests/codegen/test_router_mypy_strict.py) type-checks
# the emitted FastAPI routers under `mypy --strict`. The framework those routers import
# comes from `--extra integration`, which the python lane always passes.
"mypy>=1.10",
# The Jinja engine and its conformance corpora (fixtures/jinja-*-conformance/) run in the
# default suite, so the optional `jinja` extra's dependency is in the dev group too.
"jinja2>=3.1",
]