From 2035dcc0208b0669438146082b03411dca1be203 Mon Sep 17 00:00:00 2001 From: woksin Date: Mon, 24 Aug 2026 14:37:30 +0200 Subject: [PATCH] Unblock development with contracts release --- Documentation/client-development-guide.md | 9 +++++++++ pyproject.toml | 8 +++++++- tests/test_contract_dependency.py | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/test_contract_dependency.py diff --git a/Documentation/client-development-guide.md b/Documentation/client-development-guide.md index a81d221..3c30ae7 100644 --- a/Documentation/client-development-guide.md +++ b/Documentation/client-development-guide.md @@ -19,6 +19,15 @@ Chronicle C# contracts -> idiomatic Chronicle.Python API ``` +### Temporary contracts distribution + +Until PyPI trusted publishing is configured, the project dependency resolves the verified +`cratis-chronicle-contracts` 16.38.2 wheel from its matching +[Chronicle GitHub release](https://github.com/Cratis/Chronicle/releases/tag/v16.38.2). A normal development install +fetches it automatically. Do not copy generated contracts into this repository. The dependency will move to the +PyPI release after [the publisher setup](https://github.com/Cratis/Chronicle.Python/issues/15) and +[first publication](https://github.com/Cratis/Chronicle.Python/issues/16) are complete. + ## Local kernel The development kernel listens on `localhost:35000`. Its main listener uses TLS and serves gRPC over HTTP/2. A diff --git a/pyproject.toml b/pyproject.toml index efb5d0e..67ff7fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,10 @@ classifiers = [ "Programming Language :: Python :: 3.14", "Typing :: Typed", ] -dependencies = [] +dependencies = [ + # Temporary release asset until PyPI trusted publishing is configured. + "cratis-chronicle-contracts @ https://github.com/Cratis/Chronicle/releases/download/v16.38.2/cratis_chronicle_contracts-16.38.2-py3-none-any.whl#sha256=357052da8a62653dcfa40c8051c4af2c6a6d29295cb6783f59dd5efdf4bdc3f9", +] [project.optional-dependencies] dev = [ @@ -43,6 +46,9 @@ Documentation = "https://github.com/Cratis/Chronicle.Python/tree/main/Documentat Repository = "https://github.com/Cratis/Chronicle.Python.git" Issues = "https://github.com/Cratis/Chronicle.Python/issues" +[tool.hatch.metadata] +allow-direct-references = true + [tool.hatch.version] source = "vcs" diff --git a/tests/test_contract_dependency.py b/tests/test_contract_dependency.py new file mode 100644 index 0000000..6cf2e04 --- /dev/null +++ b/tests/test_contract_dependency.py @@ -0,0 +1,17 @@ +# Copyright (c) Cratis. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. + +from cratis_chronicle_contracts.events_pb2 import EventType +from cratis_chronicle_contracts.events_pb2_grpc import EventTypesStub +from cratis_chronicle_contracts.protobuf_net.bcl_pb2 import Guid + + +def test_generated_contract_dependency_is_available() -> None: + event_type = EventType(Id="example", Generation=1) + guid = Guid(lo=1, hi=2) + + assert event_type.Id == "example" + assert event_type.Generation == 1 + assert guid.lo == 1 + assert guid.hi == 2 + assert EventTypesStub is not None