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