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