wrapture 1.0.0.dev3__tar.gz → 1.0.0.dev4__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 (73) hide show
  1. {wrapture-1.0.0.dev3/src/wrapture.egg-info → wrapture-1.0.0.dev4}/PKG-INFO +4 -4
  2. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/README.md +3 -3
  3. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/pyproject.toml +3 -0
  4. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/__init__.py +26 -4
  5. wrapture-1.0.0.dev4/src/wrapture/asgi.py +620 -0
  6. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/bindings.py +95 -26
  7. wrapture-1.0.0.dev4/src/wrapture/collectors.py +377 -0
  8. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/config.py +367 -67
  9. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/events.py +12 -0
  10. wrapture-1.0.0.dev4/src/wrapture/lifecycle.py +84 -0
  11. wrapture-1.0.0.dev4/src/wrapture/outputs.py +219 -0
  12. wrapture-1.0.0.dev4/src/wrapture/scheduler.py +297 -0
  13. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/sinks.py +359 -193
  14. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/timeline.py +1 -12
  15. wrapture-1.0.0.dev4/src/wrapture/windows.py +966 -0
  16. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/wsgi.py +12 -8
  17. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4/src/wrapture.egg-info}/PKG-INFO +4 -4
  18. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture.egg-info/SOURCES.txt +10 -0
  19. wrapture-1.0.0.dev4/tests/test_asgi.py +728 -0
  20. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_bootstrap.py +1 -1
  21. wrapture-1.0.0.dev4/tests/test_collectors.py +214 -0
  22. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_config.py +257 -32
  23. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_jsonlines.py +117 -18
  24. wrapture-1.0.0.dev4/tests/test_outputs.py +196 -0
  25. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_runner.py +1 -1
  26. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_sink_library.py +1 -1
  27. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_sinks.py +156 -7
  28. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_timeline.py +2 -1
  29. wrapture-1.0.0.dev4/tests/test_windows.py +855 -0
  30. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_wsgi.py +2 -2
  31. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/LICENSE +0 -0
  32. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/setup.cfg +0 -0
  33. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/__main__.py +0 -0
  34. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/attributes.py +0 -0
  35. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/behaviours.py +0 -0
  36. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/bootstrap.py +0 -0
  37. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/capture.py +0 -0
  38. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/eventlogs.py +0 -0
  39. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/exceptions.py +0 -0
  40. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/export.py +0 -0
  41. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/iterators.py +0 -0
  42. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/observed.py +0 -0
  43. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/py.typed +0 -0
  44. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/pytest_plugin.py +0 -0
  45. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/stacks.py +0 -0
  46. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/tools/__init__.py +0 -0
  47. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/tools/__main__.py +0 -0
  48. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture/tools/convert.py +0 -0
  49. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture.egg-info/dependency_links.txt +0 -0
  50. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture.egg-info/entry_points.txt +0 -0
  51. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture.egg-info/not-zip-safe +0 -0
  52. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture.egg-info/requires.txt +0 -0
  53. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/src/wrapture.egg-info/top_level.txt +0 -0
  54. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_attribute_events.py +0 -0
  55. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_attributes.py +0 -0
  56. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_behaviours.py +0 -0
  57. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_bindings.py +0 -0
  58. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_capture.py +0 -0
  59. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_eventlogs.py +0 -0
  60. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_events.py +0 -0
  61. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_export.py +0 -0
  62. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_generator_events.py +0 -0
  63. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_iterators.py +0 -0
  64. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_observed.py +0 -0
  65. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_predicates.py +0 -0
  66. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_pytest_plugin.py +0 -0
  67. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_recording.py +0 -0
  68. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_stacks.py +0 -0
  69. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_targets.py +0 -0
  70. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_testing_patterns.py +0 -0
  71. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_threads.py +0 -0
  72. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_tools.py +0 -0
  73. {wrapture-1.0.0.dev3 → wrapture-1.0.0.dev4}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wrapture
3
- Version: 1.0.0.dev3
3
+ Version: 1.0.0.dev4
4
4
  Summary: Monkey patch, test, and trace Python by attaching bindings to call sites, without modifying the code being observed. Built on wrapt.
5
5
  Author-email: Graham Dumpleton <Graham.Dumpleton@gmail.com>
6
6
  License-Expression: BSD-2-Clause
@@ -45,9 +45,9 @@ and [autowrapt](https://github.com/GrahamDumpleton/autowrapt), building on the
45
45
  safe monkey-patching machinery wrapt provides.
46
46
 
47
47
  > **Status: early development.** The monkey patching, unit testing and
48
- > ad-hoc tracing layers are implemented, including WSGI request tracing.
49
- > Development previews are published to PyPI; the API may still shift
50
- > before 1.0.0.
48
+ > ad-hoc tracing layers are implemented, including WSGI and ASGI request
49
+ > tracing. Development previews are published to PyPI; the API may still
50
+ > shift before 1.0.0.
51
51
 
52
52
  ## Installation
53
53
 
@@ -14,9 +14,9 @@ and [autowrapt](https://github.com/GrahamDumpleton/autowrapt), building on the
14
14
  safe monkey-patching machinery wrapt provides.
15
15
 
16
16
  > **Status: early development.** The monkey patching, unit testing and
17
- > ad-hoc tracing layers are implemented, including WSGI request tracing.
18
- > Development previews are published to PyPI; the API may still shift
19
- > before 1.0.0.
17
+ > ad-hoc tracing layers are implemented, including WSGI and ASGI request
18
+ > tracing. Development previews are published to PyPI; the API may still
19
+ > shift before 1.0.0.
20
20
 
21
21
  ## Installation
22
22
 
@@ -85,6 +85,9 @@ dev = [
85
85
  # getting started page run as doctests and cannot rot.
86
86
  testpaths = ["tests", "docs"]
87
87
  addopts = "--doctest-glob=*.md"
88
+ # ELLIPSIS lets a transcript elide values that vary between runs, such
89
+ # as the elapsed time on a printer's closing line.
90
+ doctest_optionflags = ["ELLIPSIS"]
88
91
 
89
92
  [tool.mypy]
90
93
  python_version = "3.12"
@@ -17,11 +17,14 @@ def _format_version(parts: tuple[str, ...]) -> str:
17
17
  )
18
18
 
19
19
 
20
- __version_info__ = ("1", "0", "0", "dev3")
20
+ __version_info__ = ("1", "0", "0", "dev4")
21
21
  __version__ = _format_version(__version_info__)
22
22
 
23
23
  from wrapt import MISSING
24
24
 
25
+ from .asgi import (
26
+ ASGIMiddleware,
27
+ )
25
28
  from .behaviours import (
26
29
  CallBehaviour,
27
30
  DeleteBehaviour,
@@ -38,6 +41,11 @@ from .bindings import (
38
41
  from .capture import (
39
42
  redact,
40
43
  )
44
+ from .collectors import (
45
+ Aggregate,
46
+ Counter,
47
+ PathStats,
48
+ )
41
49
  from .config import (
42
50
  AppliedConfig,
43
51
  Config,
@@ -78,18 +86,18 @@ from .iterators import (
78
86
  IteratorProxy,
79
87
  iterator,
80
88
  )
89
+ from .lifecycle import (
90
+ shutdown,
91
+ )
81
92
  from .observed import (
82
93
  ObservedCallable,
83
94
  observed,
84
95
  )
85
96
  from .sinks import (
86
- Aggregate,
87
- Counter,
88
97
  Depth,
89
98
  Fanout,
90
99
  Filter,
91
100
  JSONLines,
92
- PathStats,
93
101
  Printer,
94
102
  Sample,
95
103
  Sink,
@@ -110,16 +118,28 @@ from .timeline import (
110
118
  propagate,
111
119
  timeline,
112
120
  )
121
+ from .windows import (
122
+ Collector,
123
+ Report,
124
+ Run,
125
+ Window,
126
+ window,
127
+ )
113
128
  from .wsgi import (
114
129
  WSGIMiddleware,
115
130
  )
116
131
 
117
132
  __all__ = [
118
133
  "MISSING",
134
+ "ASGIMiddleware",
119
135
  "Aggregate",
120
136
  "AlreadyAppliedError",
121
137
  "AppliedConfig",
122
138
  "Binding",
139
+ "Collector",
140
+ "Report",
141
+ "Run",
142
+ "Window",
123
143
  "BindingGroup",
124
144
  "CallBehaviour",
125
145
  "Config",
@@ -177,6 +197,8 @@ __all__ = [
177
197
  "propagate",
178
198
  "redact",
179
199
  "remove_sink",
200
+ "shutdown",
180
201
  "stack_frames",
181
202
  "timeline",
203
+ "window",
182
204
  ]