austin-python 1.5.0__tar.gz → 1.6.0__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 (65) hide show
  1. {austin_python-1.5.0 → austin_python-1.6.0}/PKG-INFO +7 -7
  2. {austin_python-1.5.0 → austin_python-1.6.0}/README.md +2 -2
  3. {austin_python-1.5.0 → austin_python-1.6.0}/austin/__init__.py +1 -1
  4. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/mojo.py +11 -2
  5. {austin_python-1.5.0 → austin_python-1.6.0}/pyproject.toml +6 -5
  6. {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_mojo.py +11 -2
  7. {austin_python-1.5.0 → austin_python-1.6.0}/test/test_aio.py +36 -39
  8. {austin_python-1.5.0 → austin_python-1.6.0}/.flake8 +0 -0
  9. {austin_python-1.5.0 → austin_python-1.6.0}/.gitignore +0 -0
  10. {austin_python-1.5.0 → austin_python-1.6.0}/.readthedocs.yml +0 -0
  11. {austin_python-1.5.0 → austin_python-1.6.0}/AUTHORS +0 -0
  12. {austin_python-1.5.0 → austin_python-1.6.0}/CODE-OF-CONDUCT.md +0 -0
  13. {austin_python-1.5.0 → austin_python-1.6.0}/CONTRIBUTING.md +0 -0
  14. {austin_python-1.5.0 → austin_python-1.6.0}/COPYING +0 -0
  15. {austin_python-1.5.0 → austin_python-1.6.0}/ISSUE_TEMPLATE.md +0 -0
  16. {austin_python-1.5.0 → austin_python-1.6.0}/LICENSE.md +0 -0
  17. {austin_python-1.5.0 → austin_python-1.6.0}/MANIFEST.in +0 -0
  18. {austin_python-1.5.0 → austin_python-1.6.0}/PULL_REQUEST_TEMPLATE.md +0 -0
  19. {austin_python-1.5.0 → austin_python-1.6.0}/austin/aio.py +0 -0
  20. {austin_python-1.5.0 → austin_python-1.6.0}/austin/cli.py +0 -0
  21. {austin_python-1.5.0 → austin_python-1.6.0}/austin/config.py +0 -0
  22. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/__init__.py +0 -0
  23. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/compress.py +0 -0
  24. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/__init__.py +0 -0
  25. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/__main__.py +0 -0
  26. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/profile.proto +0 -0
  27. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/pprof/profile_pb2.py +0 -0
  28. {austin_python-1.5.0 → austin_python-1.6.0}/austin/format/speedscope.py +0 -0
  29. {austin_python-1.5.0 → austin_python-1.6.0}/austin/simple.py +0 -0
  30. {austin_python-1.5.0 → austin_python-1.6.0}/austin/stats.py +0 -0
  31. {austin_python-1.5.0 → austin_python-1.6.0}/austin/threads.py +0 -0
  32. {austin_python-1.5.0 → austin_python-1.6.0}/austin/tools/diff.py +0 -0
  33. {austin_python-1.5.0 → austin_python-1.6.0}/austin/tools/resolve.py +0 -0
  34. {austin_python-1.5.0 → austin_python-1.6.0}/test/__init__.py +0 -0
  35. {austin_python-1.5.0 → austin_python-1.6.0}/test/conftest.py +0 -0
  36. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austin.json +0 -0
  37. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austin.out +0 -0
  38. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austin.pprof +0 -0
  39. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austinp.mojo +0 -0
  40. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/austinp.resolved.mojo +0 -0
  41. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/column.mojo +0 -0
  42. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/column.py +0 -0
  43. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/diff_a-b.austin +0 -0
  44. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/diff_a.austin +0 -0
  45. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/diff_b.austin +0 -0
  46. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/mp.austin +0 -0
  47. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/mp.mojo +0 -0
  48. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/test.austin +0 -0
  49. {austin_python-1.5.0 → austin_python-1.6.0}/test/data/test.mojo +0 -0
  50. {austin_python-1.5.0 → austin_python-1.6.0}/test/format/__init__.py +0 -0
  51. {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_compress.py +0 -0
  52. {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_pprof.py +0 -0
  53. {austin_python-1.5.0 → austin_python-1.6.0}/test/format/test_speedscope.py +0 -0
  54. {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_austin_file_reader.py +0 -0
  55. {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_austin_stats.py +0 -0
  56. {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_frame.py +0 -0
  57. {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_hierarchical_stats.py +0 -0
  58. {austin_python-1.5.0 → austin_python-1.6.0}/test/stats/test_sample.py +0 -0
  59. {austin_python-1.5.0 → austin_python-1.6.0}/test/test_cli.py +0 -0
  60. {austin_python-1.5.0 → austin_python-1.6.0}/test/test_config.py +0 -0
  61. {austin_python-1.5.0 → austin_python-1.6.0}/test/test_semver.py +0 -0
  62. {austin_python-1.5.0 → austin_python-1.6.0}/test/test_simple.py +0 -0
  63. {austin_python-1.5.0 → austin_python-1.6.0}/test/test_threads.py +0 -0
  64. {austin_python-1.5.0 → austin_python-1.6.0}/test/tools/test_diff.py +0 -0
  65. {austin_python-1.5.0 → austin_python-1.6.0}/test/tools/test_resolve.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: austin-python
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: Python wrapper for Austin, the CPython frame stack sampler.
5
5
  Project-URL: homepage, https://github.com/P403n1x87/austin-python
6
6
  Project-URL: documentation, https://austin-python.readthedocs.io
@@ -15,15 +15,15 @@ Keywords: development,performance,profiling,testing
15
15
  Classifier: Development Status :: 5 - Production/Stable
16
16
  Classifier: Intended Audience :: Developers
17
17
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
18
- Classifier: Programming Language :: Python :: 3.7
19
18
  Classifier: Programming Language :: Python :: 3.8
20
19
  Classifier: Programming Language :: Python :: 3.9
21
20
  Classifier: Programming Language :: Python :: 3.10
22
21
  Classifier: Programming Language :: Python :: 3.11
23
- Requires-Python: >=3.7
24
- Requires-Dist: protobuf~=3.12.2
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Requires-Python: >=3.8
24
+ Requires-Dist: protobuf~=3.12
25
25
  Requires-Dist: psutil>=5.7.0
26
- Requires-Dist: toml~=0.10.2
26
+ Requires-Dist: toml~=0.10
27
27
  Description-Content-Type: text/markdown
28
28
 
29
29
  <p align="center">
@@ -187,8 +187,8 @@ raw samples by aggregation.
187
187
 
188
188
  # Compatibility
189
189
 
190
- The `austin-python` package is tested on Linux, macOS and Windows with Python
191
- 3.7-3.11.
190
+ The latest `austin-python` package is tested on Linux, macOS and Windows with
191
+ Python 3.8-3.12.
192
192
 
193
193
 
194
194
  # Documentation
@@ -159,8 +159,8 @@ raw samples by aggregation.
159
159
 
160
160
  # Compatibility
161
161
 
162
- The `austin-python` package is tested on Linux, macOS and Windows with Python
163
- 3.7-3.11.
162
+ The latest `austin-python` package is tested on Linux, macOS and Windows with
163
+ Python 3.8-3.12.
164
164
 
165
165
 
166
166
  # Documentation
@@ -240,7 +240,7 @@ class BaseAustin(ABC):
240
240
  def check_exit(self, rcode: int, stderr: Optional[str]) -> None:
241
241
  """Check Austin exit status."""
242
242
  if rcode:
243
- if rcode in (-15, 15):
243
+ if rcode in {-15, 15, 241}:
244
244
  raise AustinTerminated()
245
245
  raise AustinError(f"({rcode}) {stderr}")
246
246
 
@@ -135,11 +135,18 @@ class MojoStack(MojoEvent):
135
135
  """MOJO stack."""
136
136
 
137
137
  pid: int
138
+ iid: int
138
139
  tid: str
139
140
 
140
141
  def to_austin(self) -> str:
141
142
  """Convert the event to Austin format."""
142
- return f"P{self.pid};T{int(self.tid, 16)}"
143
+ try:
144
+ tid = int(self.tid, 16)
145
+ except ValueError:
146
+ tid = self.tid
147
+ return (
148
+ f"P{self.pid};T{self.iid}:{tid}" if self.iid >= 0 else f"P{self.pid};T{tid}"
149
+ )
143
150
 
144
151
 
145
152
  @dataclass(frozen=True, eq=True)
@@ -325,7 +332,9 @@ class MojoFile:
325
332
  yield from self._emit_metrics()
326
333
 
327
334
  self._pid = pid = self.read_int()
328
- yield MojoStack(pid, self.read_string())
335
+ iid = self.read_int() if self.mojo_version >= 3 else -1
336
+
337
+ yield MojoStack(pid, iid, self.read_string())
329
338
 
330
339
  def _lookup_string(self) -> MojoString:
331
340
  n = self.read_int()
@@ -35,18 +35,18 @@ classifiers = [
35
35
  "Development Status :: 5 - Production/Stable",
36
36
  "Intended Audience :: Developers",
37
37
  "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
38
- "Programming Language :: Python :: 3.7",
39
38
  "Programming Language :: Python :: 3.8",
40
39
  "Programming Language :: Python :: 3.9",
41
40
  "Programming Language :: Python :: 3.10",
42
41
  "Programming Language :: Python :: 3.11",
42
+ "Programming Language :: Python :: 3.12",
43
43
  ]
44
44
 
45
- requires-python = ">=3.7"
45
+ requires-python = ">=3.8"
46
46
  dependencies = [
47
- "protobuf~=3.12.2",
47
+ "protobuf~=3.12",
48
48
  "psutil>=5.7.0",
49
- "toml~=0.10.2",
49
+ "toml~=0.10",
50
50
  ]
51
51
 
52
52
  dynamic = ["version"]
@@ -69,13 +69,14 @@ austinp-resolve = "austin.tools.resolve:main"
69
69
  template = "tests"
70
70
  dependencies = [
71
71
  "pytest>=5.4.2",
72
+ "pytest-asyncio",
72
73
  "pytest-cov>=2.8.1",
73
74
  ]
74
75
  [tool.hatch.envs.tests.scripts]
75
76
  tests = "pytest --cov=austin --cov-report=term-missing --cov-report=xml {args}"
76
77
 
77
78
  [[tool.hatch.envs.tests.matrix]]
78
- python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
79
+ python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
79
80
 
80
81
  [tool.hatch.envs.checks]
81
82
  python = "3.10"
@@ -29,7 +29,11 @@ from random import randint
29
29
 
30
30
  import pytest
31
31
 
32
- from austin.format.mojo import MojoFile, MojoFrame, MojoString, MojoStringReference
32
+ from austin.format.mojo import MojoFile
33
+ from austin.format.mojo import MojoFrame
34
+ from austin.format.mojo import MojoStack
35
+ from austin.format.mojo import MojoString
36
+ from austin.format.mojo import MojoStringReference
33
37
  from austin.format.mojo import main
34
38
  from austin.format.mojo import to_varint
35
39
 
@@ -53,7 +57,7 @@ def test_mojo_snapshot(case):
53
57
 
54
58
  def test_mojo_varint():
55
59
  for _ in range(100_000):
56
- n = randint(-4e9, 4e9)
60
+ n = randint(int(-4e9), int(4e9))
57
61
  buffer = BytesIO()
58
62
  buffer.write(b"MOJ\0" + to_varint(n))
59
63
  buffer.seek(0)
@@ -158,3 +162,8 @@ def test_mojo_column_info():
158
162
  column_end=17,
159
163
  ),
160
164
  }
165
+
166
+
167
+ def test_mojo_stack():
168
+ assert MojoStack(1, -1, "noiid").to_austin() == "P1;Tnoiid"
169
+ assert MojoStack(1, 2, "iid").to_austin() == "P1;T2:iid"
@@ -24,6 +24,7 @@
24
24
  import asyncio
25
25
  import sys
26
26
 
27
+ import pytest
27
28
  from pytest import raises
28
29
 
29
30
  from austin import AustinError
@@ -70,21 +71,20 @@ class InvalidBinaryAsyncAustin(AsyncAustin):
70
71
  BINARY = "_austin"
71
72
 
72
73
 
73
- def test_async_time():
74
+ @pytest.mark.asyncio
75
+ async def test_async_time():
74
76
  austin = TestAsyncAustin()
75
77
 
76
- asyncio.get_event_loop().run_until_complete(
77
- austin.start(
78
- [
79
- "-t",
80
- "10",
81
- "-Ci",
82
- "100",
83
- "python",
84
- "-c",
85
- "from time import sleep; sleep(2)",
86
- ]
87
- )
78
+ await austin.start(
79
+ [
80
+ "-t",
81
+ "10",
82
+ "-Ci",
83
+ "100",
84
+ "python",
85
+ "-c",
86
+ "from time import sleep; sleep(2)",
87
+ ]
88
88
  )
89
89
 
90
90
  austin.assert_callbacks_called()
@@ -93,30 +93,31 @@ def test_async_time():
93
93
  assert austin.python_version is not None
94
94
 
95
95
 
96
- def test_async_memory():
96
+ @pytest.mark.asyncio
97
+ async def test_async_memory():
97
98
  austin = TestAsyncAustin()
98
99
 
99
100
  def sample_callback(data):
100
101
  austin._sample_received = True
101
102
 
102
103
  austin._sample_callback = sample_callback
103
- asyncio.get_event_loop().run_until_complete(
104
- austin.start(
105
- [
106
- "-t",
107
- "10",
108
- "-mCi",
109
- "100",
110
- "python",
111
- "-c",
112
- "[i for i in range(10000000)]",
113
- ]
114
- )
104
+ await austin.start(
105
+ [
106
+ "-t",
107
+ "10",
108
+ "-mCi",
109
+ "100",
110
+ "python",
111
+ "-c",
112
+ "[i for i in range(10000000)]",
113
+ ]
115
114
  )
115
+
116
116
  austin.assert_callbacks_called()
117
117
 
118
118
 
119
- def test_async_terminate():
119
+ @pytest.mark.asyncio
120
+ async def test_async_terminate():
120
121
  austin = TestAsyncAustin()
121
122
 
122
123
  def sample_callback(*args):
@@ -130,18 +131,15 @@ def test_async_terminate():
130
131
  austin._terminate_callback = terminate_callback
131
132
 
132
133
  try:
133
- asyncio.get_event_loop().run_until_complete(
134
- asyncio.wait_for(austin.start(["-t", "10", "-Ci", "10ms", "python"]), 30)
135
- )
134
+ await asyncio.wait_for(austin.start(["-t", "10", "-Ci", "10ms", "python"]), 30)
136
135
  except AustinError:
137
136
  austin.assert_callbacks_called()
138
137
 
139
138
 
140
- def test_async_invalid_binary():
139
+ @pytest.mark.asyncio
140
+ async def test_async_invalid_binary():
141
141
  with raises(AustinError):
142
- asyncio.get_event_loop().run_until_complete(
143
- InvalidBinaryAsyncAustin(sample_callback=lambda x: None).start(["python"])
144
- )
142
+ await InvalidBinaryAsyncAustin(sample_callback=lambda x: None).start(["python"])
145
143
 
146
144
 
147
145
  def test_async_no_sample_callback():
@@ -149,11 +147,10 @@ def test_async_no_sample_callback():
149
147
  InvalidBinaryAsyncAustin()
150
148
 
151
149
 
152
- def test_async_bad_options():
150
+ @pytest.mark.asyncio
151
+ async def test_async_bad_options():
153
152
  austin = TestAsyncAustin(terminate_callback=lambda *args: None)
154
153
  with raises(AustinError):
155
- asyncio.get_event_loop().run_until_complete(
156
- austin.start(
157
- ["-I", "1000", "python", "-c", "for i in range(1000000): print(i)"]
158
- )
154
+ await austin.start(
155
+ ["-I", "1000", "python", "-c", "for i in range(1000000): print(i)"]
159
156
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes