File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/pytest_codspeed/_wrapper Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ classifiers = [
3737dependencies = [
3838 " cffi ~= 1.15.1" ,
3939 " pytest>=3.8" ,
40+ " filelock ~= 3.12.2" ,
4041 " setuptools ~= 67.8.0; python_full_version >= '3.12.0b1'" , # FIXME: remove when cffi supports directly python 3.12
4142]
4243
Original file line number Diff line number Diff line change 22from typing import TYPE_CHECKING
33
44from cffi import FFI # type: ignore
5+ from filelock import FileLock
56
67if TYPE_CHECKING :
78 from .wrapper import lib as LibType
@@ -24,10 +25,12 @@ def _get_ffi():
2425def get_lib () -> "LibType" :
2526 try :
2627 ffi = _get_ffi ()
27- ffi .compile (
28- target = "dist_callgrind_wrapper.*" ,
29- tmpdir = _wrapper_dir ,
30- )
28+ build_lock = FileLock (f"{ _wrapper_dir } /build.lock" )
29+ with build_lock :
30+ ffi .compile (
31+ target = "dist_callgrind_wrapper.*" ,
32+ tmpdir = _wrapper_dir ,
33+ )
3134 from .dist_callgrind_wrapper import lib # type: ignore
3235
3336 return lib
You can’t perform that action at this time.
0 commit comments