1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 curio,
6 fetchFromGitHub,
7 anyio,
8 flask,
9 pytest-asyncio,
10 pytest-trio,
11 pythonOlder,
12 pytestCheckHook,
13 setuptools,
14 trio,
15 trustme,
16 yarl,
17}:
18
19buildPythonPackage rec {
20 pname = "python-socks";
21 version = "2.7.2";
22 pyproject = true;
23
24 disabled = pythonOlder "3.6.2";
25
26 __darwinAllowLocalNetworking = true;
27
28 src = fetchFromGitHub {
29 owner = "romis2012";
30 repo = "python-socks";
31 tag = "v${version}";
32 hash = "sha256-9RzlK8iErM94vpVLeildYjqXbRxdiVyxASCZHKd0mao=";
33 };
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 trio
39 curio
40 async-timeout
41 ];
42
43 optional-dependencies = {
44 asyncio = lib.optionals (pythonOlder "3.11") [ async-timeout ];
45 trio = [ trio ];
46 curio = [ curio ];
47 anyio = [ anyio ];
48 };
49
50 doCheck = false; # requires tiny_proxy module
51
52 nativeCheckInputs = [
53 anyio
54 flask
55 pytest-asyncio
56 pytest-trio
57 pytestCheckHook
58 trustme
59 yarl
60 ];
61
62 pythonImportsCheck = [ "python_socks" ];
63
64 meta = with lib; {
65 changelog = "https://github.com/romis2012/python-socks/releases/tag/${src.tag}";
66 description = "Core proxy client (SOCKS4, SOCKS5, HTTP) functionality for Python";
67 homepage = "https://github.com/romis2012/python-socks";
68 license = licenses.asl20;
69 maintainers = [ ];
70 };
71}