pytest-codspeed 5.0.2__tar.gz → 5.0.4__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 (34) hide show
  1. {pytest_codspeed-5.0.2/src/pytest_codspeed.egg-info → pytest_codspeed-5.0.4}/PKG-INFO +3 -3
  2. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/README.md +2 -2
  3. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/pyproject.toml +2 -2
  4. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/setup.py +1 -0
  5. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/__init__.py +2 -2
  6. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/__init__.py +19 -44
  7. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/dist/core.c +11566 -11193
  8. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/includes/callgrind.h +37 -25
  9. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/includes/core.h +5 -0
  10. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument_hooks_module.c +3 -10
  11. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/plugin.py +59 -25
  12. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/utils.py +2 -0
  13. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4/src/pytest_codspeed.egg-info}/PKG-INFO +3 -3
  14. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/tests/test_pytest_plugin.py +8 -4
  15. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/tests/test_pytest_plugin_cpu_instrumentation.py +2 -1
  16. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/tests/test_pytest_plugin_walltime.py +2 -2
  17. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/LICENSE +0 -0
  18. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/setup.cfg +0 -0
  19. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/config.py +0 -0
  20. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/__init__.py +0 -0
  21. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/analysis.py +0 -0
  22. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/includes/compat.h +0 -0
  23. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/includes/valgrind.h +0 -0
  24. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/includes/zig.h +0 -0
  25. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/hooks/instrument-hooks/scripts/release.py +0 -0
  26. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/instruments/walltime.py +0 -0
  27. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed/py.typed +0 -0
  28. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed.egg-info/SOURCES.txt +0 -0
  29. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed.egg-info/dependency_links.txt +0 -0
  30. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed.egg-info/entry_points.txt +0 -0
  31. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed.egg-info/requires.txt +0 -0
  32. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/src/pytest_codspeed.egg-info/top_level.txt +0 -0
  33. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/tests/test_format_time.py +0 -0
  34. {pytest_codspeed-5.0.2 → pytest_codspeed-5.0.4}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-codspeed
3
- Version: 5.0.2
3
+ Version: 5.0.4
4
4
  Summary: Pytest plugin to create CodSpeed benchmarks
5
5
  Author-email: Arthur Pastel <arthur@codspeed.io>
6
6
  License: The MIT License (MIT)
@@ -60,7 +60,7 @@ Requires-Dist: pytest-xdist~=3.6.1; extra == "compat"
60
60
 
61
61
  [![CI](https://github.com/CodSpeedHQ/pytest-codspeed/actions/workflows/ci.yml/badge.svg)](https://github.com/CodSpeedHQ/pytest-codspeed/actions/workflows/ci.yml)
62
62
  [![PyPi Version](https://img.shields.io/pypi/v/pytest-codspeed?color=%2334D058&label=pypi)](https://pypi.org/project/pytest-codspeed)
63
- ![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-informational.svg)
63
+ ![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-informational.svg)
64
64
  [![Discord](https://img.shields.io/badge/chat%20on-discord-7289da.svg)](https://discord.com/invite/MxpaCfKSqF)
65
65
  [![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/CodSpeedHQ/pytest-codspeed)
66
66
 
@@ -168,7 +168,7 @@ jobs:
168
168
  run: pip install -r requirements.txt
169
169
 
170
170
  - name: Run benchmarks
171
- uses: CodSpeedHQ/action@v4
171
+ uses: CodSpeedHQ/action@v5
172
172
  with:
173
173
  mode: simulation # or `walltime`
174
174
  token: ${{ secrets.CODSPEED_TOKEN }}
@@ -3,7 +3,7 @@
3
3
 
4
4
  [![CI](https://github.com/CodSpeedHQ/pytest-codspeed/actions/workflows/ci.yml/badge.svg)](https://github.com/CodSpeedHQ/pytest-codspeed/actions/workflows/ci.yml)
5
5
  [![PyPi Version](https://img.shields.io/pypi/v/pytest-codspeed?color=%2334D058&label=pypi)](https://pypi.org/project/pytest-codspeed)
6
- ![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-informational.svg)
6
+ ![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-informational.svg)
7
7
  [![Discord](https://img.shields.io/badge/chat%20on-discord-7289da.svg)](https://discord.com/invite/MxpaCfKSqF)
8
8
  [![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/CodSpeedHQ/pytest-codspeed)
9
9
 
@@ -111,7 +111,7 @@ jobs:
111
111
  run: pip install -r requirements.txt
112
112
 
113
113
  - name: Run benchmarks
114
- uses: CodSpeedHQ/action@v4
114
+ uses: CodSpeedHQ/action@v5
115
115
  with:
116
116
  mode: simulation # or `walltime`
117
117
  token: ${{ secrets.CODSPEED_TOKEN }}
@@ -82,7 +82,7 @@ version = { attr = "pytest_codspeed.__version__" }
82
82
 
83
83
 
84
84
  [tool.bumpver]
85
- current_version = "5.0.2"
85
+ current_version = "5.0.4"
86
86
  version_pattern = "MAJOR.MINOR.PATCH[-TAG[NUM]]"
87
87
  commit_message = "Release v{new_version} 🚀"
88
88
  tag_message = "Release v{new_version} 🚀"
@@ -136,7 +136,7 @@ force_grid_wrap = 0
136
136
  float_to_top = true
137
137
 
138
138
  [tool.pytest.ini_options]
139
- addopts = "--ignore=tests/benchmarks --ignore=tests/examples --ignore=tests/benchmarks/TheAlgorithms"
139
+ addopts = "--ignore=tests/benchmarks --ignore=tests/benchmarks/TheAlgorithms"
140
140
  filterwarnings = ["ignore::DeprecationWarning:pytest_benchmark.utils.*:"]
141
141
  pythonpath = ["tests/benchmarks/TheAlgorithms", "./scripts"]
142
142
 
@@ -41,6 +41,7 @@ native_extension = Extension(
41
41
  # upstream silences; in particular distros like Nix/Debian/Fedora inject
42
42
  # -Werror=format-security, which would otherwise fail the build.
43
43
  extra_compile_args=[
44
+ "-std=c11",
44
45
  "-Wno-format",
45
46
  "-Wno-format-security",
46
47
  "-Wno-unused-but-set-variable",
@@ -1,6 +1,6 @@
1
- __version__ = "5.0.2"
1
+ __version__ = "5.0.4"
2
2
  # We also have the semver version since __version__ is not semver compliant
3
- __semver_version__ = "5.0.2"
3
+ __semver_version__ = "5.0.4"
4
4
 
5
5
  from .plugin import BenchmarkFixture
6
6
 
@@ -52,7 +52,7 @@ class InstrumentHooks:
52
52
 
53
53
  # Ignore libpython and python executable frames in callgrind so they
54
54
  # don't obfuscate the flamegraph.
55
- callgrind_skip_python_runtime()
55
+ self._callgrind_skip_python_runtime()
56
56
 
57
57
  def __del__(self):
58
58
  # Don't manually deinit - let the capsule destructor handle it
@@ -228,46 +228,21 @@ class InstrumentHooks:
228
228
 
229
229
  self.write_environment()
230
230
 
231
-
232
- def callgrind_add_obj_skip(path: str) -> None:
233
- """Tell callgrind to skip the given object file (and its realpath).
234
-
235
- The actual Valgrind client-request trapdoor lives in the C extension; this
236
- just resolves the realpath so callgrind's strcmp matches either form.
237
- """
238
- if not path or not os.path.exists(path):
239
- return
240
- try:
241
- from . import dist_instrument_hooks # type: ignore
242
- except ImportError:
243
- return
244
-
245
- dist_instrument_hooks.callgrind_add_obj_skip(path.encode())
246
-
247
- # The dynamic loader maps the realpath (e.g. libpython3.12.so.1.0), and
248
- # callgrind stores that in obj_node->name. Skip both so the exact strcmp
249
- # matches regardless of which path callgrind sees.
250
- real = os.path.realpath(path)
251
- if real != path:
252
- dist_instrument_hooks.callgrind_add_obj_skip(real.encode())
253
-
254
-
255
- def callgrind_skip_python_runtime() -> None:
256
- """Skip libpython and the python executable from callgrind measurement."""
257
- ldlibrary = sysconfig.get_config_var("LDLIBRARY")
258
- libdir = sysconfig.get_config_var("LIBDIR")
259
- libpython = next(
260
- (
261
- p
262
- for p in (
263
- os.path.join(libdir, ldlibrary) if ldlibrary and libdir else None,
264
- os.path.join(sys.prefix, "lib", ldlibrary) if ldlibrary else None,
265
- )
266
- if p and os.path.exists(p)
267
- ),
268
- None,
269
- )
270
- if libpython:
271
- callgrind_add_obj_skip(libpython)
272
-
273
- callgrind_add_obj_skip(sys.executable)
231
+ def _callgrind_skip_python_runtime(self) -> None:
232
+ """Skip libpython and the python executable from callgrind measurement."""
233
+ ldlibrary = sysconfig.get_config_var("LDLIBRARY")
234
+ libdir = sysconfig.get_config_var("LIBDIR")
235
+ libpython = next(
236
+ (
237
+ p
238
+ for p in (
239
+ os.path.join(libdir, ldlibrary) if ldlibrary and libdir else None,
240
+ os.path.join(sys.prefix, "lib", ldlibrary) if ldlibrary else None,
241
+ )
242
+ if p and os.path.exists(p)
243
+ ),
244
+ None,
245
+ )
246
+ if libpython:
247
+ self._module.callgrind_add_obj_skip(libpython.encode())
248
+ self._module.callgrind_add_obj_skip(sys.executable.encode())