1{
2 lib,
3 asn1crypto,
4 buildPythonPackage,
5 certifi,
6 cffi,
7 charset-normalizer,
8 cryptography,
9 cython,
10 fetchFromGitHub,
11 filelock,
12 idna,
13 keyring,
14 packaging,
15 pandas,
16 platformdirs,
17 pyarrow,
18 pyjwt,
19 pyopenssl,
20 pytest-xdist,
21 pytestCheckHook,
22 pythonOlder,
23 pytz,
24 requests,
25 setuptools,
26 sortedcontainers,
27 tomlkit,
28 typing-extensions,
29}:
30
31buildPythonPackage rec {
32 pname = "snowflake-connector-python";
33 version = "3.14.0";
34 pyproject = true;
35
36 disabled = pythonOlder "3.8";
37
38 src = fetchFromGitHub {
39 owner = "snowflakedb";
40 repo = "snowflake-connector-python";
41 tag = "v${version}";
42 hash = "sha256-r3g+eVVyK9t5qpAGvimapuWilAh3eHJEFUw8VBwtKw8=";
43 };
44
45 build-system = [
46 cython
47 setuptools
48 ];
49
50 dependencies = [
51 asn1crypto
52 certifi
53 cffi
54 charset-normalizer
55 cryptography
56 filelock
57 idna
58 packaging
59 platformdirs
60 pyjwt
61 pyopenssl
62 pytz
63 requests
64 sortedcontainers
65 tomlkit
66 typing-extensions
67 ];
68
69 pythonRelaxDeps = [
70 "pyopenssl"
71 ];
72
73 optional-dependencies = {
74 pandas = [
75 pandas
76 pyarrow
77 ];
78 secure-local-storage = [ keyring ];
79 };
80
81 preCheck = ''
82 export HOME=$(mktemp -d)
83 '';
84
85 nativeCheckInputs = [
86 pytest-xdist
87 pytestCheckHook
88 ];
89
90 disabledTestPaths = [
91 # Tests require encrypted secrets, see
92 # https://github.com/snowflakedb/snowflake-connector-python/tree/master/.github/workflows/parameters
93 "test/extras/simple_select1.py"
94 "test/integ"
95 # error getting schema from stream, error code: 0, error info: Expected to
96 # be able to read 19504 bytes for message body but got 19503
97 "test/unit/test_connection.py"
98 "test/unit/test_cursor.py"
99 "test/unit/test_error_arrow_stream.py"
100 "test/unit/test_ocsp.py"
101 "test/unit/test_retry_network.py"
102 "test/unit/test_s3_util.py"
103 ];
104
105 disabledTests = [
106 # Tests connect to the internet
107 "test_status_when_num_of_chunks_is_zero"
108 "test_test_socket_get_cert"
109 # Missing .wiremock/wiremock-standalone.jar
110 "test_wiremock"
111 ];
112
113 pythonImportsCheck = [
114 "snowflake"
115 "snowflake.connector"
116 ];
117
118 meta = with lib; {
119 description = "Snowflake Connector for Python";
120 homepage = "https://github.com/snowflakedb/snowflake-connector-python";
121 changelog = "https://github.com/snowflakedb/snowflake-connector-python/blob/v${version}/DESCRIPTION.md";
122 license = licenses.asl20;
123 maintainers = [ ];
124 };
125}