Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 # build 6 setuptools, 7 # required 8 pytz, 9 requests, 10 tzlocal, 11 # optional 12 requests-kerberos, 13 sqlalchemy, 14 keyring, 15 # tests 16 pytestCheckHook, 17 httpretty, 18}: 19 20buildPythonPackage rec { 21 pname = "trino-python-client"; 22 version = "0.323.0"; 23 format = "setuptools"; 24 25 src = fetchFromGitHub { 26 repo = "trino-python-client"; 27 owner = "trinodb"; 28 tag = version; 29 hash = "sha256-Nr7p7x5cxxuPv2NUh1uMth97OQ+H2KBlu0SHVJ7Zu1M="; 30 }; 31 32 nativeBuildInputs = [ setuptools ]; 33 34 propagatedBuildInputs = [ 35 pytz 36 requests 37 tzlocal 38 ]; 39 40 optional-dependencies = lib.fix (self: { 41 kerberos = [ requests-kerberos ]; 42 sqlalchemy = [ sqlalchemy ]; 43 external-authentication-token-cache = [ keyring ]; 44 all = self.kerberos ++ self.sqlalchemy; 45 }); 46 47 nativeCheckInputs = [ 48 httpretty 49 pytestCheckHook 50 ] 51 ++ optional-dependencies.all; 52 53 pythonImportsCheck = [ "trino" ]; 54 55 disabledTestPaths = [ 56 # these all require a running trino instance 57 "tests/integration/test_types_integration.py" 58 "tests/integration/test_dbapi_integration.py" 59 "tests/integration/test_sqlalchemy_integration.py" 60 ]; 61 62 disabledTestMarks = [ "auth" ]; 63 64 meta = with lib; { 65 changelog = "https://github.com/trinodb/trino-python-client/blob/${version}/CHANGES.md"; 66 description = "Client for the Trino distributed SQL Engine"; 67 homepage = "https://github.com/trinodb/trino-python-client"; 68 license = licenses.asl20; 69 maintainers = with maintainers; [ 70 cpcloud 71 flokli 72 ]; 73 }; 74}