meshbench 0.0.9__tar.gz → 0.0.11.dev2__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 (30) hide show
  1. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/PKG-INFO +1 -1
  2. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/__init__.py +1 -1
  3. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/live.py +5 -4
  4. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/pairing.py +18 -2
  5. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/tests/test_client.py +15 -0
  6. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/.gitignore +0 -0
  7. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/README.md +0 -0
  8. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/01_blank_setup_with_a_board.py +0 -0
  9. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/02_two_nodes_on_a_local_build.py +0 -0
  10. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/03_small_mesh_with_traffic.py +0 -0
  11. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/04_headless_regression.py +0 -0
  12. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/05_two_builds_in_one_scenario.py +0 -0
  13. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/06_live_import_and_advert.py +0 -0
  14. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/examples/07_replace_a_board_build.py +0 -0
  15. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/_socket.py +0 -0
  16. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/boundary.py +0 -0
  17. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/checks.py +0 -0
  18. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/device.py +0 -0
  19. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/errors.py +0 -0
  20. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/nodes.py +0 -0
  21. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/parts.py +0 -0
  22. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/pytest_plugin.py +0 -0
  23. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/sessions.py +0 -0
  24. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/sets.py +0 -0
  25. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/subscribe.py +0 -0
  26. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/types.py +0 -0
  27. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/wait.py +0 -0
  28. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/meshbench/workbench.py +0 -0
  29. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/pyproject.toml +0 -0
  30. {meshbench-0.0.9 → meshbench-0.0.11.dev2}/tests/test_pytest_plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: meshbench
3
- Version: 0.0.9
3
+ Version: 0.0.11.dev2
4
4
  Summary: Drive a MeshBench workbench: RF-accurate MeshCore simulation, from Python
5
5
  Project-URL: Homepage, https://github.com/MeshBench/meshbench
6
6
  Project-URL: Issues, https://github.com/MeshBench/meshbench/issues
@@ -154,4 +154,4 @@ __all__ = [
154
154
  "default_socket_path",
155
155
  ]
156
156
 
157
- __version__ = "0.0.9"
157
+ __version__ = "0.0.11.dev2"
@@ -3,8 +3,8 @@
3
3
  Four steps in a fixed order, and every one of them has been skipped by somebody
4
4
  at least once. The two that get missed are the last two, and missing them does
5
5
  not fail: the mesh comes up with regions inferred but never applied, which
6
- transmits everything, relays nothing, and reports no error at all. It reads as
7
- bad RF.
6
+ relays every advert, drops every scoped message without a word, and reports no
7
+ error at all. It reads as bad RF.
8
8
 
9
9
  So the steps are here individually, because sometimes you want to look at a
10
10
  preview before committing - and ``pull`` runs all four, because the ordinary
@@ -100,8 +100,9 @@ class Live:
100
100
  ) -> None:
101
101
  """Read the feed's recent traffic to work out what each node holds.
102
102
 
103
- This is the step that decides whether anything relays. A node whose
104
- regions are unknown forwards nothing, and nothing says so.
103
+ This is the step that decides whether scoped traffic relays. A node
104
+ whose regions are unknown still relays every unscoped flood, drops
105
+ every scoped packet, and nothing says so.
105
106
 
106
107
  ``window`` is the feed's own past; ``wait`` is how long you will sit
107
108
  here for it. A week of ScotMesh is around 150,000 packets and several
@@ -13,7 +13,7 @@ from __future__ import annotations
13
13
 
14
14
 
15
15
  def release() -> str:
16
- """The release this client belongs to, as PyPI spells it.
16
+ """The release this client belongs to, as the workbench spells it.
17
17
 
18
18
  Read from ``__version__`` rather than kept here, because the release
19
19
  workflow stamps that one line and a second copy would be a second thing to
@@ -23,10 +23,26 @@ def release() -> str:
23
23
  A checkout carries whatever ``__version__`` last said, which is the previous
24
24
  release. That is not worth guarding against: a workbench built from the same
25
25
  checkout carries no release at all, so the pair is never compared.
26
+
27
+ PyPI spells a development build ``0.0.11.dev1`` where the tag, and the
28
+ workbench stamped from it, say ``0.0.11-dev.1``. The wire carries the tag's
29
+ spelling, so the workbench compares one spelling against itself rather than
30
+ refusing the client that was published for it.
26
31
  """
27
32
  from meshbench import __version__
28
33
 
29
- return __version__
34
+ return tag_spelling(__version__)
35
+
36
+
37
+ def tag_spelling(version: str) -> str:
38
+ """PEP 440's ``X.Y.Z.devN`` as the tag spells it, ``X.Y.Z-dev.N``.
39
+
40
+ Anything else, a plain release included, is returned as it came.
41
+ """
42
+ base, dot, dev = version.rpartition(".dev")
43
+ if dot and base and dev.isdigit():
44
+ return f"{base}-dev.{dev}"
45
+ return version
30
46
 
31
47
 
32
48
  def paired_release(ours: str, theirs: str) -> bool:
@@ -274,6 +274,21 @@ def test_the_pairing_rule_is_exact_match_or_an_unstamped_end():
274
274
  assert "skipped" in meshbench.pairing_note("1.0.0", "")
275
275
 
276
276
 
277
+ def test_a_development_client_speaks_the_tags_spelling():
278
+ """PyPI spells the development client 0.0.11.dev1 and the workbench stamped
279
+ from the tag says 0.0.11-dev.1. The first development cut had no client at
280
+ all; the second must not be refused for spelling its own number the way
281
+ its index does."""
282
+ assert meshbench.pairing.tag_spelling("0.0.11.dev1") == "0.0.11-dev.1"
283
+ assert meshbench.pairing.tag_spelling("0.0.11") == "0.0.11"
284
+ assert meshbench.pairing.tag_spelling("") == ""
285
+ # Only a numeric .devN is a development build; anything odder is left alone.
286
+ assert meshbench.pairing.tag_spelling("0.0.11.devx") == "0.0.11.devx"
287
+ assert meshbench.paired_release(
288
+ meshbench.pairing.tag_spelling("0.0.11.dev1"), "0.0.11-dev.1"
289
+ )
290
+
291
+
277
292
  def test_a_release_refusal_keeps_the_workbenchs_own_words():
278
293
  said = (
279
294
  "this client is from MeshBench 1.5.0 and this workbench is MeshBench "
File without changes
File without changes