-
Notifications
You must be signed in to change notification settings - Fork 4
Protocol Scaffolder #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Protocol Scaffolder #618
Changes from all commits
Commits
Show all changes
188 commits
Select commit
Hold shift + click to select a range
09b67c6
feat: templates/protocols/dialogues.jinja
Karrenbelt 46d869b
tests: add test cases for primitive types and basic enums
Karrenbelt cb848e9
tests: add map-related test cases including nested and variant maps
Karrenbelt 1cc6687
tests: add nested message and oneof-related test cases
Karrenbelt a89ab5c
tests: add recursive structure test cases
Karrenbelt 78ae9dc
feat: first protodantic.jinja draft
Karrenbelt a44ac42
feat: add proto-schema-parser to pyproject.toml
Karrenbelt ac02f85
feat: first protodantic.py draft
Karrenbelt 5dd5c53
feat: protocols/hypothesis.jinja
Karrenbelt 7153cb8
feat: create and write code and tests in protodantic.py
Karrenbelt 537073d
chore: cleanup protodantic.py
Karrenbelt ed75c9a
tests: add integration tests for protodantic.create
Karrenbelt f6cb91c
fix: import path from repo_root
Karrenbelt f8e286a
feat: add .encode and .decode to protodantic.jinja
Karrenbelt 2d116d0
tests: add .encode and .decode invocation to hypothesis.jinja
Karrenbelt 77bd673
feat: add messages_pb2 generation via protoc
Karrenbelt e75f51c
tests: add optional_primitives.proto
Karrenbelt c4eba2f
feat: update protodantic.jinja and hypothesis.jinja to handle optiona…
Karrenbelt 9444d85
refactor: simplify protodantic.jinja .decode and .encode
Karrenbelt 8cc27f5
chore: rename fields repeated_primitives.proto
Karrenbelt 17599f0
tests: add repeated_primitives.proto
Karrenbelt c7d848c
feat: update protodantic.jinja and hypothesis.jinja to handle repeate…
Karrenbelt 510581d
tests: add basic_enum.proto
Karrenbelt 00b0b33
feat: update protodantic.jinja and hypothesis.jinja to handle basic e…
Karrenbelt 5d82d19
tests: add optional_enum.proto
Karrenbelt 1393402
feat: update protodantic.jinja to handle optional enum values
Karrenbelt 8792f1a
chore: make enum .decode strict
Karrenbelt 94352db
tests: add repeated_enum.proto
Karrenbelt 91547e3
feat: update protodantic.jinja to handle repeated enum values
Karrenbelt 0aa9e2e
fix: enum strategies based on field cardinality in hypothesis.jinja
Karrenbelt 20e152c
refactor: introduce macros in protodantic
Karrenbelt f1c9455
refactor: reuse scalar marcros in optional macros
Karrenbelt cd73f8c
refactor: simplify repeated macros
Karrenbelt 8ca18d0
refactor: unify scalar and enum handling in macros
Karrenbelt d2bbba5
tests: add simple_message.proto
Karrenbelt 9574ce5
tests: add nested_message.proto
Karrenbelt 972efc2
feat: introduce render_message macro for nested messages in protodant…
Karrenbelt fc8bad0
feat: introduce macros for nested messages in hypothesis.jinja
Karrenbelt abd9d5d
fix: encoding / decoding logic for nested messages in protodantic.jinja
Karrenbelt e4ba050
fix: nested message indentation protodantic.jinja
Karrenbelt 8d73eea
fix: fully qualified path for nested messages in hypothesis.jinja
Karrenbelt c51aef9
tests: add deeply_nested_message.proto
Karrenbelt f428269
fix: fully qualified path for nested messages in protodantic.jinja
Karrenbelt d772c55
tests: add regualr, optional and repeated fields to nested_message.proto
Karrenbelt 000fcb9
tests: add regualr, optional and repeated fields to deeply_nested_mes…
Karrenbelt b96459f
tests: add oneof_value.proto
Karrenbelt 72f7d7d
feat: add oneof to protodantic.jinja
Karrenbelt 5fe8c59
feat: custom primitives.jinja
Karrenbelt a1a63f0
feat: remove type_map and replace values in scalar_map with custom pr…
Karrenbelt da6cf01
tests: add all primitive types to oneof_value.proto
Karrenbelt 31314d7
feat: replace values in scalar_map with st.builds of custom primitive…
Karrenbelt 416eb80
feat: create primitives.py and pass necesary rendering variables in p…
Karrenbelt aa8e21b
chore: cleanup jinja templates
Karrenbelt daa5f08
refactor: read in custom primitive classes from generated code
Karrenbelt 3323c76
refactor: gemerate scalar_map dynamically from custom primitive classes
Karrenbelt 5dec497
tests: add all primitive types to map_primitive_values.proto
Karrenbelt 267107e
feat: add map to protodantic.jinja
Karrenbelt 124a9dc
fix: add to_float32 in custom Float for managing precision in primiti…
Karrenbelt 0dc4d1c
tests: add all primitive types to map_optional_primitive_values.proto
Karrenbelt 7e28191
feat: add optional map values to protodantic.jinja
Karrenbelt d42d6de
tests: add all primitive types and rename to map_repeated_primitive_v…
Karrenbelt 234eed5
tests: add map_repeated_primitive_values.proto
Karrenbelt f750d86
tests: add map_message.proto
Karrenbelt b6f7ea4
feat: add direct_nested to protodantic.jinja
Karrenbelt a4f6f67
refactor: remove `decoded_` prefix from variable names
Karrenbelt 78119e5
feat: proto schema parser adapters
Karrenbelt 8c89bb2
refactor: use proto schema adapters in protodantic and hypothesis jin…
Karrenbelt ec74317
refactor: use Message.fully_qualified_name in protodantic.jinja
Karrenbelt 4056f3d
feat: add qualified_type() method to protodantic MessageAdapter
Karrenbelt 9b1f131
refactor: use Message.qualified_type to simplify protodantic.jinja te…
Karrenbelt f2bc2f6
fix: ensure consistent trailing commas in generated constructor
Karrenbelt d7c1461
feat: formatter.render_attribute
Karrenbelt 4487598
feat: FileAdapter.file_elements, MessageAdapter.elements and MessageA…
Karrenbelt fc2a85e
feat: formatter.render_encoder and formatter.render
Karrenbelt 3165af5
feat: formatter.render_decoder
Karrenbelt 74f5d1a
refactor: remove logic from protodantic.jinja and pass formatter instead
Karrenbelt 05e4142
tests: add message_reference.proto
Karrenbelt 2fae96d
tests: add nested_enum.proto
Karrenbelt 47887aa
feat: hypothesis strategy for nested enum
Karrenbelt 5854f6d
fix: update map_enum.proto to prevent protobuf discriptor naming coll…
Karrenbelt e0c2c75
tests: add map_enum.proto
Karrenbelt cbdf741
feat: add logic for enum values in map to formatter
Karrenbelt fe53c8e
tests: add logic for handling map_enum test generation
Karrenbelt 4c30350
refactor: move protoc call upward to detect .proto errors before rend…
Karrenbelt c0c1071
refactor: remove passing prefix in formatter
Karrenbelt 71d44e0
feat: MessageAdapter.parent
Karrenbelt a5933fd
refactor: move MessageAdapter.qualified_type() -> formatter.qualified…
Karrenbelt 798b826
refactor: simplify encode_field and decode_field
Karrenbelt fca1b79
refactor: primitives.jinja -> primitives.py and simplify protodantic.py
Karrenbelt c7161c4
fix: add `from __future__ import annotations` to jinja template
Karrenbelt 2b754c5
fix: add FLOAT_PRIMITIVES, INTEGER_PRIMITIVES and PRIMITIVE_TYPE_MAP …
Karrenbelt 19d8bd6
fix: encode and decode ast.Comment
Karrenbelt 44c3390
feat: make update_protocol_tests
Karrenbelt 121ae56
chore: tests/data/protocols/.capitalisation_station as hidden dir for…
Karrenbelt 181e9c2
fix: remove breakpoint
Karrenbelt 0f4a02e
feat: utils.file_swapper
Karrenbelt 746c7bb
tests: utils.file_swapper
Karrenbelt 5c27464
fix: message_import_path
Karrenbelt e6fea2b
fix: dialogues.jinja
Karrenbelt 66900e8
tests: add empty_message.proto
Karrenbelt df5db51
feat: add docstrings to generated pydantic model code
Karrenbelt 15c9d2c
feat: field.cardinality handling for message encoding / decoding
Karrenbelt fe5a84b
tests: add repeated_message.proto
Karrenbelt c94813d
refactor: repeated_message.proto
Karrenbelt 0a3003b
tests: add optional_message.proto
Karrenbelt d20b40b
fix: encoding optional message
Karrenbelt 5ec1830
chore: improve readability hypothesis.jinja rendered output
Karrenbelt 5b700d9
feat: auto-update forward refs in protodantic.jinja
Karrenbelt 304dd7c
fix: simplify and correct message strategies using st.from_type
Karrenbelt 4158efb
feat: performatives.parse_annotation
Karrenbelt f80f122
test: performatives.parse_annotation
Karrenbelt 433a309
tests: complex performative annotation parsing
Karrenbelt db8296a
fix: performatives.parse_annotation with _split_top_level
Karrenbelt ee1c9ce
feat: test_dialogues.jinja
Karrenbelt aad889b
feat: primitive_strategies.jinja
Karrenbelt 8be53b5
refactor: render primitive_strategies.jinja and import types from the…
Karrenbelt faddb75
refactor: cls.update_forward_refs() -> cls.model_rebuild()
Karrenbelt e6d8d87
fix: test_dialogues.jinja mock skill_context and imports
Karrenbelt 23a33ae
feat: test_message.jinja
Karrenbelt 358bb2a
fix: type casting of performatives annotation to python
Karrenbelt 9622486
test: updated expected result in test_parse_performative_annotation
Karrenbelt 617e747
refactor: move protocol/scaffold.py -> behaviours/protocol_scaffolder.py
Karrenbelt ef764bd
fix: import path ProtocolScaffolder in behaviour/scaffold.py
Karrenbelt 146f858
feat: protocols/README.jinja
Karrenbelt 1218cc7
fix: update templates to pass adev lint
Karrenbelt c02f2de
test: adev scaffold protocol
Karrenbelt 8ea9ba2
feat: protocol scaffolder read_protocol_spec
Karrenbelt c6f581d
feat: ProtocolSpecification model
Karrenbelt 40419df
feat add computed properties to ProtocolSpecification
Karrenbelt d4c253f
feat initialize packages, aea generated protocol & aea publish
Karrenbelt 19dba5c
feat: generate_readme() using Jinja template
Karrenbelt b7b8c79
feat: generate_custom_types() using protodantic
Karrenbelt 04e58c7
fix: test_custom_types import patching
Karrenbelt a73d7a0
feat: generate_dialogues() using ProtocolSpecification
Karrenbelt d3510a1
feat: generate_test_dialogues() using ProtocolSpecification
Karrenbelt f67e749
feat: generate_test_messages() using ProtocolSpecification
Karrenbelt 26ca126
feat: update protocol.yaml with pydantic and hypothesis dependencies
Karrenbelt 4c79bb8
feat: adev fmt & lint, aea fingerprint on newly generated protocol code
Karrenbelt af1f0a4
refactor: use new protocol_scaffolder in adev command
Karrenbelt acd6b33
test: fix import and remove flawed capitalisation station protocol sp…
Karrenbelt 5527149
fix: connection scaffolder to use ProtocolSpecification
Karrenbelt 21f6d52
fix: test_scaffolder to use ProtocolSpecification
Karrenbelt fd222fc
chore: adev fmt lint
Karrenbelt 3210f09
Merge branch 'main' into fix/protodantic_integration
Karrenbelt 2c50c47
fix: use `aea push --local protocol` instead of `aea publish --local …
Karrenbelt 9d663bc
Merge pull request #634 from 8ball030/fix/protodantic_integration
Karrenbelt 7d34d4a
Merge pull request #633 from 8ball030/feat/protodantic_integration
Karrenbelt 0695a15
Merge pull request #632 from 8ball030/feat/protodantic_recursion
Karrenbelt eeeac78
Merge pull request #631 from 8ball030/feat/protodantic_formatter
Karrenbelt 68bcb02
Merge pull request #630 from 8ball030/feat/proto_schema_parser_adapters
Karrenbelt 3e05420
Merge pull request #628 from 8ball030/feat/protodantic_map
Karrenbelt 1a6745b
Merge pull request #627 from 8ball030/refactor/custom_primitive_templ…
Karrenbelt 0c8ea78
Merge pull request #626 from 8ball030/feat/protodantic_oneof
Karrenbelt 51c18ae
Merge pull request #625 from 8ball030/feat/nested_messages
Karrenbelt 17b825f
Merge pull request #624 from 8ball030/feat/protodantic_macros
Karrenbelt 6783caa
Merge pull request #623 from 8ball030/feat/basic-enum-support
Karrenbelt 9987e6e
Merge pull request #622 from 8ball030/feat/optional-repeated-primitives
Karrenbelt 864f9c3
Merge pull request #621 from 8ball030/feat/protodantic_encode_decode
Karrenbelt 530d7ea
Merge pull request #619 from 8ball030/tests/protodantic
Karrenbelt def919f
fix: test_scaffold_protocol
Karrenbelt e33ff7b
fix: test_scaffold_protocol
Karrenbelt 6ceb34f
fix: python version in pyproject <3.14 -> <3.13
Karrenbelt 5d94254
fix: pyproject.toml.template
Karrenbelt c9471c7
fix: file_swapper
Karrenbelt 466f9a2
fix: remove old test_scaffold_protocol
Karrenbelt 39c9536
fix: update templates/python/poetry.lock & templates/autonomy/poetry.…
Karrenbelt e0b6716
chore: remove import
Karrenbelt 6009bcb
chore: https://rpc.ankr.com/eth -> https://eth.drpc.org
Karrenbelt f79b85c
feat: module_scoped_dummy_agent_tim
Karrenbelt 860c670
test: add map_nested.proto
Karrenbelt 0fd5c03
fix: qualified_type via introduction of ResolvedType
Karrenbelt 850150d
refactor: renaming and property -> cachedproperty
Karrenbelt b15a79b
tests: add map_of_map.proto
Karrenbelt 96ef64d
refactor: explicit ast. reference in adapters.py
Karrenbelt 5e3f23f
chore: make fmt lint
Karrenbelt 76f48d5
tests: add map_scalar_keys.proto
Karrenbelt bff04dd
fix: point PYTHONPATH to tmp dir before `adev scaffold protocol` in t…
Karrenbelt fdda705
feat: protocols/performatives.jinja
Karrenbelt 9dceeac
refactor: import from tests/performatives.py in other tests
Karrenbelt e79c40b
chore: remove empty protocols/tests.jinja
Karrenbelt d5b9281
chore: make fmt lint
Karrenbelt 46efb90
refactor: unify template rendering with `TemplateContext` model and `…
Karrenbelt 830b52d
refactor: remove initial_performative_types
Karrenbelt e872187
refactor: moved hardcoded template paths into JinjaTemplates model
Karrenbelt b42b11a
refactor: protodantic.py
Karrenbelt 2f0ff1b
refactor: TemplateContext in protodantic.py
Karrenbelt 2965899
refactor: _prepare_pb2 in protodantic.py
Karrenbelt 87e7004
refactor: ImportPaths in protodantic.py
Karrenbelt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.