summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-tds/default.nix
blob: 1577e1b5c259c591992ac84cfca0ebe58384dbdd (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,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  six,
  pytestCheckHook,
  pyopenssl,
  pyspnego,
  namedlist,
  pydes,
  cryptography,
}:

buildPythonPackage rec {
  pname = "python-tds";
  version = "1.13.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "denisenkom";
    repo = "pytds";
    rev = version;
    hash = "sha256-ubAXCifSfNtxbFIJZD8IuK/8oPT9vo77YBCexoO9zsw=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail "version.get_git_version()" '"${version}"'
  '';

  build-system = [ setuptools ];

  dependencies = [ six ];

  nativeCheckInputs = [
    pytestCheckHook
    pyopenssl
    pyspnego
    namedlist
    pydes
    cryptography
  ];

  disabledTests = [
    # ImportError: To use NTLM authentication you need to install ntlm-auth module
    # ntlm-auth has been removed from nixpkgs
    "test_ntlm"

    # TypeError: CertificateBuilder.add_extension() got an unexpected keyword argument 'extension'
    # Tests are broken for pyOpenSSL>=23.0.0
    # https://github.com/denisenkom/pytds/blob/1.13.0/test_requirements.txt
    "test_with_simple_server_req_encryption"
    "test_both_server_and_client_encryption_on"
    "test_server_has_enc_on_but_client_is_off"
    "test_only_login_encrypted"
    "test_server_encryption_not_supported"
    "test_server_with_bad_name_in_cert"
    "test_cert_with_san"
    "test_encrypted_socket"
  ];

  pythonImportsCheck = [ "pytds" ];

  meta = {
    description = "Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation";
    homepage = "https://python-tds.readthedocs.io/";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}