1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 poetry-core,
9
10 # optional-dependencies
11 furo,
12 myst-parser,
13 sphinx-autobuild,
14 sphinxHook,
15
16 # tests
17 pytest-asyncio,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "aiohappyeyeballs";
23 version = "2.3.2";
24 pyproject = true;
25
26 disabled = pythonOlder "3.10";
27
28 src = fetchFromGitHub {
29 owner = "bdraco";
30 repo = "aiohappyeyeballs";
31 rev = "refs/tags/v${version}";
32 hash = "sha256-3Lj1eUDPoVCElrxowBhhrS0GCjD5qeUCiSB/gHoqC3Q=";
33 };
34
35 outputs = [
36 "out"
37 "doc"
38 ];
39
40 postPatch = ''
41 substituteInPlace pyproject.toml \
42 --replace " --cov=aiohappyeyeballs --cov-report=term-missing:skip-covered" ""
43 '';
44
45 nativeBuildInputs = [ poetry-core ] ++ passthru.optional-dependencies.docs;
46
47 passthru.optional-dependencies = {
48 docs = [
49 furo
50 myst-parser
51 sphinx-autobuild
52 sphinxHook
53 ];
54 };
55
56 nativeCheckInputs = [
57 pytest-asyncio
58 pytestCheckHook
59 ];
60
61 pythonImportsCheck = [ "aiohappyeyeballs" ];
62
63 disabledTestPaths = [
64 # https://github.com/bdraco/aiohappyeyeballs/issues/30
65 "tests/test_impl.py"
66 ];
67
68 meta = with lib; {
69 description = "Happy Eyeballs for pre-resolved hosts";
70 homepage = "https://github.com/bdraco/aiohappyeyeballs";
71 changelog = "https://github.com/bdraco/aiohappyeyeballs/blob/v${version}/CHANGELOG.md";
72 license = licenses.psfl;
73 maintainers = with maintainers; [
74 fab
75 hexa
76 ];
77 };
78}