Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 setuptools-scm,
7 httpx,
8 pytest-asyncio,
9 pytestCheckHook,
10 sse-starlette,
11}:
12
13buildPythonPackage rec {
14 pname = "httpx-sse";
15 version = "0.4.1";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "florimondmanca";
20 repo = "httpx-sse";
21 tag = version;
22 hash = "sha256-bSozSZmbRU5sc3jvVUOAXQWVBA8GhzM2R26uPdabS+w=";
23 };
24
25 # pytest-cov configuration is not necessary for packaging
26 postPatch = ''
27 rm setup.cfg
28 '';
29
30 build-system = [
31 setuptools
32 setuptools-scm
33 ];
34
35 dependencies = [ httpx ];
36
37 pythonImportsCheck = [ "httpx_sse" ];
38
39 nativeCheckInputs = [
40 pytest-asyncio
41 pytestCheckHook
42 sse-starlette
43 ];
44
45 meta = with lib; {
46 description = "Consume Server-Sent Event (SSE) messages with HTTPX";
47 homepage = "https://github.com/florimondmanca/httpx-sse";
48 changelog = "https://github.com/florimondmanca/httpx-sse/blob/${src.tag}/CHANGELOG.md";
49 license = licenses.mit;
50 maintainers = with maintainers; [ natsukium ];
51 };
52}