1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cython,
6 expandvars,
7 setuptools,
8 idna,
9 multidict,
10 propcache,
11 hypothesis,
12 pytest-codspeed,
13 pytest-cov-stub,
14 pytest-xdist,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "yarl";
20 version = "1.21.1";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "aio-libs";
25 repo = "yarl";
26 tag = "v${version}";
27 hash = "sha256-YN2Gn/wokwbBbVcKvqNNJZ8eZKxwwdKbA84kPsx1Dg0=";
28 };
29
30 build-system = [
31 cython
32 expandvars
33 setuptools
34 ];
35
36 dependencies = [
37 idna
38 multidict
39 propcache
40 ];
41
42 preCheck = ''
43 # don't import yarl from ./ so the C extension is available
44 pushd tests
45 '';
46
47 nativeCheckInputs = [
48 hypothesis
49 pytest-codspeed
50 pytest-cov-stub
51 pytest-xdist
52 pytestCheckHook
53 ];
54
55 postCheck = ''
56 popd
57 '';
58
59 pythonImportsCheck = [ "yarl" ];
60
61 meta = with lib; {
62 changelog = "https://github.com/aio-libs/yarl/blob/v${version}/CHANGES.rst";
63 description = "Yet another URL library";
64 homepage = "https://github.com/aio-libs/yarl";
65 license = licenses.asl20;
66 maintainers = with maintainers; [ dotlambda ];
67 };
68}