1{ buildPythonPackage, lib, fetchPypi, glibcLocales, isPy3k, contextvars
2, pythonOlder, pytest, curio
3}:
4
5buildPythonPackage rec {
6 pname = "sniffio";
7 version = "1.3.0";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "sha256-5gMFxeXTFPU4klm38iqqM9j33uSXYxGSNK83VcVbkQE=";
12 };
13
14 disabled = !isPy3k;
15
16 buildInputs = [ glibcLocales ];
17
18 propagatedBuildInputs = lib.optionals (pythonOlder "3.7") [ contextvars ];
19
20 checkInputs = [ pytest curio ];
21
22 checkPhase = ''
23 pytest
24 '';
25
26 meta = with lib; {
27 homepage = "https://github.com/python-trio/sniffio";
28 license = licenses.asl20;
29 description = "Sniff out which async library your code is running under";
30 };
31}