summary refs log tree commit diff
path: root/pkgs/development/python-modules/proxy-py/default.nix
blob: 4bf07b1375eb4e8118d8de68b10cdc06cb5bfd6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib
, buildPythonPackage
, fetchFromGitHub
, openssl
, paramiko
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
, setuptools-scm
, typing-extensions
}:

buildPythonPackage rec {
  pname = "proxy-py";
  version = "2.3.1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "abhinavsingh";
    repo = "proxy.py";
    rev = "v${version}";
    sha256 = "sha256-qqwb3t8/xicDGfO6l843qRwh0yUfthnOIhgNeKIbEO4=";
  };

  nativeBuildInputs = [
    setuptools-scm
  ];

  propagatedBuildInputs = [
    paramiko
    typing-extensions
  ];

  checkInputs = [
    openssl
    pytest-asyncio
    pytest-mock
    pytestCheckHook
  ];

  preCheck = ''
    export HOME=$(mktemp -d);
  '';

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "typing-extensions==3.7.4.3" "typing-extensions"
  '';

  pythonImportsCheck = [
    "proxy"
  ];

  meta = with lib; {
    description = "Python proxy framework";
    homepage = "https://github.com/abhinavsingh/proxy.py";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ fab ];
  };
}