smolpy 1.8.1__tar.gz → 1.8.2.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 (136) hide show
  1. smolpy-1.8.2.dev2/.github/workflows/dev-build.yml +30 -0
  2. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/.github/workflows/github-release.yml +4 -1
  3. smolpy-1.8.2.dev2/.github/workflows/publish.yml +247 -0
  4. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/.github/workflows/release.yml +2 -1
  5. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/PKG-INFO +11 -1
  6. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/README.md +10 -0
  7. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0008-rust-des-engine-mvp.md +5 -0
  8. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/pyproject.toml +5 -0
  9. smolpy-1.8.1/.github/workflows/publish.yml +0 -155
  10. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/.github/workflows/ci.yml +0 -0
  11. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/.github/workflows/docs.yml +0 -0
  12. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/.github/workflows/rust-wheels.yml +0 -0
  13. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/.gitignore +0 -0
  14. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/LICENSE +0 -0
  15. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/__init__.py +0 -0
  16. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/__main__.py +0 -0
  17. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
  18. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
  19. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
  20. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
  21. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
  22. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
  23. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
  24. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/runner.py +0 -0
  25. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/scenarios.py +0 -0
  26. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/benchmarks/worker.py +0 -0
  27. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0001-protocol-package-structure.md +0 -0
  28. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
  29. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0003-smol-external-dsl.md +0 -0
  30. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0004-execution-backends.md +0 -0
  31. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0005-profinet-rt.md +0 -0
  32. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
  33. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
  34. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
  35. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
  36. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/benchmarks.md +0 -0
  37. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/dashboard.md +0 -0
  38. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/dsl-reference.md +0 -0
  39. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/examples.md +0 -0
  40. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/index.md +0 -0
  41. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/language-reference.md +0 -0
  42. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/modbus.md +0 -0
  43. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/model-semantics.md +0 -0
  44. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/mqtt.md +0 -0
  45. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/profinet.md +0 -0
  46. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/roadmap.md +0 -0
  47. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/scenario-model.md +0 -0
  48. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/docs/simulation-engine.md +0 -0
  49. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/README.md +0 -0
  50. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example.py +0 -0
  51. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example.smol +0 -0
  52. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_10_clients.py +0 -0
  53. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_12_clients.py +0 -0
  54. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_20_clients.py +0 -0
  55. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_file_transfer.py +0 -0
  56. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_modbus.py +0 -0
  57. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_mqtt.py +0 -0
  58. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_profinet.py +0 -0
  59. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_profinet.smol +0 -0
  60. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_staggered_transfer.py +0 -0
  61. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/examples/example_two_tier.py +0 -0
  62. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/mkdocs.yml +0 -0
  63. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/Cargo.lock +0 -0
  64. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/Cargo.toml +0 -0
  65. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/Cargo.toml +0 -0
  66. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/src/frames.rs +0 -0
  67. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/src/lib.rs +0 -0
  68. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/src/rng.rs +0 -0
  69. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/src/scenario.rs +0 -0
  70. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/src/sim.rs +0 -0
  71. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smol-engine/src/timebase.rs +0 -0
  72. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/Cargo.toml +0 -0
  73. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/README.md +0 -0
  74. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/pyproject.toml +0 -0
  75. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/smoke_test.py +0 -0
  76. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/src/lib.rs +0 -0
  77. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/__init__.py +0 -0
  78. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/_worker.py +0 -0
  79. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/backends.py +0 -0
  80. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/batch.py +0 -0
  81. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/cli.py +0 -0
  82. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/__init__.py +0 -0
  83. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/adapter.py +0 -0
  84. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/batch.py +0 -0
  85. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/link.py +0 -0
  86. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/network.py +0 -0
  87. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/node.py +0 -0
  88. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/core/observation.py +0 -0
  89. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/ethernet/__init__.py +0 -0
  90. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/ethernet/switch.py +0 -0
  91. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/lang/__init__.py +0 -0
  92. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/lang/ast.py +0 -0
  93. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/lang/errors.py +0 -0
  94. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/lang/grammar.lark +0 -0
  95. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/lang/interpreter.py +0 -0
  96. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/lang/transformer.py +0 -0
  97. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/modbus/__init__.py +0 -0
  98. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/modbus/slave.py +0 -0
  99. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/model/__init__.py +0 -0
  100. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/model/frames.py +0 -0
  101. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/model/scenario.py +0 -0
  102. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/model/streams.py +0 -0
  103. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/model/timebase.py +0 -0
  104. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/model/validate.py +0 -0
  105. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/mqtt/__init__.py +0 -0
  106. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/mqtt/broker.py +0 -0
  107. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/profinet/__init__.py +0 -0
  108. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/profinet/device.py +0 -0
  109. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/sim/__init__.py +0 -0
  110. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/sim/engine.py +0 -0
  111. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/stats.py +0 -0
  112. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/viz/__init__.py +0 -0
  113. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/viz/dashboard.py +0 -0
  114. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/src/smolpy/viz/text_dashboard.py +0 -0
  115. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/__init__.py +0 -0
  116. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/equivalence/__init__.py +0 -0
  117. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/equivalence/harness.py +0 -0
  118. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/equivalence/scenarios.py +0 -0
  119. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/equivalence/test_equivalence.py +0 -0
  120. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/equivalence/test_rust_timebase.py +0 -0
  121. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_backends.py +0 -0
  122. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_batch.py +0 -0
  123. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_benchmarks.py +0 -0
  124. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_cli.py +0 -0
  125. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_dsl.py +0 -0
  126. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_engine_ir.py +0 -0
  127. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_lang.py +0 -0
  128. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_model.py +0 -0
  129. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_profinet.py +0 -0
  130. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_semantics.py +0 -0
  131. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_simulation.py +0 -0
  132. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_stats.py +0 -0
  133. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_sweep.py +0 -0
  134. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_timebase.py +0 -0
  135. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/tests/test_validate.py +0 -0
  136. {smolpy-1.8.1 → smolpy-1.8.2.dev2}/uv.lock +0 -0
@@ -0,0 +1,30 @@
1
+ name: Development build
2
+
3
+ # After every merge to main that changes the package, publish a development
4
+ # build: smolpy and smolpy-engine-rs X.Y.(Z+1).devN on PyPI (pre-releases,
5
+ # installed only with pip --pre) and the GitHub pre-release "Development
6
+ # build". Releases proper stay manual (release.yml).
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ paths:
13
+ - "src/**"
14
+ - "rust/**"
15
+ - "pyproject.toml"
16
+
17
+ # one at a time; a newer merge waiting replaces an older one that waits
18
+ concurrency:
19
+ group: dev-build
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ publish:
24
+ name: Publish
25
+ uses: ./.github/workflows/publish.yml
26
+ with:
27
+ dev: true
28
+ permissions:
29
+ id-token: write # PyPI trusted publishing
30
+ contents: write # the GitHub pre-release
@@ -63,5 +63,8 @@ jobs:
63
63
  if gh release view "$TAG" > /dev/null 2>&1; then
64
64
  gh release upload "$TAG" dist/* --clobber
65
65
  else
66
- gh release create "$TAG" dist/* --title "$TAG" --generate-notes --verify-tag
66
+ # notes since the previous release tag, never since the moving "dev" tag
67
+ PREVIOUS=$(git describe --tags --abbrev=0 --match 'v[0-9]*' "${TAG}^" 2>/dev/null || true)
68
+ gh release create "$TAG" dist/* --title "$TAG" --generate-notes --verify-tag \
69
+ ${PREVIOUS:+--notes-start-tag "$PREVIOUS"} --latest
67
70
  fi
@@ -0,0 +1,247 @@
1
+ name: Publish to PyPI
2
+
3
+ # Three modes:
4
+ #
5
+ # - Release (a pushed tag v*, or release.yml passing its tag): publishes
6
+ # smolpy and the smolpy-engine-rs wheels and sdist to PyPI with the tag's
7
+ # version, then the GitHub Release with every file.
8
+ # - Development build (dev-build.yml, dev: true, after a merge to main):
9
+ # publishes both to PyPI as X.Y.(Z+1).devN, N commits after the latest tag,
10
+ # a pre-release that pip installs only with --pre, and replaces the GitHub
11
+ # pre-release "Development build" (tag "dev").
12
+ # - Test (run by hand, target: testpypi): publishes only the engine to
13
+ # TestPyPI, as a dev version numbered by the run.
14
+ #
15
+ # smolpy does not wait for the engine: if publishing the engine fails, smolpy
16
+ # is still published, and the GitHub release lacks only the engine's files.
17
+
18
+ on:
19
+ push:
20
+ tags:
21
+ - "v*"
22
+ workflow_call:
23
+ inputs:
24
+ tag:
25
+ description: The tag being released (release.yml passes it; a tag push has it as its ref)
26
+ required: false
27
+ type: string
28
+ dev:
29
+ description: A development build of the calling commit (dev-build.yml)
30
+ required: false
31
+ type: boolean
32
+ default: false
33
+ workflow_dispatch:
34
+ inputs:
35
+ target:
36
+ description: Test publication of the smolpy-engine-rs wheels (releases go through Release)
37
+ required: true
38
+ type: choice
39
+ options:
40
+ - testpypi
41
+ default: testpypi
42
+
43
+ jobs:
44
+ version:
45
+ name: Version
46
+ runs-on: ubuntu-latest
47
+ outputs:
48
+ mode: ${{ steps.v.outputs.mode }} # release, dev or test
49
+ release: ${{ steps.v.outputs.release }} # "true" for release and dev: smolpy goes to PyPI
50
+ tag: ${{ steps.v.outputs.tag }}
51
+ version: ${{ steps.v.outputs.version }}
52
+
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+ with:
56
+ fetch-depth: 0 # to find the latest tag
57
+
58
+ # In a called workflow github.event_name is the caller's, so the test
59
+ # mode is recognised by its input, not by the event.
60
+ - name: Work out the version
61
+ id: v
62
+ env:
63
+ TEST: ${{ inputs.target == 'testpypi' }}
64
+ DEV: ${{ inputs.dev }}
65
+ TAG: ${{ inputs.tag || github.ref_name }}
66
+ RUN: ${{ github.run_number }}
67
+ run: |
68
+ # only release tags: the moving "dev" tag does not count
69
+ LATEST=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || echo v0.0.0)
70
+ IFS=. read -r MAJOR MINOR PATCH <<< "${LATEST#v}"
71
+ NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))"
72
+ if [ "$TEST" = "true" ]; then
73
+ MODE=test
74
+ VERSION="${NEXT}.dev${RUN}"
75
+ echo "release=false" >> "$GITHUB_OUTPUT"
76
+ elif [ "$DEV" = "true" ]; then
77
+ # as hatch-vcs numbers smolpy: N commits after the latest tag
78
+ N=$(git rev-list --count "${LATEST}..HEAD")
79
+ if [ "$N" = "0" ]; then
80
+ echo "::error::HEAD is release ${LATEST} itself: there is no development build to make"
81
+ exit 1
82
+ fi
83
+ MODE=dev
84
+ VERSION="${NEXT}.dev${N}"
85
+ echo "release=true" >> "$GITHUB_OUTPUT"
86
+ else
87
+ MODE=release
88
+ VERSION="${TAG#v}"
89
+ echo "release=true" >> "$GITHUB_OUTPUT"
90
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
91
+ fi
92
+ echo "mode=$MODE" >> "$GITHUB_OUTPUT"
93
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
94
+ echo "Mode: $MODE, version: $VERSION (latest release ${LATEST})"
95
+
96
+ build:
97
+ name: Build smolpy
98
+ needs: version
99
+ if: ${{ needs.version.outputs.release == 'true' }}
100
+ runs-on: ubuntu-latest
101
+
102
+ steps:
103
+ - uses: actions/checkout@v4
104
+ with:
105
+ ref: ${{ needs.version.outputs.tag }}
106
+ fetch-depth: 0 # needed for hatch-vcs to read git tags
107
+
108
+ - name: Install uv
109
+ uses: astral-sh/setup-uv@v4
110
+ with:
111
+ version: "latest"
112
+
113
+ - name: Build package
114
+ run: uv build
115
+
116
+ # hatch-vcs numbers smolpy from git, the engine is numbered above: they must agree
117
+ - name: Check the version
118
+ env:
119
+ VERSION: ${{ needs.version.outputs.version }}
120
+ run: |
121
+ ls dist/
122
+ test -f "dist/smolpy-${VERSION}.tar.gz" || {
123
+ echo "::error::smolpy was built as $(ls dist/*.tar.gz), expected version ${VERSION}"
124
+ exit 1
125
+ }
126
+
127
+ - name: Upload dist
128
+ uses: actions/upload-artifact@v4
129
+ with:
130
+ name: dist
131
+ path: dist/
132
+
133
+ publish:
134
+ name: Publish smolpy to PyPI
135
+ needs: build
136
+ runs-on: ubuntu-latest
137
+ environment: pypi
138
+ permissions:
139
+ id-token: write # required for OIDC trusted publishing
140
+
141
+ steps:
142
+ - name: Download dist
143
+ uses: actions/download-artifact@v4
144
+ with:
145
+ name: dist
146
+ path: dist/
147
+
148
+ - name: Publish to PyPI
149
+ uses: pypa/gh-action-pypi-publish@release/v1
150
+ with:
151
+ attestations: false
152
+
153
+ engine-wheels:
154
+ name: Build smolpy-engine-rs
155
+ needs: version
156
+ uses: ./.github/workflows/rust-wheels.yml
157
+ with:
158
+ version: ${{ needs.version.outputs.version }}
159
+ ref: ${{ needs.version.outputs.tag }}
160
+
161
+ publish-engine:
162
+ name: Publish smolpy-engine-rs to ${{ needs.version.outputs.release == 'true' && 'PyPI' || 'TestPyPI' }}
163
+ needs: [version, engine-wheels]
164
+ runs-on: ubuntu-latest
165
+ environment: ${{ needs.version.outputs.release == 'true' && 'pypi' || 'testpypi' }}
166
+ permissions:
167
+ id-token: write # required for OIDC trusted publishing
168
+
169
+ steps:
170
+ - name: Download the wheels and sdist
171
+ uses: actions/download-artifact@v4
172
+ with:
173
+ pattern: engine-*
174
+ merge-multiple: true
175
+ path: dist/
176
+
177
+ - name: Publish
178
+ uses: pypa/gh-action-pypi-publish@release/v1
179
+ with:
180
+ repository-url: ${{ needs.version.outputs.release == 'true' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
181
+ attestations: false
182
+
183
+ github-release:
184
+ name: GitHub Release
185
+ needs: [version, publish, publish-engine]
186
+ # only once smolpy is on PyPI; with the engine's files if it is there too
187
+ if: ${{ always() && needs.version.outputs.mode == 'release' && needs.publish.result == 'success' }}
188
+ permissions:
189
+ contents: write
190
+ uses: ./.github/workflows/github-release.yml
191
+ with:
192
+ tag: ${{ needs.version.outputs.tag }}
193
+ engine: ${{ needs.publish-engine.result == 'success' }}
194
+
195
+ dev-release:
196
+ name: GitHub pre-release "Development build"
197
+ needs: [version, publish, publish-engine]
198
+ if: ${{ always() && needs.version.outputs.mode == 'dev' && needs.publish.result == 'success' }}
199
+ runs-on: ubuntu-latest
200
+ permissions:
201
+ contents: write
202
+
203
+ steps:
204
+ - name: Download smolpy
205
+ uses: actions/download-artifact@v4
206
+ with:
207
+ name: dist
208
+ path: dist/
209
+
210
+ - name: Download smolpy-engine-rs
211
+ if: ${{ needs.publish-engine.result == 'success' }}
212
+ uses: actions/download-artifact@v4
213
+ with:
214
+ pattern: engine-*
215
+ merge-multiple: true
216
+ path: dist/
217
+
218
+ # One pre-release, replaced by every development build, so the list of
219
+ # releases keeps only real releases and the latest development build.
220
+ - name: Replace the pre-release
221
+ env:
222
+ GH_TOKEN: ${{ github.token }}
223
+ GH_REPO: ${{ github.repository }}
224
+ VERSION: ${{ needs.version.outputs.version }}
225
+ ENGINE: ${{ needs.publish-engine.result == 'success' }}
226
+ SHA: ${{ github.sha }}
227
+ run: |
228
+ SHORT=${SHA:0:7}
229
+ ENGINE_LINE="smolpy-engine-rs ${VERSION}"
230
+ [ "$ENGINE" = "true" ] || ENGINE_LINE="smolpy-engine-rs: not published in this build"
231
+ cat > notes.md <<NOTES
232
+ The latest development build of \`main\`, from commit [\`${SHORT}\`](https://github.com/${GH_REPO}/commit/${SHA}). It is replaced by every merge that changes the package.
233
+
234
+ - smolpy ${VERSION}
235
+ - ${ENGINE_LINE}
236
+
237
+ Development builds are pre-releases on PyPI: pip installs them only when asked.
238
+
239
+ \`\`\`bash
240
+ pip install --pre "smolpy[rust]==${VERSION}"
241
+ \`\`\`
242
+
243
+ For a stable version, use the latest release instead.
244
+ NOTES
245
+ gh release delete dev --cleanup-tag --yes || true
246
+ gh release create dev dist/* --prerelease --target "$SHA" \
247
+ --title "Development build ${VERSION}" --notes-file notes.md
@@ -32,7 +32,8 @@ jobs:
32
32
  - name: Compute next version
33
33
  id: version
34
34
  run: |
35
- LATEST=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
35
+ # only release tags: the moving "dev" tag of development builds does not count
36
+ LATEST=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || echo "v0.0.0")
36
37
  echo "Latest tag: $LATEST"
37
38
  VERSION=${LATEST#v}
38
39
  MAJOR=$(echo "$VERSION" | cut -d. -f1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: smolpy
3
- Version: 1.8.1
3
+ Version: 1.8.2.dev2
4
4
  Summary: Network simulation DSL and discrete-event simulator
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -70,6 +70,16 @@ Infrastructure: MAC-learning **switches** with 802.1Q strict-priority egress que
70
70
 
71
71
  ## Install
72
72
 
73
+ ```bash
74
+ pip install smolpy # SimPy engine, dashboards, CLI
75
+ pip install "smolpy[rust]" # plus the native Rust engine, about 40x faster
76
+ pip install --pre "smolpy[rust]" # the latest development build of main
77
+ ```
78
+
79
+ Every merge to `main` that changes the package publishes a **development build**, `X.Y.(Z+1).devN` (N commits after the latest release). It is a pre-release on PyPI, so `pip` installs it only with `--pre`, and the GitHub pre-release [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) points to its commit. Releases proper are made by hand.
80
+
81
+ From a clone, for development:
82
+
73
83
  ```bash
74
84
  uv sync # installs all runtime + dev dependencies
75
85
  ```
@@ -42,6 +42,16 @@ Infrastructure: MAC-learning **switches** with 802.1Q strict-priority egress que
42
42
 
43
43
  ## Install
44
44
 
45
+ ```bash
46
+ pip install smolpy # SimPy engine, dashboards, CLI
47
+ pip install "smolpy[rust]" # plus the native Rust engine, about 40x faster
48
+ pip install --pre "smolpy[rust]" # the latest development build of main
49
+ ```
50
+
51
+ Every merge to `main` that changes the package publishes a **development build**, `X.Y.(Z+1).devN` (N commits after the latest release). It is a pre-release on PyPI, so `pip` installs it only with `--pre`, and the GitHub pre-release [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) points to its commit. Releases proper are made by hand.
52
+
53
+ From a clone, for development:
54
+
45
55
  ```bash
46
56
  uv sync # installs all runtime + dev dependencies
47
57
  ```
@@ -191,6 +191,11 @@ Raw results: `benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.
191
191
  - The workflow publishes `smolpy-engine-rs` to PyPI. Its version is kept in lock-step with `smolpy`: the same tag triggers both releases.
192
192
  - The existing `ci.yml`, `release.yml` and `publish.yml` of the main package stay unchanged, apart from an extra CI job that runs the equivalence tests with the Rust backend.
193
193
  - The Rust toolchain is needed only by contributors who work on the engine.
194
+ - *Added 2026-11-15:* **development builds.**
195
+ - **What.** After every merge to `main` that changes `src/`, `rust/` or `pyproject.toml`, `dev-build.yml` publishes `smolpy` and `smolpy-engine-rs` to PyPI as `X.Y.(Z+1).devN`, where N is the number of commits after the latest release tag. This is hatch-vcs's own numbering, and the workflow checks that the two agree.
196
+ - **For whom.** They are PEP 440 pre-releases, so `pip install smolpy` ignores them and `pip install --pre` gets them. A git hash cannot be part of a version on PyPI, so it goes into the GitHub pre-release instead.
197
+ - **On GitHub.** One pre-release, "Development build" on the moving tag `dev`, is replaced each time and names the commit. Every place that looks for the latest release matches `v*` tags only, so `dev` never counts as one.
198
+ - **Releases** (patch, minor or major) stay manual, through `release.yml`. Release `X.Y.(Z+1)` sorts above all its development builds.
194
199
 
195
200
  ---
196
201
 
@@ -39,6 +39,11 @@ build-backend = "hatchling.build"
39
39
  source = "vcs"
40
40
  fallback-version = "0.1.0"
41
41
 
42
+ # A commit N commits after tag vX.Y.Z is X.Y.(Z+1).devN, with no "+g<hash>"
43
+ # local part: PyPI rejects local versions, and development builds go there.
44
+ [tool.hatch.version.raw-options]
45
+ local_scheme = "no-local-version"
46
+
42
47
  [tool.hatch.build.targets.wheel]
43
48
  packages = ["src/smolpy"]
44
49
 
@@ -1,155 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- # A release (a pushed tag v*, or release.yml passing its tag) publishes:
4
- # - smolpy to PyPI;
5
- # - the smolpy-engine-rs wheels and sdist to PyPI, same version (ADR-0008);
6
- # - the GitHub Release with every file.
7
- # smolpy does not wait for the engine: if publishing the engine fails, smolpy
8
- # is still released and the GitHub Release is created without the engine.
9
- #
10
- # Run by hand (target: testpypi), it only publishes the engine to TestPyPI, as
11
- # a dev version after the latest tag, to test the wheels before a release.
12
-
13
- on:
14
- push:
15
- tags:
16
- - "v*"
17
- workflow_call:
18
- inputs:
19
- tag:
20
- description: The tag being released (release.yml passes it; a tag push has it as its ref)
21
- required: false
22
- type: string
23
- workflow_dispatch:
24
- inputs:
25
- target:
26
- description: Test publication of the smolpy-engine-rs wheels (releases go through Release)
27
- required: true
28
- type: choice
29
- options:
30
- - testpypi
31
- default: testpypi
32
-
33
- jobs:
34
- version:
35
- name: Version
36
- runs-on: ubuntu-latest
37
- outputs:
38
- release: ${{ steps.v.outputs.release }}
39
- tag: ${{ steps.v.outputs.tag }}
40
- version: ${{ steps.v.outputs.version }}
41
-
42
- steps:
43
- - uses: actions/checkout@v4
44
- with:
45
- fetch-depth: 0 # to find the latest tag
46
-
47
- # In a called workflow github.event_name is the caller's, so the test
48
- # mode is recognised by its input, not by the event.
49
- - name: Work out the version
50
- id: v
51
- env:
52
- TEST: ${{ inputs.target == 'testpypi' }}
53
- TAG: ${{ inputs.tag || github.ref_name }}
54
- RUN: ${{ github.run_number }}
55
- run: |
56
- if [ "$TEST" = "true" ]; then
57
- LATEST=$(git describe --tags --abbrev=0 2>/dev/null || echo v0.0.0)
58
- IFS=. read -r MAJOR MINOR PATCH <<< "${LATEST#v}"
59
- VERSION="${MAJOR}.${MINOR}.$((PATCH + 1)).dev${RUN}"
60
- echo "release=false" >> "$GITHUB_OUTPUT"
61
- else
62
- VERSION="${TAG#v}"
63
- echo "release=true" >> "$GITHUB_OUTPUT"
64
- echo "tag=$TAG" >> "$GITHUB_OUTPUT"
65
- fi
66
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
67
- echo "Version: $VERSION (release: $([ "$TEST" = "true" ] && echo no || echo yes))"
68
-
69
- build:
70
- name: Build smolpy
71
- needs: version
72
- if: ${{ needs.version.outputs.release == 'true' }}
73
- runs-on: ubuntu-latest
74
-
75
- steps:
76
- - uses: actions/checkout@v4
77
- with:
78
- ref: ${{ needs.version.outputs.tag }}
79
- fetch-depth: 0 # needed for hatch-vcs to read git tags
80
-
81
- - name: Install uv
82
- uses: astral-sh/setup-uv@v4
83
- with:
84
- version: "latest"
85
-
86
- - name: Build package
87
- run: uv build
88
-
89
- - name: Upload dist
90
- uses: actions/upload-artifact@v4
91
- with:
92
- name: dist
93
- path: dist/
94
-
95
- publish:
96
- name: Publish smolpy to PyPI
97
- needs: build
98
- runs-on: ubuntu-latest
99
- environment: pypi
100
- permissions:
101
- id-token: write # required for OIDC trusted publishing
102
-
103
- steps:
104
- - name: Download dist
105
- uses: actions/download-artifact@v4
106
- with:
107
- name: dist
108
- path: dist/
109
-
110
- - name: Publish to PyPI
111
- uses: pypa/gh-action-pypi-publish@release/v1
112
- with:
113
- attestations: false
114
-
115
- engine-wheels:
116
- name: Build smolpy-engine-rs
117
- needs: version
118
- uses: ./.github/workflows/rust-wheels.yml
119
- with:
120
- version: ${{ needs.version.outputs.version }}
121
- ref: ${{ needs.version.outputs.tag }}
122
-
123
- publish-engine:
124
- name: Publish smolpy-engine-rs to ${{ needs.version.outputs.release == 'true' && 'PyPI' || 'TestPyPI' }}
125
- needs: [version, engine-wheels]
126
- runs-on: ubuntu-latest
127
- environment: ${{ needs.version.outputs.release == 'true' && 'pypi' || 'testpypi' }}
128
- permissions:
129
- id-token: write # required for OIDC trusted publishing
130
-
131
- steps:
132
- - name: Download the wheels and sdist
133
- uses: actions/download-artifact@v4
134
- with:
135
- pattern: engine-*
136
- merge-multiple: true
137
- path: dist/
138
-
139
- - name: Publish
140
- uses: pypa/gh-action-pypi-publish@release/v1
141
- with:
142
- repository-url: ${{ needs.version.outputs.release == 'true' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
143
- attestations: false
144
-
145
- github-release:
146
- name: GitHub Release
147
- needs: [version, publish, publish-engine]
148
- # only once smolpy is on PyPI; with the engine's files if it is there too
149
- if: ${{ always() && needs.publish.result == 'success' }}
150
- permissions:
151
- contents: write
152
- uses: ./.github/workflows/github-release.yml
153
- with:
154
- tag: ${{ needs.version.outputs.tag }}
155
- engine: ${{ needs.publish-engine.result == 'success' }}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes