summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pypsrp/default.nix
blob: 6fab5a3852ac9a4c3ac824ba1827126060305ef6 (plain)
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
64
65
66
67
68
69
70
71
{
  lib,
  asyncssh,
  buildPythonPackage,
  cryptography,
  fetchFromGitHub,
  httpcore,
  httpx,
  psrpcore,
  psutil,
  pyspnego,
  pytest-mock,
  pytestCheckHook,
  pyyaml,
  requests,
  requests-credssp,
  xmldiff,
}:

buildPythonPackage rec {
  pname = "pypsrp";
  version = "0.8.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jborean93";
    repo = "pypsrp";
    tag = "v${version}";
    hash = "sha256-Pwfc9e39sYPdcHN1cZtxxGEglEYzPp4yOYLD5/4SSiU=";
  };

  propagatedBuildInputs = [
    cryptography
    httpcore
    httpx
    psrpcore
    pyspnego
    requests
  ];

  nativeCheckInputs = [
    pytest-mock
    pytestCheckHook
    pyyaml
    xmldiff
  ];

  optional-dependencies = {
    credssp = [ requests-credssp ];
    kerberos = pyspnego.optional-dependencies.kerberos;
    named_pipe = [ psutil ];
    ssh = [ asyncssh ];
  };

  pythonImportsCheck = [ "pypsrp" ];

  disabledTests = [
    # TypeError: Backend.load_rsa_private_numbers() missing 1 required...
    "test_psrp_pshost_ui_mocked_methods"
    "test_psrp_key_exchange_timeout"
    "test_psrp_multiple_commands"
  ];

  meta = {
    description = "PowerShell Remoting Protocol Client library";
    homepage = "https://github.com/jborean93/pypsrp";
    changelog = "https://github.com/jborean93/pypsrp/blob/v${version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}