nativegate 0.1.3__tar.gz → 0.1.4__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.
- {nativegate-0.1.3 → nativegate-0.1.4}/PKG-INFO +1 -1
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/config.py +20 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate.egg-info/PKG-INFO +1 -1
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate.egg-info/SOURCES.txt +1 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/pyproject.toml +1 -1
- nativegate-0.1.4/tests/test_config_unknown_keys.py +77 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/README.md +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/__init__.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/__main__.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/buildinfo.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/cli.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/declared_invariants.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/discovery.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/driverbuild.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/drivers/__init__.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/drivers/cpp.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/drivers/fortran.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/__init__.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/cmake_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/docker_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/error_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/f2py_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/gateway_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/golden_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/k8s_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/mcp_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/middleware_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/pybind_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/pyproject_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/python_pkg_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/generators/test_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/golden.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/invariants.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/ir.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/lattice.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/locking.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/oracle.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/__init__.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/cpp.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/cpp_ast.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/cpp_regex.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/dialect.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/fixed_form.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/fortran.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/fortran_fparser.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/parsers/fortran_regex.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/preprocess.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/structural_invariants.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/suggest.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/templates/__init__.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/templates/golden_test_template.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate/wire.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate.egg-info/dependency_links.txt +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate.egg-info/entry_points.txt +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate.egg-info/requires.txt +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/nativegate.egg-info/top_level.txt +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/setup.cfg +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_buildinfo.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cli_serve_verify.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cli_suggest.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cli_verify_aggregate.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cmake_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cpp_ast.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cpp_driver.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_cpp_pipeline.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_declared_invariants.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_derived_types.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_dialect.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_docker_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_driverbuild.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_endpoint_docstrings.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_fixed_form.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_fortran_doc_comments.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_fortran_driver.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_fortran_fparser.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_fortran_libraries.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_fortran_pipeline.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_gateway_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_generated_python_is_valid.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_golden.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_invariants.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_ir_contract.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_k8s_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_lattice.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_legacy_cpp.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_legacy_fortran.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_locking.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_mcp_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_middleware_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_multifile_cpp.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_native_oracle.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_native_state_contract.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_oracle.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_preprocess_and_config.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_preprocessed_fortran.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_pybind_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_pyproject_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_quickstart.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_scalar_ref.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_service_gen.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_service_name_validation.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_shared_libraries.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_structural_invariants.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_suggest.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_verification_config.py +0 -0
- {nativegate-0.1.3 → nativegate-0.1.4}/tests/test_wire.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nativegate
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Make legacy C++/C/Fortran AI-ready and microservice-ready: expose native code as an MCP server, REST API and container
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -805,6 +805,26 @@ class ServiceConfig:
|
|
|
805
805
|
"Run `ngate create-service` first."
|
|
806
806
|
)
|
|
807
807
|
data = yaml.safe_load(config_path.read_text()) or {}
|
|
808
|
+
# Unknown top-level keys are an error, not dead weight. A new
|
|
809
|
+
# nativegate.yaml key read by an older nativegate (the exact case
|
|
810
|
+
# this project shipped CI against: `dialect: cd` under a nativegate
|
|
811
|
+
# that pre-dated it) would otherwise vanish the same way a letter
|
|
812
|
+
# transposed in `dialete:` would — the service generates from an
|
|
813
|
+
# assumption the user never wrote.
|
|
814
|
+
known_keys = {
|
|
815
|
+
"name", "language", "expose", "parser", "clang", "libraries",
|
|
816
|
+
"include_paths", "api", "dialect",
|
|
817
|
+
"fortran", # namespace for fortran.defines
|
|
818
|
+
# verification layer 3 keys
|
|
819
|
+
"state", "invariants", "ranges", "lattice",
|
|
820
|
+
}
|
|
821
|
+
unknown = sorted(set(data) - known_keys)
|
|
822
|
+
if unknown:
|
|
823
|
+
raise ConfigError(
|
|
824
|
+
f"{config_path}: unknown key(s) {', '.join(unknown)}. "
|
|
825
|
+
"Check the spelling against this nativegate version's supported "
|
|
826
|
+
"keys, or upgrade nativegate if the key is new."
|
|
827
|
+
)
|
|
808
828
|
expose = _load_expose(data.get("expose"), config_path)
|
|
809
829
|
clang_data = data.get("clang") or {}
|
|
810
830
|
# `None` means "no restriction": `expose: all` or an empty `expose:`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nativegate
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Make legacy C++/C/Fortran AI-ready and microservice-ready: expose native code as an MCP server, REST API and container
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -13,7 +13,7 @@ build-backend = "setuptools.build_meta"
|
|
|
13
13
|
|
|
14
14
|
[project]
|
|
15
15
|
name = "nativegate"
|
|
16
|
-
version = "0.1.
|
|
16
|
+
version = "0.1.4"
|
|
17
17
|
description = "Make legacy C++/C/Fortran AI-ready and microservice-ready: expose native code as an MCP server, REST API and container"
|
|
18
18
|
readme = "README.md"
|
|
19
19
|
requires-python = ">=3.10"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Unknown top-level keys in nativegate.yaml must fail loading.
|
|
2
|
+
|
|
3
|
+
Found in the wild (2026-09-23): specfun-py's CI installed a nativegate
|
|
4
|
+
that pre-dated the `dialect:` key and generated the service anyway from
|
|
5
|
+
an assumption never written down — the unknown key was swallowed as dead
|
|
6
|
+
weight. A typo in any key was equally silent. Now both are config errors
|
|
7
|
+
that say what is wrong and what to do about it.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import shutil
|
|
11
|
+
import textwrap
|
|
12
|
+
|
|
13
|
+
import pytest
|
|
14
|
+
|
|
15
|
+
from nativegate.config import ConfigError, ServiceConfig
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@pytest.fixture()
|
|
19
|
+
def scratch(tmp_path, monkeypatch):
|
|
20
|
+
service = tmp_path / "demo"
|
|
21
|
+
(service / "native").mkdir(parents=True)
|
|
22
|
+
monkeypatch.chdir(tmp_path)
|
|
23
|
+
return service
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _config_for_lines(text):
|
|
27
|
+
def _load(service):
|
|
28
|
+
(service / "nativegate.yaml").write_text(text)
|
|
29
|
+
return ServiceConfig.load(service)
|
|
30
|
+
return _load
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_unknown_key_is_an_error(scratch):
|
|
34
|
+
(scratch / "nativegate.yaml").write_text(textwrap.dedent("""\
|
|
35
|
+
name: demo
|
|
36
|
+
language: fortran
|
|
37
|
+
diatect: cd
|
|
38
|
+
expose:
|
|
39
|
+
functions: []
|
|
40
|
+
"""))
|
|
41
|
+
with pytest.raises(ConfigError) as exc:
|
|
42
|
+
ServiceConfig.load(scratch)
|
|
43
|
+
assert "diatect" in str(exc.value)
|
|
44
|
+
assert "upgrade nativegate" in str(exc.value)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_future_key_is_a_config_error_not_a_silent_noop(scratch):
|
|
48
|
+
(scratch / "nativegate.yaml").write_text(textwrap.dedent("""\
|
|
49
|
+
name: demo
|
|
50
|
+
language: fortran
|
|
51
|
+
dialect: cd
|
|
52
|
+
expose:
|
|
53
|
+
functions: []
|
|
54
|
+
"""))
|
|
55
|
+
# fine on a nativegate that knows the key
|
|
56
|
+
config = ServiceConfig.load(scratch)
|
|
57
|
+
assert config.dialect == "cd"
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def test_all_declared_keys_still_load(scratch):
|
|
61
|
+
(scratch / "nativegate.yaml").write_text(textwrap.dedent("""\
|
|
62
|
+
name: demo
|
|
63
|
+
language: fortran
|
|
64
|
+
dialect: cd
|
|
65
|
+
parser: auto
|
|
66
|
+
libraries:
|
|
67
|
+
- petro
|
|
68
|
+
include_paths: []
|
|
69
|
+
fortran:
|
|
70
|
+
defines: []
|
|
71
|
+
expose:
|
|
72
|
+
all: true
|
|
73
|
+
"""))
|
|
74
|
+
config = ServiceConfig.load(scratch)
|
|
75
|
+
assert config.dialect == "cd"
|
|
76
|
+
assert config.libraries == ["petro"]
|
|
77
|
+
assert config.expose.all is True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|