shrinkray 25.12.27.3__py3-none-any.whl → 25.12.29.0__py3-none-any.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shrinkray
3
- Version: 25.12.27.3
3
+ Version: 25.12.29.0
4
4
  Summary: Shrink Ray
5
5
  Author-email: "David R. MacIver" <david@drmaciver.com>
6
6
  License: MIT
@@ -16,6 +16,7 @@ Requires-Dist: click>=8.0.1
16
16
  Requires-Dist: chardet>=5.2.0
17
17
  Requires-Dist: trio>=0.28.0
18
18
  Requires-Dist: textual>=0.47.0
19
+ Requires-Dist: textual-plotext>=0.2.0
19
20
  Requires-Dist: humanize>=4.9.0
20
21
  Requires-Dist: libcst>=1.1.0
21
22
  Requires-Dist: exceptiongroup>=1.2.0
@@ -28,6 +29,8 @@ Requires-Dist: hypothesmith>=0.3.1; extra == "dev"
28
29
  Requires-Dist: pytest>=8.0.0; extra == "dev"
29
30
  Requires-Dist: pytest-trio>=0.8.0; extra == "dev"
30
31
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
32
+ Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
33
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
31
34
  Requires-Dist: syrupy>=5.0.0; extra == "dev"
32
35
  Requires-Dist: jinja2>=3.0.0; extra == "dev"
33
36
  Requires-Dist: coverage[toml]>=7.4.0; extra == "dev"
@@ -78,7 +81,12 @@ shrinkray (or any other test-case reducer) then systematically tries smaller and
78
81
 
79
82
  While it runs, you will see the following user interface:
80
83
 
81
- ![Demo of shrink ray running](demo.png)
84
+ <video controls poster="gallery/enterprise-hello/hello.png">
85
+ <source src="https://drmaciver.github.io/shrinkray/assets/hello.mp4" type="video/mp4">
86
+ Your browser doesn't support video. <a href="gallery/enterprise-hello/hello.gif">View the GIF instead</a>.
87
+ </video>
88
+
89
+ (This is a toy example based on reducing a ridiculously bad version of hello world)
82
90
 
83
91
  When it finishes you will be left with the reduced test case in `mytestcase.py`.
84
92
 
@@ -0,0 +1,33 @@
1
+ shrinkray/__init__.py,sha256=b5MvcvhsEGYya3GRXNbCJAlAL5IZHSsETLK_vtfmXRY,18
2
+ shrinkray/__main__.py,sha256=HuDZFXgD9LH3XPBK2QBvP4YkyTFJvduK9-PVtz9fKpk,11762
3
+ shrinkray/cli.py,sha256=1-qjaIchyCDd-YCdGWtK7q9j9qr6uX6AqtwW8m5QCQg,1697
4
+ shrinkray/formatting.py,sha256=tXCGnhJn-WJGpHMaLHRCAXK8aKJBbrOdiW9QGERrQEk,3121
5
+ shrinkray/problem.py,sha256=_edENYk8OC5o_2ng0WZrhIfilhlY5IuOrqt0qWBZAuM,25979
6
+ shrinkray/process.py,sha256=-eP8h5X0ESbkcTic8FFEzkd4-vwaZ0YI5tLxUR25L8U,1599
7
+ shrinkray/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ shrinkray/reducer.py,sha256=8CF_SxkfVMBxiikQKwv-rlrQawTLhQxy6QnVwIWWiws,18601
9
+ shrinkray/state.py,sha256=rrQQj30eHkFb1yTkAtwxJzZ70HvCYRzOtgM7pYAdFPY,29607
10
+ shrinkray/tui.py,sha256=cSq-tnr9hNFvM6xHxGcGZXf-wH_TsB6OZKTSRQRppQM,53250
11
+ shrinkray/ui.py,sha256=xuDUwU-MM3AetvwUB7bfzav0P_drUsBrKFPhON_Nr-k,2251
12
+ shrinkray/validation.py,sha256=piBCO-k9he_id6TWC4EHMK3GfuyPqRcNfkNJPVjxEaU,13366
13
+ shrinkray/work.py,sha256=GEZ14Kk3bvwUxAnACvY-wom2lVWaGrELMNxrDjv03dk,8110
14
+ shrinkray/passes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ shrinkray/passes/bytes.py,sha256=2Xw6WI3d3MNJATQKpS77qywdxINlwiHt__dIdh8LCVE,20230
16
+ shrinkray/passes/clangdelta.py,sha256=0CYbBiGBpD2wlOpefe_uJnea1YU2-UMfLxKi1KPcxpY,7678
17
+ shrinkray/passes/definitions.py,sha256=TDDPimp7DE60xgidAE11npt2KicQAEi0UydIzjS9VHw,2469
18
+ shrinkray/passes/genericlanguages.py,sha256=QDUIDJbzFsAjHzTWH-sB-ioB2NhBPBtZOk8Q5ZwxA54,9859
19
+ shrinkray/passes/json.py,sha256=3EcM7bmseFZaIPUN2N8c9CZYQoKVHnYfhGG1RKrrItg,2458
20
+ shrinkray/passes/patching.py,sha256=Fo04O0hVMBLFuIP704LPCJrbjU1ITHr4lCt2HrvMsOc,7449
21
+ shrinkray/passes/python.py,sha256=3WN1lZTf5oVL8FCTGomhrCuE04wIX9ocKcmFV86NMZA,6875
22
+ shrinkray/passes/sat.py,sha256=OboY6jsKf6lph3pAFh535plvhNOVzEF8HJ66WEqsNm4,19483
23
+ shrinkray/passes/sequences.py,sha256=-5ajmMeHnS7onjjppbxLiP0F6mRSqiFI5DspBTj2x_M,2206
24
+ shrinkray/subprocess/__init__.py,sha256=qxZ19Nzizbm7H0MkKL38OqfP7U-VuOAvaqBVkmHFivY,375
25
+ shrinkray/subprocess/client.py,sha256=abBkrXaJcA6cd3l_avPuteO_kYnjU5IRG7VtlmiAJgE,9428
26
+ shrinkray/subprocess/protocol.py,sha256=ow_BqMN82Z4QY19s2C8ifx4Tf4xpbypbYy-YaKgSOYk,6940
27
+ shrinkray/subprocess/worker.py,sha256=s-3D-2keFmOGElPEdvZTOSBWS6C7P2I_Ti9PGDxWjYM,23225
28
+ shrinkray-25.12.29.0.dist-info/licenses/LICENSE,sha256=iMKX79AuokJfIZUnGUARdUp30vVAoIPOJ7ek8TY63kk,1072
29
+ shrinkray-25.12.29.0.dist-info/METADATA,sha256=kXk3VCnESHkuX7Rv6Q2G3PtTqOCg1trCnhPgxnbZm4Y,8051
30
+ shrinkray-25.12.29.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ shrinkray-25.12.29.0.dist-info/entry_points.txt,sha256=wIZvnGyOdVeaLTiv2klnSyTe-EKkkwn4SwHh9bmJ7qk,104
32
+ shrinkray-25.12.29.0.dist-info/top_level.txt,sha256=fLif8-rFoFOnf5h8-vs3ECkKNWQopTQh3xvl1s7pchQ,10
33
+ shrinkray-25.12.29.0.dist-info/RECORD,,
shrinkray/display.py DELETED
@@ -1,75 +0,0 @@
1
- """Display utilities for shrink ray."""
2
-
3
- import shutil
4
- from collections.abc import Iterable
5
-
6
- from binaryornot.check import is_binary_string # type: ignore[import-not-found]
7
-
8
-
9
- def get_terminal_size() -> tuple[int, int]:
10
- """Get terminal size, with sensible fallbacks.
11
-
12
- Returns:
13
- (columns, lines) tuple. Defaults to (80, 24) if terminal size
14
- cannot be determined.
15
- """
16
- size = shutil.get_terminal_size(fallback=(80, 24))
17
- return (size.columns, size.lines)
18
-
19
-
20
- def to_lines(test_case: bytes) -> list[str]:
21
- """Convert a test case to displayable lines."""
22
- result = []
23
- for line in test_case.split(b"\n"):
24
- if is_binary_string(line):
25
- result.append(line.hex())
26
- else:
27
- try:
28
- result.append(line.decode("utf-8"))
29
- except UnicodeDecodeError:
30
- result.append(line.hex())
31
- return result
32
-
33
-
34
- def to_blocks(test_case: bytes, block_size: int | None = None) -> list[str]:
35
- """Convert a test case to hex blocks for display.
36
-
37
- Args:
38
- test_case: The bytes to convert
39
- block_size: Number of bytes per block. If None, automatically
40
- calculated from terminal width (each byte becomes 2 hex chars).
41
- """
42
- if block_size is None:
43
- columns, _ = get_terminal_size()
44
- # Each byte becomes 2 hex chars, leave some margin
45
- block_size = max(1, (columns - 4) // 2)
46
- return [
47
- test_case[i : i + block_size].hex()
48
- for i in range(0, len(test_case), block_size)
49
- ]
50
-
51
-
52
- def format_diff(diff: Iterable[str], max_lines: int | None = None) -> str:
53
- """Format a diff for display, truncating if too long.
54
-
55
- Args:
56
- diff: Iterable of diff lines
57
- max_lines: Maximum number of lines to include. If None, uses
58
- terminal height multiplied by a factor to allow scrolling
59
- through substantial context.
60
- """
61
- if max_lines is None:
62
- _, lines = get_terminal_size()
63
- # Allow multiple screenfuls of context for scrolling
64
- max_lines = max(lines * 20, 100)
65
- results = []
66
- start_writing = False
67
- for line in diff:
68
- if not start_writing and line.startswith("@@"):
69
- start_writing = True
70
- if start_writing:
71
- results.append(line)
72
- if len(results) > max_lines:
73
- results.append("...")
74
- break
75
- return "\n".join(results)
@@ -1,34 +0,0 @@
1
- shrinkray/__init__.py,sha256=b5MvcvhsEGYya3GRXNbCJAlAL5IZHSsETLK_vtfmXRY,18
2
- shrinkray/__main__.py,sha256=HuDZFXgD9LH3XPBK2QBvP4YkyTFJvduK9-PVtz9fKpk,11762
3
- shrinkray/cli.py,sha256=1-qjaIchyCDd-YCdGWtK7q9j9qr6uX6AqtwW8m5QCQg,1697
4
- shrinkray/display.py,sha256=WYN05uqmUVpZhwi2pxr1U-wLHWZ9KiL0RUlTCBJ1N3E,2430
5
- shrinkray/formatting.py,sha256=tXCGnhJn-WJGpHMaLHRCAXK8aKJBbrOdiW9QGERrQEk,3121
6
- shrinkray/problem.py,sha256=_edENYk8OC5o_2ng0WZrhIfilhlY5IuOrqt0qWBZAuM,25979
7
- shrinkray/process.py,sha256=-eP8h5X0ESbkcTic8FFEzkd4-vwaZ0YI5tLxUR25L8U,1599
8
- shrinkray/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- shrinkray/reducer.py,sha256=t2BBjq-EZ0qBbsez4ep0tFYCkDT8RwKYnjJ2fRsXubg,20096
10
- shrinkray/state.py,sha256=a8Xq7IQwLz7CyZ58zU0Z91uoglgPJmhQUvbcdgsIoKk,29593
11
- shrinkray/tui.py,sha256=Ovd6Kbk_cmOYJlwnjEyl6ka_2g1qJAtwxojh5CWEzNA,33001
12
- shrinkray/ui.py,sha256=xuDUwU-MM3AetvwUB7bfzav0P_drUsBrKFPhON_Nr-k,2251
13
- shrinkray/validation.py,sha256=piBCO-k9he_id6TWC4EHMK3GfuyPqRcNfkNJPVjxEaU,13366
14
- shrinkray/work.py,sha256=GEZ14Kk3bvwUxAnACvY-wom2lVWaGrELMNxrDjv03dk,8110
15
- shrinkray/passes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- shrinkray/passes/bytes.py,sha256=U1sNAuqUlsaLpRSJuS9X4H7S2jOiilTUIIE9-WjSd4k,23967
17
- shrinkray/passes/clangdelta.py,sha256=t9EQ_kc159HRs48JwB5JvlJCsiCscrZgf2nhHCZRZX0,8419
18
- shrinkray/passes/definitions.py,sha256=TDDPimp7DE60xgidAE11npt2KicQAEi0UydIzjS9VHw,2469
19
- shrinkray/passes/genericlanguages.py,sha256=ZqTfEHUTRbkm6PiTkBc_y3Q5Q0MJAnibNEiuKDOhiS0,10432
20
- shrinkray/passes/json.py,sha256=FydtjpVD3lMjp9OEwv5mu8CAz96ofGxIZOzt9o6eLUA,2586
21
- shrinkray/passes/patching.py,sha256=1uOTir3IbywKmsg6IIhSnxHFovZTdUCS-8PSwzgza00,8936
22
- shrinkray/passes/python.py,sha256=3WN1lZTf5oVL8FCTGomhrCuE04wIX9ocKcmFV86NMZA,6875
23
- shrinkray/passes/sat.py,sha256=OboY6jsKf6lph3pAFh535plvhNOVzEF8HJ66WEqsNm4,19483
24
- shrinkray/passes/sequences.py,sha256=jCK1fWBxCz79u7JWSps9wf7Yru7W_FAsJwdgg--CLxU,3040
25
- shrinkray/subprocess/__init__.py,sha256=FyV2y05uwQ1RTZGwREI0aAVaLX1jiwRcWsdsksFmdbM,451
26
- shrinkray/subprocess/client.py,sha256=abBkrXaJcA6cd3l_avPuteO_kYnjU5IRG7VtlmiAJgE,9428
27
- shrinkray/subprocess/protocol.py,sha256=fbY29q-j98KnAuZJ1Y_ARoi7BskkUu37SoybwVWb-pA,6636
28
- shrinkray/subprocess/worker.py,sha256=IBAXZq3E27bTuN9kHGgU5xhU6E8m_5-Ioz1dubVTuN8,21449
29
- shrinkray-25.12.27.3.dist-info/licenses/LICENSE,sha256=iMKX79AuokJfIZUnGUARdUp30vVAoIPOJ7ek8TY63kk,1072
30
- shrinkray-25.12.27.3.dist-info/METADATA,sha256=BUSNccYFT8TdtojoQHdt-YR9DEVtjsG8fNvlybnRsB0,7600
31
- shrinkray-25.12.27.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
- shrinkray-25.12.27.3.dist-info/entry_points.txt,sha256=wIZvnGyOdVeaLTiv2klnSyTe-EKkkwn4SwHh9bmJ7qk,104
33
- shrinkray-25.12.27.3.dist-info/top_level.txt,sha256=fLif8-rFoFOnf5h8-vs3ECkKNWQopTQh3xvl1s7pchQ,10
34
- shrinkray-25.12.27.3.dist-info/RECORD,,