1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 asynctest,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "timing-asgi";
12 version = "0.3.1";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "steinnes";
17 repo = "timing-asgi";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-oEDesmy9t2m51Zd6Zg87qoYbfbDnejfrbjyBkZ3hF58=";
20 };
21
22 postPatch = ''
23 substituteInPlace pyproject.toml \
24 --replace-fail poetry.masonry.api poetry.core.masonry.api \
25 --replace-fail "poetry>=" "poetry-core>="
26 '';
27
28 build-system = [ poetry-core ];
29
30 pythonImportsCheck = [ "timing_asgi" ];
31
32 # Tests rely on asynctest which is not supported by python 3.11
33 doCheck = false;
34
35 nativeCheckInputs = [
36 # asynctest-0.13.0 not supported for interpreter python3.11
37 # asynctest
38 pytestCheckHook
39 ];
40
41 meta = with lib; {
42 description = "ASGI middleware to emit timing metrics with something like statsd";
43 homepage = "https://pypi.org/project/timing-asgi";
44 license = licenses.mit;
45 maintainers = with maintainers; [ GaetanLepage ];
46 };
47}