pysnappea 0.1.0__py3-none-win_amd64.whl
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.
- pysnappea-0.1.0.data/scripts/snappea-compat.exe +0 -0
- pysnappea-0.1.0.data/scripts/snappea.exe +0 -0
- pysnappea-0.1.0.dist-info/METADATA +51 -0
- pysnappea-0.1.0.dist-info/RECORD +15 -0
- pysnappea-0.1.0.dist-info/WHEEL +4 -0
- pysnappea-0.1.0.dist-info/entry_points.txt +2 -0
- pysnappea-0.1.0.dist-info/sboms/snappea.cyclonedx.json +653 -0
- snappea/__init__.py +200 -0
- snappea/_binary.py +60 -0
- snappea/_config.py +174 -0
- snappea/_emit.py +385 -0
- snappea/_errors.py +64 -0
- snappea/_recorder.py +776 -0
- snappea/py.typed +0 -0
- snappea/pytest_plugin.py +285 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pysnappea
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Framework :: Pytest
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Programming Language :: Rust
|
|
7
|
+
Classifier: Topic :: Software Development :: Testing
|
|
8
|
+
Requires-Dist: tomli>=1.1 ; python_full_version < '3.11'
|
|
9
|
+
Summary: Check P specs against events from your Python tests
|
|
10
|
+
License: MIT OR Apache-2.0
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: Documentation, https://github.com/crowecawcaw/snappea/blob/main/docs/python.md
|
|
14
|
+
Project-URL: Repository, https://github.com/crowecawcaw/snappea
|
|
15
|
+
|
|
16
|
+
# Snap Pea for Python
|
|
17
|
+
|
|
18
|
+
Check [P](https://p-org.github.io/P/) specs against events your code emits during its
|
|
19
|
+
ordinary tests. The package brings the `snappea` binary, so `pip install pysnappea` is the whole
|
|
20
|
+
setup.
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from snappea import emit
|
|
24
|
+
|
|
25
|
+
def grant(self, client, lock):
|
|
26
|
+
...
|
|
27
|
+
emit("eEnter", key=lock, client=client)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```toml
|
|
31
|
+
# pyproject.toml
|
|
32
|
+
[tool.snappea]
|
|
33
|
+
spec_files = ["specs/*.p"]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Every pytest test now also checks every spec in `specs/`. Or check selected tests
|
|
37
|
+
explicitly:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from snappea import check_spec
|
|
41
|
+
|
|
42
|
+
def test_lease_expiry():
|
|
43
|
+
with check_spec("MutualExclusion"):
|
|
44
|
+
...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
In production, `snappea.set_sink("/var/log/app/events.jsonl")` sends the same events to a
|
|
48
|
+
log that `snappea observe` checks. See
|
|
49
|
+
[docs/python.md](https://github.com/crowecawcaw/snappea/blob/main/docs/python.md) and
|
|
50
|
+
[Testing and production](https://github.com/crowecawcaw/snappea/blob/main/docs/production.md).
|
|
51
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
pysnappea-0.1.0.data/scripts/snappea-compat.exe,sha256=QNUjj7Gi0Jg9DK_TzoX8uy2so-NDlCwpK1b7bGnmGsA,3241984
|
|
2
|
+
pysnappea-0.1.0.data/scripts/snappea.exe,sha256=oYhzOH99xMxM_Y-WIASZZVbhg6TFAO_-sRx9lLLY3H4,3267584
|
|
3
|
+
pysnappea-0.1.0.dist-info/METADATA,sha256=htD2rA-i5n6a0dG3qvUh-QNGcK1BK9yzQf46OK_LUu0,1595
|
|
4
|
+
pysnappea-0.1.0.dist-info/WHEEL,sha256=8Aej0W0a6Cz6apA3IzJrTnxLRVLAt-w0Oh8SA3Con_c,94
|
|
5
|
+
pysnappea-0.1.0.dist-info/entry_points.txt,sha256=cAKwQ7LavieLAKjdZDDqxjGeJ9qUh62-yrO4qOTP8nE,41
|
|
6
|
+
pysnappea-0.1.0.dist-info/sboms/snappea.cyclonedx.json,sha256=l9gt6S90z5w37W5et8kt7TxGBCn8qQHyU0btFKGuqfA,20149
|
|
7
|
+
snappea/__init__.py,sha256=8nljipA0wEAnE2IAK1tSGDhewyspBVQ3_3LvR8o6LWA,7293
|
|
8
|
+
snappea/_binary.py,sha256=InxMVN38Nrb3dWBvEic3hfUYG0_Z4rtQLTNYDUG8S20,2269
|
|
9
|
+
snappea/_config.py,sha256=Odv9mhICEcQZZTr23pC1BtZcP1OcB2EnDlUzPnng2Jg,6910
|
|
10
|
+
snappea/_emit.py,sha256=XwpM-tV7otgPAzY6UcpBLDCrDtZNW4-uQJU4cgut8h8,14275
|
|
11
|
+
snappea/_errors.py,sha256=1zICx1Absl1bNHpMJlvKuGnDq42pdBGg6uXfNodmxfs,2779
|
|
12
|
+
snappea/_recorder.py,sha256=xMxHTu8wuua1waRPgJBhx1Xmrh2B-3yegj7tGxJs-gM,32828
|
|
13
|
+
snappea/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
snappea/pytest_plugin.py,sha256=ySrEn4vYLdnvjWtkIHHfBN7Jve445V8TF1HVLVV9Kv0,11516
|
|
15
|
+
pysnappea-0.1.0.dist-info/RECORD,,
|