1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 cython,
7 expandvars,
8 setuptools,
9 idna,
10 multidict,
11 typing-extensions,
12 pytest-xdist,
13 pytestCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "yarl";
18 version = "1.9.4";
19
20 disabled = pythonOlder "3.7";
21
22 pyproject = true;
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-Vm24ZxfPgIC5m1iwg7dzqQiuQPBmgeh+WJqXb6+CRr8=";
27 };
28
29 postPatch = ''
30 sed -i '/cov/d' pytest.ini
31 '';
32
33 nativeBuildInputs = [
34 cython
35 expandvars
36 setuptools
37 ];
38
39 propagatedBuildInputs = [
40 idna
41 multidict
42 ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];
43
44 preCheck = ''
45 # don't import yarl from ./ so the C extension is available
46 pushd tests
47 '';
48
49 nativeCheckInputs = [
50 pytest-xdist
51 pytestCheckHook
52 ];
53
54 postCheck = ''
55 popd
56 '';
57
58 pythonImportsCheck = [ "yarl" ];
59
60 meta = with lib; {
61 changelog = "https://github.com/aio-libs/yarl/blob/v${version}/CHANGES.rst";
62 description = "Yet another URL library";
63 homepage = "https://github.com/aio-libs/yarl";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ dotlambda ];
66 };
67}