moat-kv 0.70.22__tar.gz → 0.70.24__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 (188) hide show
  1. moat_kv-0.70.24/LICENSE.txt +14 -0
  2. {moat_kv-0.70.22 → moat_kv-0.70.24}/PKG-INFO +8 -11
  3. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/docs/source/conf.py +33 -31
  4. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/examples/pathify.py +8 -6
  5. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/__init__.py +1 -0
  6. moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/_cfg.yaml +97 -0
  7. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/_main.py +6 -9
  8. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/actor/__init__.py +2 -1
  9. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/actor/deletor.py +3 -1
  10. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/auth/__init__.py +8 -10
  11. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/auth/_test.py +6 -12
  12. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/auth/password.py +2 -0
  13. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/auth/root.py +2 -0
  14. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/backend/__init__.py +1 -0
  15. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/backend/mqtt.py +3 -3
  16. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/backend/serf.py +1 -0
  17. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/client.py +34 -50
  18. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/code.py +10 -3
  19. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/codec.py +1 -0
  20. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/acl.py +12 -6
  21. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/auth.py +5 -2
  22. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/code.py +10 -23
  23. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/codec.py +10 -14
  24. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/data.py +12 -21
  25. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/dump/__init__.py +4 -2
  26. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/error.py +5 -12
  27. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/internal.py +6 -15
  28. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/job.py +26 -31
  29. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/log.py +1 -0
  30. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/server.py +2 -3
  31. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/type.py +26 -28
  32. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/config.py +2 -0
  33. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/data.py +8 -7
  34. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/errors.py +17 -9
  35. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/exceptions.py +1 -7
  36. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/mock/__init__.py +9 -5
  37. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/mock/mqtt.py +7 -12
  38. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/mock/serf.py +6 -9
  39. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/mock/tracer.py +2 -4
  40. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/model.py +16 -24
  41. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/obj/__init__.py +30 -20
  42. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/obj/command.py +7 -12
  43. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/runner.py +38 -35
  44. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/server.py +86 -90
  45. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/types.py +5 -8
  46. moat_kv-0.70.24/docs/source/conf.py +201 -0
  47. moat_kv-0.70.24/examples/pathify.py +45 -0
  48. moat_kv-0.70.24/moat/kv/__init__.py +19 -0
  49. moat_kv-0.70.24/moat/kv/_cfg.yaml +97 -0
  50. moat_kv-0.70.24/moat/kv/_main.py +91 -0
  51. moat_kv-0.70.24/moat/kv/actor/__init__.py +98 -0
  52. moat_kv-0.70.24/moat/kv/actor/deletor.py +139 -0
  53. moat_kv-0.70.24/moat/kv/auth/__init__.py +444 -0
  54. moat_kv-0.70.24/moat/kv/auth/_test.py +166 -0
  55. moat_kv-0.70.24/moat/kv/auth/password.py +234 -0
  56. moat_kv-0.70.24/moat/kv/auth/root.py +58 -0
  57. moat_kv-0.70.24/moat/kv/backend/__init__.py +67 -0
  58. moat_kv-0.70.24/moat/kv/backend/mqtt.py +74 -0
  59. moat_kv-0.70.24/moat/kv/backend/serf.py +45 -0
  60. moat_kv-0.70.24/moat/kv/client.py +1025 -0
  61. moat_kv-0.70.24/moat/kv/code.py +236 -0
  62. moat_kv-0.70.24/moat/kv/codec.py +11 -0
  63. moat_kv-0.70.24/moat/kv/command/__init__.py +1 -0
  64. moat_kv-0.70.24/moat/kv/command/acl.py +180 -0
  65. moat_kv-0.70.24/moat/kv/command/auth.py +261 -0
  66. moat_kv-0.70.24/moat/kv/command/code.py +293 -0
  67. moat_kv-0.70.24/moat/kv/command/codec.py +186 -0
  68. moat_kv-0.70.24/moat/kv/command/data.py +265 -0
  69. moat_kv-0.70.24/moat/kv/command/dump/__init__.py +143 -0
  70. moat_kv-0.70.24/moat/kv/command/error.py +149 -0
  71. moat_kv-0.70.24/moat/kv/command/internal.py +248 -0
  72. moat_kv-0.70.24/moat/kv/command/job.py +433 -0
  73. moat_kv-0.70.24/moat/kv/command/log.py +53 -0
  74. moat_kv-0.70.24/moat/kv/command/server.py +114 -0
  75. moat_kv-0.70.24/moat/kv/command/type.py +201 -0
  76. moat_kv-0.70.24/moat/kv/config.py +46 -0
  77. moat_kv-0.70.24/moat/kv/data.py +216 -0
  78. moat_kv-0.70.24/moat/kv/errors.py +561 -0
  79. moat_kv-0.70.24/moat/kv/exceptions.py +126 -0
  80. moat_kv-0.70.24/moat/kv/mock/__init__.py +101 -0
  81. moat_kv-0.70.24/moat/kv/mock/mqtt.py +159 -0
  82. moat_kv-0.70.24/moat/kv/mock/serf.py +250 -0
  83. moat_kv-0.70.24/moat/kv/mock/tracer.py +63 -0
  84. moat_kv-0.70.24/moat/kv/model.py +1069 -0
  85. moat_kv-0.70.24/moat/kv/obj/__init__.py +646 -0
  86. moat_kv-0.70.24/moat/kv/obj/command.py +241 -0
  87. moat_kv-0.70.24/moat/kv/runner.py +1347 -0
  88. moat_kv-0.70.24/moat/kv/server.py +2809 -0
  89. moat_kv-0.70.24/moat/kv/types.py +513 -0
  90. {moat_kv-0.70.22 → moat_kv-0.70.24}/moat_kv.egg-info/PKG-INFO +8 -11
  91. moat_kv-0.70.24/moat_kv.egg-info/SOURCES.txt +100 -0
  92. {moat_kv-0.70.22 → moat_kv-0.70.24}/moat_kv.egg-info/requires.txt +3 -3
  93. moat_kv-0.70.24/moat_kv.egg-info/top_level.txt +9 -0
  94. {moat_kv-0.70.22 → moat_kv-0.70.24}/pyproject.toml +10 -12
  95. moat_kv-0.70.22/.appveyor.yml +0 -26
  96. moat_kv-0.70.22/.coveragerc +0 -9
  97. moat_kv-0.70.22/.gitignore +0 -65
  98. moat_kv-0.70.22/.gitmodules +0 -24
  99. moat_kv-0.70.22/.pylintrc +0 -3
  100. moat_kv-0.70.22/.readthedocs.yml +0 -16
  101. moat_kv-0.70.22/.travis.yml +0 -34
  102. moat_kv-0.70.22/Makefile +0 -21
  103. moat_kv-0.70.22/ci/rtd-requirements.txt +0 -4
  104. moat_kv-0.70.22/ci/test-requirements.txt +0 -7
  105. moat_kv-0.70.22/ci/travis.sh +0 -96
  106. moat_kv-0.70.22/docs/Makefile +0 -20
  107. moat_kv-0.70.22/docs/make.bat +0 -36
  108. moat_kv-0.70.22/docs/source/TODO.rst +0 -61
  109. moat_kv-0.70.22/docs/source/_static/.gitkeep +0 -0
  110. moat_kv-0.70.22/docs/source/acls.rst +0 -80
  111. moat_kv-0.70.22/docs/source/auth.rst +0 -84
  112. moat_kv-0.70.22/docs/source/client_protocol.rst +0 -456
  113. moat_kv-0.70.22/docs/source/code.rst +0 -341
  114. moat_kv-0.70.22/docs/source/command_line.rst +0 -1187
  115. moat_kv-0.70.22/docs/source/common_protocol.rst +0 -47
  116. moat_kv-0.70.22/docs/source/debugging.rst +0 -70
  117. moat_kv-0.70.22/docs/source/extend.rst +0 -36
  118. moat_kv-0.70.22/docs/source/history.rst +0 -36
  119. moat_kv-0.70.22/docs/source/index.rst +0 -75
  120. moat_kv-0.70.22/docs/source/model.rst +0 -54
  121. moat_kv-0.70.22/docs/source/overview.rst +0 -84
  122. moat_kv-0.70.22/docs/source/related.rst +0 -89
  123. moat_kv-0.70.22/docs/source/server_protocol.rst +0 -455
  124. moat_kv-0.70.22/docs/source/startup.rst +0 -31
  125. moat_kv-0.70.22/docs/source/translator.rst +0 -244
  126. moat_kv-0.70.22/docs/source/tutorial.rst +0 -714
  127. moat_kv-0.70.22/docs/source/v3.rst +0 -168
  128. moat_kv-0.70.22/examples/code/transform.scale.yml +0 -21
  129. moat_kv-0.70.22/examples/code/transform.switch.yml +0 -82
  130. moat_kv-0.70.22/examples/code/transform.timeslot.yml +0 -63
  131. moat_kv-0.70.22/mktag +0 -8
  132. moat_kv-0.70.22/moat/__init__.py +0 -8
  133. moat_kv-0.70.22/moat/kv/_config.yaml +0 -98
  134. moat_kv-0.70.22/moat_kv.egg-info/SOURCES.txt +0 -138
  135. moat_kv-0.70.22/moat_kv.egg-info/top_level.txt +0 -1
  136. moat_kv-0.70.22/scripts/current +0 -15
  137. moat_kv-0.70.22/scripts/env +0 -8
  138. moat_kv-0.70.22/scripts/init +0 -39
  139. moat_kv-0.70.22/scripts/recover +0 -17
  140. moat_kv-0.70.22/scripts/rotate +0 -33
  141. moat_kv-0.70.22/scripts/run +0 -29
  142. moat_kv-0.70.22/scripts/run-all +0 -10
  143. moat_kv-0.70.22/scripts/run-any +0 -10
  144. moat_kv-0.70.22/scripts/run-single +0 -15
  145. moat_kv-0.70.22/scripts/success +0 -4
  146. moat_kv-0.70.22/systemd/moat-kv-recover.service +0 -21
  147. moat_kv-0.70.22/systemd/moat-kv-rotate.service +0 -20
  148. moat_kv-0.70.22/systemd/moat-kv-rotate.timer +0 -10
  149. moat_kv-0.70.22/systemd/moat-kv-run-all.service +0 -26
  150. moat_kv-0.70.22/systemd/moat-kv-run-all@.service +0 -25
  151. moat_kv-0.70.22/systemd/moat-kv-run-any.service +0 -26
  152. moat_kv-0.70.22/systemd/moat-kv-run-any@.service +0 -25
  153. moat_kv-0.70.22/systemd/moat-kv-run-single.service +0 -26
  154. moat_kv-0.70.22/systemd/moat-kv-run-single@.service +0 -25
  155. moat_kv-0.70.22/systemd/moat-kv.service +0 -27
  156. moat_kv-0.70.22/systemd/postinst +0 -7
  157. moat_kv-0.70.22/systemd/sysusers +0 -3
  158. moat_kv-0.70.22/tests/__init__.py +0 -43
  159. moat_kv-0.70.22/tests/conftest.py +0 -6
  160. moat_kv-0.70.22/tests/logging.cfg +0 -34
  161. moat_kv-0.70.22/tests/test_basic.py +0 -451
  162. moat_kv-0.70.22/tests/test_basic_serf.py +0 -425
  163. moat_kv-0.70.22/tests/test_feature_acl.py +0 -61
  164. moat_kv-0.70.22/tests/test_feature_allrunner.py +0 -59
  165. moat_kv-0.70.22/tests/test_feature_auth.py +0 -152
  166. moat_kv-0.70.22/tests/test_feature_code.py +0 -46
  167. moat_kv-0.70.22/tests/test_feature_config.py +0 -23
  168. moat_kv-0.70.22/tests/test_feature_convert.py +0 -100
  169. moat_kv-0.70.22/tests/test_feature_dh.py +0 -22
  170. moat_kv-0.70.22/tests/test_feature_error.py +0 -83
  171. moat_kv-0.70.22/tests/test_feature_mirror.py +0 -27
  172. moat_kv-0.70.22/tests/test_feature_runner.py +0 -121
  173. moat_kv-0.70.22/tests/test_feature_singlerunner.py +0 -57
  174. moat_kv-0.70.22/tests/test_feature_ssl.py +0 -120
  175. moat_kv-0.70.22/tests/test_feature_typecheck.py +0 -222
  176. moat_kv-0.70.22/tests/test_kill.py +0 -53
  177. moat_kv-0.70.22/tests/test_load_save.py +0 -379
  178. moat_kv-0.70.22/tests/test_multi.py +0 -187
  179. moat_kv-0.70.22/tests/test_passthru.py +0 -62
  180. moat_kv-0.70.22/tests/test_recover.py +0 -121
  181. {moat_kv-0.70.22 → moat_kv-0.70.24}/LICENSE +0 -0
  182. {moat_kv-0.70.22 → moat_kv-0.70.24}/LICENSE.APACHE2 +0 -0
  183. {moat_kv-0.70.22 → moat_kv-0.70.24}/LICENSE.MIT +0 -0
  184. {moat_kv-0.70.22 → moat_kv-0.70.24}/MANIFEST.in +0 -0
  185. {moat_kv-0.70.22 → moat_kv-0.70.24}/README.rst +0 -0
  186. {moat_kv-0.70.22 → moat_kv-0.70.24/debian/moat-kv/usr/lib/python3/dist-packages}/moat/kv/command/__init__.py +0 -0
  187. {moat_kv-0.70.22 → moat_kv-0.70.24}/moat_kv.egg-info/dependency_links.txt +0 -0
  188. {moat_kv-0.70.22 → moat_kv-0.70.24}/setup.cfg +0 -0
@@ -0,0 +1,14 @@
1
+ The code in this repository, and all MoaT submodules it refers to,
2
+ is part of the MoaT project.
3
+
4
+ Unless a submodule's LICENSE.txt states otherwise, all included files are
5
+ licensed under the LGPL V3, as published by the FSF at
6
+ https://www.gnu.org/licenses/lgpl-3.0.html .
7
+
8
+ In addition to the LGPL's terms, the author(s) respectfully ask all users of
9
+ this code to contribute any bug fixes or enhancements. Also, please link back to
10
+ https://M-o-a-T.org.
11
+
12
+ Thank you.
13
+
14
+ Copyright © 2021 ff.: the MoaT contributor(s), as per the git changelog(s).
@@ -1,15 +1,13 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: moat-kv
3
- Version: 0.70.22
3
+ Version: 0.70.24
4
4
  Summary: A distributed no-master key-value store
5
5
  Author-email: Matthias Urlichs <matthias@urlichs.de>
6
6
  Project-URL: homepage, https://m-o-a-t.org
7
- Project-URL: repository, https://github.com/M-o-a-T/moat-kv
7
+ Project-URL: repository, https://github.com/M-o-a-T/moat
8
8
  Keywords: MoaT
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Intended Audience :: Information Technology
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: License :: OSI Approved :: Apache Software License
13
11
  Classifier: Framework :: AsyncIO
14
12
  Classifier: Framework :: Trio
15
13
  Classifier: Operating System :: POSIX :: Linux
@@ -21,9 +19,7 @@ Classifier: Topic :: Home Automation
21
19
  Classifier: Topic :: System :: Distributed Computing
22
20
  Requires-Python: >=3.8
23
21
  Description-Content-Type: text/x-rst
24
- License-File: LICENSE
25
- License-File: LICENSE.APACHE2
26
- License-File: LICENSE.MIT
22
+ License-File: LICENSE.txt
27
23
  Requires-Dist: asyncclick>7.99
28
24
  Requires-Dist: trio>=0.22
29
25
  Requires-Dist: anyio>=4
@@ -35,14 +31,15 @@ Requires-Dist: asyncscope>=0.10.4
35
31
  Requires-Dist: jsonschema>=2.5
36
32
  Requires-Dist: ruyaml>=0.89
37
33
  Requires-Dist: PyNaCl>=1.3
38
- Requires-Dist: moat-lib-diffiehellman~=0.13.1.6
34
+ Requires-Dist: moat-lib-diffiehellman~=0.13.4
39
35
  Requires-Dist: psutil
40
36
  Requires-Dist: simpleeval>=0.9.10
41
- Requires-Dist: moat-mqtt~=0.39.4
42
- Requires-Dist: moat-util>=0.51.3
37
+ Requires-Dist: moat-mqtt~=0.42.3
38
+ Requires-Dist: moat-util~=0.56.4
43
39
  Requires-Dist: exceptiongroup; python_version < "3.11"
44
40
  Provides-Extra: dev
45
41
  Requires-Dist: moat-src>=0.5.0; extra == "dev"
42
+ Dynamic: license-file
46
43
 
47
44
  =======
48
45
  MoaT-KV
@@ -19,8 +19,9 @@
19
19
  #
20
20
  import os
21
21
  import sys
22
+
22
23
  # So autodoc can import our package
23
- sys.path.insert(0, os.path.abspath('../..'))
24
+ sys.path.insert(0, os.path.abspath("../.."))
24
25
 
25
26
  # Warn about all references to unknown targets
26
27
  nitpicky = True
@@ -44,16 +45,16 @@ autodoc_inherit_docstrings = False
44
45
  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
45
46
  # ones.
46
47
  extensions = [
47
- 'sphinx.ext.autodoc',
48
- 'sphinx.ext.intersphinx',
49
- 'sphinx.ext.coverage',
50
- 'sphinx.ext.napoleon',
51
- 'sphinxcontrib_trio',
48
+ "sphinx.ext.autodoc",
49
+ "sphinx.ext.intersphinx",
50
+ "sphinx.ext.coverage",
51
+ "sphinx.ext.napoleon",
52
+ "sphinxcontrib_trio",
52
53
  ]
53
54
 
54
55
  intersphinx_mapping = {
55
- "python": ('https://docs.python.org/3', None),
56
- "trio": ('https://trio.readthedocs.io/en/stable', None),
56
+ "python": ("https://docs.python.org/3", None),
57
+ "trio": ("https://trio.readthedocs.io/en/stable", None),
57
58
  }
58
59
 
59
60
  autodoc_member_order = "bysource"
@@ -65,15 +66,15 @@ templates_path = []
65
66
  # You can specify multiple suffix as a list of string:
66
67
  #
67
68
  # source_suffix = ['.rst', '.md']
68
- source_suffix = '.rst'
69
+ source_suffix = ".rst"
69
70
 
70
71
  # The master toctree document.
71
- master_doc = 'index'
72
+ master_doc = "index"
72
73
 
73
74
  # General information about the project.
74
- project = 'MoaT-KV'
75
- copyright = 'The MoaT-KV authors'
76
- author = 'The MoaT-KV authors'
75
+ project = "MoaT-KV"
76
+ copyright = "The MoaT-KV authors"
77
+ author = "The MoaT-KV authors"
77
78
 
78
79
  # The version info for the project you're documenting, acts as replacement for
79
80
  # |version| and |release|, also used in various other places throughout the
@@ -81,6 +82,7 @@ author = 'The MoaT-KV authors'
81
82
  #
82
83
  # The short X.Y version.
83
84
  import pkg_resources
85
+
84
86
  version = pkg_resources.get_distribution("moat.kv")._version
85
87
 
86
88
  # The full version, including alpha/beta/rc tags.
@@ -99,10 +101,10 @@ language = None
99
101
  exclude_patterns = []
100
102
 
101
103
  # The name of the Pygments (syntax highlighting) style to use.
102
- pygments_style = 'sphinx'
104
+ pygments_style = "sphinx"
103
105
 
104
106
  # The default language for :: blocks
105
- highlight_language = 'python3'
107
+ highlight_language = "python3"
106
108
 
107
109
  # If true, `todo` and `todoList` produce output, else they produce nothing.
108
110
  todo_include_todos = False
@@ -113,13 +115,14 @@ todo_include_todos = False
113
115
  # The theme to use for HTML and HTML Help pages. See the documentation for
114
116
  # a list of builtin themes.
115
117
  #
116
- #html_theme = 'alabaster'
118
+ # html_theme = 'alabaster'
117
119
 
118
120
  # We have to set this ourselves, not only because it's useful for local
119
121
  # testing, but also because if we don't then RTD will throw away our
120
122
  # html_theme_options.
121
123
  import sphinx_rtd_theme
122
- html_theme = 'sphinx_rtd_theme'
124
+
125
+ html_theme = "sphinx_rtd_theme"
123
126
  html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
124
127
 
125
128
  # Theme options are theme-specific and customize the look and feel of a theme
@@ -139,13 +142,13 @@ html_theme_options = {
139
142
  # Add any paths that contain custom static files (such as style sheets) here,
140
143
  # relative to this directory. They are copied after the builtin static files,
141
144
  # so a file named "default.css" will overwrite the builtin "default.css".
142
- html_static_path = ['_static']
145
+ html_static_path = ["_static"]
143
146
 
144
147
 
145
148
  # -- Options for HTMLHelp output ------------------------------------------
146
149
 
147
150
  # Output file base name for HTML help builder.
148
- htmlhelp_basename = 'moat.kv-doc'
151
+ htmlhelp_basename = "moat.kv-doc"
149
152
 
150
153
 
151
154
  # -- Options for LaTeX output ---------------------------------------------
@@ -154,15 +157,12 @@ latex_elements = {
154
157
  # The paper size ('letterpaper' or 'a4paper').
155
158
  #
156
159
  # 'papersize': 'letterpaper',
157
-
158
160
  # The font size ('10pt', '11pt' or '12pt').
159
161
  #
160
162
  # 'pointsize': '10pt',
161
-
162
163
  # Additional stuff for the LaTeX preamble.
163
164
  #
164
165
  # 'preamble': '',
165
-
166
166
  # Latex figure (float) alignment
167
167
  #
168
168
  # 'figure_align': 'htbp',
@@ -172,8 +172,7 @@ latex_elements = {
172
172
  # (source start file, target name, title,
173
173
  # author, documentclass [howto, manual, or own class]).
174
174
  latex_documents = [
175
- (master_doc, 'moat.kv.tex', 'Trio Documentation',
176
- author, 'manual'),
175
+ (master_doc, "moat.kv.tex", "Trio Documentation", author, "manual"),
177
176
  ]
178
177
 
179
178
 
@@ -181,10 +180,7 @@ latex_documents = [
181
180
 
182
181
  # One entry per manual page. List of tuples
183
182
  # (source start file, name, description, authors, manual section).
184
- man_pages = [
185
- (master_doc, 'moat.kv', 'MoaT-KV Documentation',
186
- [author], 1)
187
- ]
183
+ man_pages = [(master_doc, "moat.kv", "MoaT-KV Documentation", [author], 1)]
188
184
 
189
185
 
190
186
  # -- Options for Texinfo output -------------------------------------------
@@ -193,7 +189,13 @@ man_pages = [
193
189
  # (source start file, target name, title, author,
194
190
  # dir menu entry, description, category)
195
191
  texinfo_documents = [
196
- (master_doc, 'moat.kv', 'MoaT-KV Documentation',
197
- author, 'MoaT-KV', 'A distributed no-master key-value store',
198
- 'Miscellaneous'),
192
+ (
193
+ master_doc,
194
+ "moat.kv",
195
+ "MoaT-KV Documentation",
196
+ author,
197
+ "MoaT-KV",
198
+ "A distributed no-master key-value store",
199
+ "Miscellaneous",
200
+ ),
199
201
  ]
@@ -9,19 +9,21 @@ from moat.kv.client import open_client
9
9
  from moat.util import P, yload, Path
10
10
  import asyncclick as click
11
11
 
12
- def conv(m,s: str) -> bool:
12
+
13
+ def conv(m, s: str) -> bool:
13
14
  try:
14
15
  d = m.value[s]
15
16
  except KeyError:
16
17
  return 0
17
- if isinstance(d,Path):
18
+ if isinstance(d, Path):
18
19
  return 0
19
- if not isinstance(d,Sequence):
20
+ if not isinstance(d, Sequence):
20
21
  return 0
21
22
  d = Path.build(d)
22
23
  m.value[s] = d
23
24
  return 1
24
25
 
26
+
25
27
  @click.command()
26
28
  @click.argument("path", type=P)
27
29
  @click.argument("keys", type=str, nargs=-1)
@@ -34,10 +36,10 @@ async def main(path, keys):
34
36
  async for m in client.get_tree(path, nchain=2):
35
37
  n = 0
36
38
  for k in keys:
37
- n += conv(m,k)
39
+ n += conv(m, k)
38
40
  if n:
39
- await client.set(ORIG+m.path, value=m.value, chain=m.chain)
41
+ await client.set(ORIG + m.path, value=m.value, chain=m.chain)
42
+
40
43
 
41
44
  if __name__ == "__main__":
42
45
  main()
43
-
@@ -1,4 +1,5 @@
1
1
  # pylint: disable=W0703,C0103
2
+ from __future__ import annotations
2
3
 
3
4
  __path__ = __import__("pkgutil").extend_path(__path__, __name__)
4
5
 
@@ -0,0 +1,97 @@
1
+ conn:
2
+ # client: controls how to talk to the MoaT-KV server
3
+ host: localhost
4
+ port: 27586
5
+ ssl: false
6
+ # ssl:
7
+ # cert: '/path/to/cert.pem',key='/path/to/cert.key'
8
+ init_timeout: 5
9
+ # time to wait for connection plus greeting
10
+ auth: null
11
+ # no auth used by default
12
+ name: null
13
+ # defaults to a seqnum
14
+ config:
15
+ prefix: !P :.moat.kv.config
16
+ errors:
17
+ prefix: !P :.moat.kv.error
18
+ codes:
19
+ prefix: !P :.moat.kv.code.proc
20
+ modules:
21
+ prefix: !P :.moat.kv.code.module
22
+ runner: # for moat.kv.runner.RunnerRoot
23
+ # storage for runnable commands
24
+ prefix: !P :.moat.kv.run"
25
+ # storage for runner states
26
+ state: !P :.moat.kv.state"
27
+
28
+ name: "run"
29
+ # Serf event name, suffixed by subpath
30
+
31
+ start_delay: 1
32
+ # time to wait between job starts. Not optional.
33
+
34
+ ping: -15
35
+ # set an I-am-running message every those-many seconds
36
+ # positive: set in moat.kv, negative: broadcast to :moat.kv.run tag
37
+
38
+ actor:
39
+ # Actor config, required for Runner
40
+ cycle: 20
41
+ nodes: -1
42
+ splits: 5
43
+ n_hosts: 3
44
+ version: 1
45
+ sub:
46
+ # tags for various runner modes
47
+ group: "any"
48
+ single: "at"
49
+ all: "all"
50
+ server:
51
+ # server-side configuration
52
+ buffer: 10
53
+ # per-stream buffer
54
+
55
+ backend: "mqtt"
56
+ # default
57
+ mqtt:
58
+ uri: "mqtt://localhost:1883"
59
+ serf:
60
+ host: "localhost"
61
+ port: 7373
62
+
63
+ # event message path/topic prefix
64
+ root: !P moat.kv
65
+
66
+ paranoia: False
67
+ # typecheck server-to-server updates?
68
+ #
69
+ # which addresses/ports to accept MoaT-KV connections on
70
+ bind: [{}]
71
+ bind_default:
72
+ # default values for all elements of "bind"
73
+ host: "localhost"
74
+ port: PORT
75
+ ssl: False
76
+ change:
77
+ length: 5
78
+ # chain length: use max nr of network sections +1
79
+ ping:
80
+ cycle: 10
81
+ gap: 2
82
+ # asyncserf.Actor config timing for server sync
83
+ # ping also controls minimum server startup time
84
+ delete:
85
+ # asyncserf.Actor config timing for deletion
86
+ cycle: 100
87
+ gap: 10
88
+ version: 1
89
+ paranoia: false
90
+ # typecheck server>server updates?
91
+
92
+ # how does a new server reach existing nodes, to download state?
93
+ domain: null
94
+ # domain in which to look up node names, if not in hostmap
95
+ hostmap: # map MoaT-KV server names to connect destinations
96
+ test1: ["localhost", 27586]
97
+ test2: ["does-not-exist.invalid", 27586]
@@ -4,11 +4,12 @@ Basic DistKV support
4
4
 
5
5
  """
6
6
 
7
+ from __future__ import annotations
8
+
7
9
  import logging
8
- from pathlib import Path
9
10
 
10
11
  import asyncclick as click
11
- from moat.util import attrdict, combine_dict, load_subgroup, yload
12
+ from moat.util import attrdict, combine_dict, load_subgroup, CFG, ensure_cfg
12
13
 
13
14
  from moat.kv.auth import gen_auth
14
15
  from moat.kv.client import client_scope
@@ -16,7 +17,7 @@ from moat.kv.client import client_scope
16
17
  logger = logging.getLogger(__name__)
17
18
 
18
19
 
19
- CFG = yload(Path(__file__).parent / "_config.yaml", attr=True)
20
+ ensure_cfg("moat.kv")
20
21
 
21
22
 
22
23
  class NullObj:
@@ -40,12 +41,8 @@ class NullObj:
40
41
  raise self._exc
41
42
 
42
43
 
43
- @load_subgroup(
44
- sub_pre="moat.kv.command", sub_post="cli", ext_pre="moat.kv", ext_post="_main.cli"
45
- )
46
- @click.option(
47
- "-h", "--host", default=None, help=f"Host to use. Default: {CFG.kv.conn.host}"
48
- )
44
+ @load_subgroup(sub_pre="moat.kv.command", sub_post="cli", ext_pre="moat.kv", ext_post="_main.cli")
45
+ @click.option("-h", "--host", default=None, help=f"Host to use. Default: {CFG.kv.conn.host}")
49
46
  @click.option(
50
47
  "-p",
51
48
  "--port",
@@ -2,8 +2,9 @@
2
2
  This module implements a :class:`asyncactor.Actor` which works on top of
3
3
  a MoaT-KV client.
4
4
  """
5
+ from __future__ import annotations
5
6
 
6
- from asyncactor import Actor # noqa
7
+ from asyncactor import Actor
7
8
  from asyncactor.abc import MonitorStream, Transport
8
9
 
9
10
  __all__ = [
@@ -3,6 +3,8 @@ This module implements additional code for the server-side DeleteActor,
3
3
  which is used to clean up the list of deleted nodes.
4
4
  """
5
5
 
6
+ from __future__ import annotations
7
+
6
8
  import weakref
7
9
  from collections import deque
8
10
 
@@ -41,7 +43,7 @@ class DeleteActor:
41
43
  self.tags = self.tags[-TAGS:]
42
44
  await self.actor.set_value((self.tags[0], self.tags[-1]))
43
45
 
44
- def add_deleted(self, nodes: "NodeSet"): # noqa: F821
46
+ def add_deleted(self, nodes: NodeSet): # noqa: F821
45
47
  """
46
48
  These nodes are deleted. Remember them for some time.
47
49
  """
@@ -59,6 +59,8 @@ The server process is:
59
59
 
60
60
  """
61
61
 
62
+ from __future__ import annotations
63
+
62
64
  import io
63
65
  from importlib import import_module
64
66
 
@@ -87,7 +89,7 @@ add_schema = {
87
89
  "additionalProperties": False,
88
90
  "properties": {"key": {type: "string", "minLength": 1}},
89
91
  },
90
- }
92
+ },
91
93
  }
92
94
 
93
95
 
@@ -111,7 +113,7 @@ def gen_auth(s: str):
111
113
 
112
114
  m, *p = s.split()
113
115
  if len(p) == 0 and m[0] == "=":
114
- with io.open(m[1:], "r", encoding="utf-8") as f:
116
+ with open(m[1:], encoding="utf-8") as f:
115
117
  kw = yload(f)
116
118
  m = kw.pop("type")
117
119
  else:
@@ -147,7 +149,7 @@ async def null_server_login(stream):
147
149
  return stream
148
150
 
149
151
 
150
- async def null_client_login(stream, user: "BaseClientAuth"): # pylint: disable=unused-argument
152
+ async def null_client_login(stream, user: BaseClientAuth): # pylint: disable=unused-argument
151
153
  return stream
152
154
 
153
155
 
@@ -342,9 +344,7 @@ class BaseServerAuth(_AuthLoaded):
342
344
 
343
345
  try:
344
346
  data = data["conv"].data["key"]
345
- res, _ = root.follow_acl(
346
- Path(None, "conv", data), create=False, nulls_ok=True
347
- )
347
+ res, _ = root.follow_acl(Path(None, "conv", data), create=False, nulls_ok=True)
348
348
  return res
349
349
  except (KeyError, AttributeError):
350
350
  return ConvNull
@@ -354,9 +354,7 @@ class BaseServerAuth(_AuthLoaded):
354
354
  data = data["acl"].data["key"]
355
355
  if data == "*":
356
356
  return NullACL
357
- acl, _ = root.follow_acl(
358
- Path(None, "acl", data), create=False, nulls_ok=True
359
- )
357
+ acl, _ = root.follow_acl(Path(None, "acl", data), create=False, nulls_ok=True)
360
358
  return ACLFinder(acl)
361
359
  except (KeyError, AttributeError):
362
360
  return NullACL
@@ -422,7 +420,7 @@ class BaseServerAuthMaker(_AuthLoaded):
422
420
  cls,
423
421
  cmd: StreamCommand,
424
422
  data: attrdict, # pylint: disable=unused-argument
425
- ) -> "BaseServerAuthMaker":
423
+ ) -> BaseServerAuthMaker:
426
424
  """Create/update a new user by reading the record from the client"""
427
425
  dt = data.get("data", None) or {}
428
426
  jsonschema.validate(instance=dt, schema=cls.schema)
@@ -5,6 +5,8 @@ Test auth method.
5
5
  Does not limit anything, allows everything.
6
6
  """
7
7
 
8
+ from __future__ import annotations
9
+
8
10
  import logging
9
11
 
10
12
  log = logging.getLogger(__name__)
@@ -62,9 +64,7 @@ class ServerUserMaker(BaseServerAuthMaker):
62
64
  await cmd.send(step="SendWant")
63
65
  msg = await cmd.recv()
64
66
  assert msg.step == "WantName"
65
- await cmd.send(
66
- step="SendName", name=self.name, chain=self._chain.serialize(nchain=3)
67
- )
67
+ await cmd.send(step="SendName", name=self.name, chain=self._chain.serialize(nchain=3))
68
68
  msg = await cmd.recv()
69
69
 
70
70
  # Annoying methods to read+save the user name from/to KV
@@ -84,17 +84,13 @@ class ClientUserMaker(BaseClientAuthMaker):
84
84
  gen_schema = dict(
85
85
  type="object",
86
86
  additionalProperties=False,
87
- properties=dict(
88
- name=dict(type="string", minLength=1, pattern="^[a-zA-Z][a-zA-Z0-9_]*$")
89
- ),
87
+ properties=dict(name=dict(type="string", minLength=1, pattern="^[a-zA-Z][a-zA-Z0-9_]*$")),
90
88
  required=["name"],
91
89
  )
92
90
  mod_schema = dict(
93
91
  type="object",
94
92
  additionalProperties=False,
95
- properties=dict(
96
- name=dict(type="string", minLength=1, pattern="^[a-zA-Z][a-zA-Z0-9_]*$")
97
- ),
93
+ properties=dict(name=dict(type="string", minLength=1, pattern="^[a-zA-Z][a-zA-Z0-9_]*$")),
98
94
  # required=[],
99
95
  )
100
96
  name = None
@@ -154,9 +150,7 @@ class ClientUser(BaseClientAuth):
154
150
  schema = dict(
155
151
  type="object",
156
152
  additionalProperties=False,
157
- properties=dict(
158
- name=dict(type="string", minLength=1, pattern="^[a-zA-Z][a-zA-Z0-9_]*$")
159
- ),
153
+ properties=dict(name=dict(type="string", minLength=1, pattern="^[a-zA-Z][a-zA-Z0-9_]*$")),
160
154
  required=["name"],
161
155
  )
162
156
  _name = None
@@ -5,6 +5,8 @@ Password-based auth method.
5
5
  Does not limit anything, allows everything.
6
6
  """
7
7
 
8
+ from __future__ import annotations
9
+
8
10
  import nacl.secret
9
11
 
10
12
  from ..client import Client, NoData
@@ -5,6 +5,8 @@ Null auth method.
5
5
  Does not limit anything, allows everything.
6
6
  """
7
7
 
8
+ from __future__ import annotations
9
+
8
10
  from . import (
9
11
  BaseClientAuth,
10
12
  BaseClientAuthMaker,
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  from abc import ABCMeta, abstractmethod
2
3
  from contextlib import asynccontextmanager
3
4
 
@@ -1,9 +1,11 @@
1
+ from __future__ import annotations
1
2
  import logging
2
3
  from contextlib import asynccontextmanager
3
4
 
4
5
  import anyio
5
6
  from moat.mqtt.client import MQTTClient
6
7
  from moat.mqtt.codecs import NoopCodec
8
+ from moat.util import NotGiven
7
9
 
8
10
  from . import Backend
9
11
 
@@ -24,9 +26,7 @@ class MqttBackend(Backend):
24
26
 
25
27
  @asynccontextmanager
26
28
  async def connect(self, *a, **kw):
27
- codec = kw.pop("codec", None)
28
- if codec is None:
29
- codec = NoopCodec()
29
+ codec = kw.pop("codec", NotGiven)
30
30
  C = MQTTClient(self._tg, codec=codec)
31
31
  try:
32
32
  await C.connect(*a, **kw)
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  from contextlib import asynccontextmanager
2
3
 
3
4
  import anyio