stinger-ipc 0.0.2__tar.gz → 0.0.3__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.
Files changed (63) hide show
  1. {stinger_ipc-0.0.2/stinger_ipc.egg-info → stinger_ipc-0.0.3}/PKG-INFO +2 -2
  2. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/pyproject.toml +3 -3
  3. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3/stinger_ipc.egg-info}/PKG-INFO +2 -2
  4. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stinger_ipc.egg-info/SOURCES.txt +4 -0
  5. stinger_ipc-0.0.3/stingeripc/tools/__init__.py +0 -0
  6. stinger_ipc-0.0.3/stingeripc/tools/markdown_generator.py +25 -0
  7. stinger_ipc-0.0.3/stingeripc/tools/python_generator.py +41 -0
  8. stinger_ipc-0.0.3/stingeripc/tools/rust_generator.py +50 -0
  9. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/LICENSE +0 -0
  10. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/README.md +0 -0
  11. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/setup.cfg +0 -0
  12. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stinger_ipc.egg-info/dependency_links.txt +0 -0
  13. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stinger_ipc.egg-info/entry_points.txt +0 -0
  14. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stinger_ipc.egg-info/requires.txt +0 -0
  15. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stinger_ipc.egg-info/top_level.txt +0 -0
  16. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/__init__.py +0 -0
  17. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/args.py +0 -0
  18. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/asyncapi.py +0 -0
  19. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/components.py +0 -0
  20. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/connection.py +0 -0
  21. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/exceptions.py +0 -0
  22. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/interface.py +0 -0
  23. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/lang_symb.py +0 -0
  24. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/CMakeLists.txt.jinja2 +0 -0
  25. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/examples/client_main.cpp.jinja2 +0 -0
  26. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/examples/server_main.cpp.jinja2 +0 -0
  27. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/broker.hpp.jinja2 +0 -0
  28. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/client.hpp.jinja2 +0 -0
  29. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/enums.hpp.jinja2 +0 -0
  30. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/ibrokerconnection.hpp.jinja2 +0 -0
  31. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/return_types.hpp.jinja2 +0 -0
  32. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/server.hpp.jinja2 +0 -0
  33. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/include/structs.hpp.jinja2 +0 -0
  34. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/src/broker.cpp.jinja2 +0 -0
  35. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/src/client.cpp.jinja2 +0 -0
  36. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/cpp/src/server.cpp.jinja2 +0 -0
  37. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/markdown/index.md.jinja2 +0 -0
  38. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/__init__.py.jinja2 +0 -0
  39. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/client.py.jinja2 +0 -0
  40. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/connection.py.jinja2 +0 -0
  41. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/interface_types.py.jinja2 +0 -0
  42. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/method_codes.py.jinja2 +0 -0
  43. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/pyproject.toml.jinja2 +0 -0
  44. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/python/server.py.jinja2 +0 -0
  45. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/Cargo.toml.jinja2 +0 -0
  46. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/client/Cargo.toml.jinja2 +0 -0
  47. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/client/examples/client.rs.jinja2 +0 -0
  48. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/client/src/lib.rs.jinja2 +0 -0
  49. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/connection/Cargo.toml.jinja2 +0 -0
  50. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/connection/examples/pub_and_recv.rs.jinja2 +0 -0
  51. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/connection/src/handler.rs.jinja2 +0 -0
  52. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/connection/src/lib.rs.jinja2 +0 -0
  53. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/connection/src/payloads.rs.jinja2 +0 -0
  54. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/server/Cargo.toml.jinja2 +0 -0
  55. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/server/examples/server.rs.jinja2 +0 -0
  56. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/templates/rust/server/src/lib.rs.jinja2 +0 -0
  57. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/stingeripc/topic.py +0 -0
  58. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/tests/test_args.py +0 -0
  59. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/tests/test_enum.py +0 -0
  60. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/tests/test_examples.py +0 -0
  61. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/tests/test_interface.py +0 -0
  62. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/tests/test_signal.py +0 -0
  63. {stinger_ipc-0.0.2 → stinger_ipc-0.0.3}/tests/test_topics.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stinger-ipc
3
- Version: 0.0.2
4
- Summary: Add your description here
3
+ Version: 0.0.3
4
+ Summary: Tools to create code to do IPC over MQTT
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "stinger-ipc"
3
- version = "0.0.2"
4
- description = "Add your description here"
3
+ version = "0.0.3"
4
+ description = "Tools to create code to do IPC over MQTT"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
  dependencies = [
@@ -33,7 +33,7 @@ requires = ["setuptools>=61.0", "wheel"]
33
33
  build-backend = "setuptools.build_meta"
34
34
 
35
35
  [tool.setuptools]
36
- packages = ["stingeripc"]
36
+ packages = ["stingeripc", "stingeripc.tools"]
37
37
 
38
38
  [tool.setuptools.package-data]
39
39
  stingeripc = [
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stinger-ipc
3
- Version: 0.0.2
4
- Summary: Add your description here
3
+ Version: 0.0.3
4
+ Summary: Tools to create code to do IPC over MQTT
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
@@ -49,6 +49,10 @@ stingeripc/templates/rust/connection/src/payloads.rs.jinja2
49
49
  stingeripc/templates/rust/server/Cargo.toml.jinja2
50
50
  stingeripc/templates/rust/server/examples/server.rs.jinja2
51
51
  stingeripc/templates/rust/server/src/lib.rs.jinja2
52
+ stingeripc/tools/__init__.py
53
+ stingeripc/tools/markdown_generator.py
54
+ stingeripc/tools/python_generator.py
55
+ stingeripc/tools/rust_generator.py
52
56
  tests/test_args.py
53
57
  tests/test_enum.py
54
58
  tests/test_examples.py
File without changes
@@ -0,0 +1,25 @@
1
+ import os
2
+ import sys
3
+ from jacobsjinjatoo import templator as jj2
4
+
5
+ from stingeripc import StingerInterface
6
+
7
+ def main():
8
+ inname = sys.argv[1]
9
+ outdir = sys.argv[2]
10
+ with open(inname, "r") as f:
11
+ stinger = StingerInterface.from_yaml(f)
12
+ params = {
13
+ "stinger": stinger,
14
+ }
15
+ t = jj2.CodeTemplator(output_dir=os.path.dirname(outdir))
16
+ t.add_template_dir(
17
+ os.path.join(os.path.dirname(__file__), "../templates", "markdown")
18
+ )
19
+ for output_file in [
20
+ "index.md",
21
+ ]:
22
+ t.render_template(f"{output_file}.jinja2", output_file, **params)
23
+
24
+ if __name__ == '__main__':
25
+ main()
@@ -0,0 +1,41 @@
1
+ from jacobsjinjatoo import templator as jj2
2
+ import sys
3
+ import yaml
4
+ import os.path
5
+
6
+
7
+
8
+ from stingeripc import StingerInterface
9
+
10
+ def main():
11
+ inname = sys.argv[1]
12
+ outdir = sys.argv[2]
13
+ with open(inname, "r") as f:
14
+ stinger = StingerInterface.from_yaml(f)
15
+ params = {
16
+ "stinger": stinger,
17
+ }
18
+ t = jj2.CodeTemplator(output_dir=os.path.dirname(outdir))
19
+ t.add_template_dir(
20
+ os.path.join(os.path.dirname(__file__), "../templates", "python")
21
+ )
22
+ for output_file in [
23
+ "pyproject.toml",
24
+ ]:
25
+ t.render_template(f"{output_file}.jinja2", output_file, **params)
26
+
27
+ generated_src_dir = os.path.join(outdir, stinger.name.lower())
28
+ os.makedirs(generated_src_dir, exist_ok=True)
29
+ for output_file in [
30
+ "server.py",
31
+ "client.py",
32
+ "connection.py",
33
+ "__init__.py",
34
+ "method_codes.py",
35
+ ]:
36
+ t.render_template(f"{output_file}.jinja2", os.path.join(stinger.name.lower(), output_file), **params)
37
+
38
+ t.render_template("interface_types.py.jinja2", os.path.join(stinger.name.lower(), f"{stinger.get_enum_module_name()}.py"), **params)
39
+
40
+ if __name__ == "__main__":
41
+ main()
@@ -0,0 +1,50 @@
1
+ from jacobsjinjatoo import templator as jj2
2
+ import sys
3
+ import yaml
4
+ import os
5
+ import shutil
6
+
7
+ from stingeripc import StingerInterface
8
+
9
+ def main():
10
+ inname = sys.argv[1] # Path to the stinger file
11
+ outdir = sys.argv[2] # Directory to which the files should be written
12
+ with open(inname, "r") as f:
13
+ stinger = StingerInterface.from_yaml(f)
14
+ params = {
15
+ "stinger": stinger,
16
+ }
17
+
18
+ if not os.path.exists(outdir):
19
+ os.makedirs(outdir)
20
+
21
+ template_dir = os.path.join(os.path.dirname(__file__), "../templates", "rust")
22
+
23
+ t = jj2.CodeTemplator(output_dir=os.path.dirname(outdir))
24
+ t.add_template_dir(template_dir)
25
+
26
+ def recursive_render_templates(local_dir: str):
27
+ cur_template_dir = os.path.join(template_dir, local_dir)
28
+ for entry in os.listdir(cur_template_dir):
29
+ if entry == 'target':
30
+ # Do not copy 'target' dir
31
+ continue
32
+ entry_full_path = os.path.join(cur_template_dir, entry)
33
+ entry_local_path = os.path.join(local_dir, entry)
34
+ if entry.endswith(".jinja2"):
35
+ print(f"GENER: {entry_local_path}")
36
+ t.render_template(entry_local_path, entry_local_path[:-len(".jinja2")], **params)
37
+ elif os.path.isdir(entry_full_path):
38
+ print(f"MKDIR: {entry_local_path}")
39
+ new_dir = os.path.join(outdir, entry_local_path)
40
+ if not os.path.exists(new_dir):
41
+ os.makedirs(new_dir)
42
+ recursive_render_templates(entry_local_path)
43
+ elif os.path.isfile(entry_full_path):
44
+ shutil.copyfile(entry_full_path, os.path.join(outdir, entry_local_path))
45
+ print(f"COPY: {entry_local_path}")
46
+
47
+ recursive_render_templates(".")
48
+
49
+ if __name__ == "__main__":
50
+ main()
File without changes
File without changes
File without changes