1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 six,
7 pytestCheckHook,
8 pyopenssl,
9 pyspnego,
10 namedlist,
11 pydes,
12 cryptography,
13}:
14
15buildPythonPackage rec {
16 pname = "python-tds";
17 version = "1.13.0";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "denisenkom";
22 repo = "pytds";
23 rev = version;
24 hash = "sha256-ubAXCifSfNtxbFIJZD8IuK/8oPT9vo77YBCexoO9zsw=";
25 };
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace-fail "version.get_git_version()" '"${version}"'
30 '';
31
32 build-system = [ setuptools ];
33
34 dependencies = [ six ];
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 pyopenssl
39 pyspnego
40 namedlist
41 pydes
42 cryptography
43 ];
44
45 disabledTests = [
46 # ImportError: To use NTLM authentication you need to install ntlm-auth module
47 # ntlm-auth has been removed from nixpkgs
48 "test_ntlm"
49
50 # TypeError: CertificateBuilder.add_extension() got an unexpected keyword argument 'extension'
51 # Tests are broken for pyOpenSSL>=23.0.0
52 # https://github.com/denisenkom/pytds/blob/1.13.0/test_requirements.txt
53 "test_with_simple_server_req_encryption"
54 "test_both_server_and_client_encryption_on"
55 "test_server_has_enc_on_but_client_is_off"
56 "test_only_login_encrypted"
57 "test_server_encryption_not_supported"
58 "test_server_with_bad_name_in_cert"
59 "test_cert_with_san"
60 "test_encrypted_socket"
61 ];
62
63 pythonImportsCheck = [ "pytds" ];
64
65 meta = with lib; {
66 description = "Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation";
67 homepage = "https://python-tds.readthedocs.io/";
68 license = licenses.mit;
69 maintainers = with maintainers; [ mbalatsko ];
70 };
71}