From ab1869c2de9215d5984d3a2a15316455f0483276 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Mon, 2 Oct 2023 12:07:23 -0700 Subject: [PATCH] python3Packages.python-tds: init at 1.13.0 --- .../python-modules/python-tds/default.nix | 74 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/python-tds/default.nix diff --git a/pkgs/development/python-modules/python-tds/default.nix b/pkgs/development/python-modules/python-tds/default.nix new file mode 100644 index 000000000000..502ff1433666 --- /dev/null +++ b/pkgs/development/python-modules/python-tds/default.nix @@ -0,0 +1,74 @@ +{ 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 "version.get_git_version()" '"${version}"' + ''; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + 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 = with lib; { + description = "Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation"; + homepage = "https://python-tds.readthedocs.io/"; + license = licenses.mit; + maintainers = with maintainers; [ mbalatsko ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 464a6a5922e7..92c950700f0a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7484,6 +7484,8 @@ self: super: with self; { python-nvd3 = callPackage ../development/python-modules/python-nvd3 { }; + python-tds = callPackage ../development/python-modules/python-tds { }; + python-yate = callPackage ../development/python-modules/python-yate { }; python-youtube = callPackage ../development/python-modules/python-youtube { };