1{ lib
2, asn1crypto
3, buildPythonPackage
4, pythonRelaxDepsHook
5, certifi
6, cffi
7, charset-normalizer
8, fetchPypi
9, filelock
10, idna
11, oscrypto
12, packaging
13, pycryptodomex
14, pyjwt
15, pyopenssl
16, pythonOlder
17, pytz
18, requests
19, setuptools
20, typing-extensions
21, wheel
22}:
23
24buildPythonPackage rec {
25 pname = "snowflake-connector-python";
26 version = "3.0.2";
27 format = "pyproject";
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-wMLn7PMcnmaRzn/VbcLVw60dOzJAWTpkEw5HFrCncLY=";
34 };
35
36 # snowflake-connector-python requires arrow 10.0.1, which we don't have in
37 # nixpkgs, so we cannot build the C extensions that use it. thus, patch out
38 # cython and pyarrow from the build dependencies
39 #
40 # keep an eye on following issue for improvements to this situation:
41 #
42 # https://github.com/snowflakedb/snowflake-connector-python/issues/1144
43 #
44 postPatch = ''
45 substituteInPlace pyproject.toml \
46 --replace '"cython",' "" \
47 --replace '"pyarrow>=10.0.1,<10.1.0",' ""
48 '';
49
50 nativeBuildInputs = [
51 pythonRelaxDepsHook
52 setuptools
53 wheel
54 ];
55
56 pythonRelaxDeps = [
57 "pyOpenSSL"
58 "charset-normalizer"
59 "cryptography"
60 ];
61
62 propagatedBuildInputs = [
63 asn1crypto
64 certifi
65 cffi
66 charset-normalizer
67 filelock
68 idna
69 oscrypto
70 packaging
71 pycryptodomex
72 pyjwt
73 pyopenssl
74 pytz
75 requests
76 typing-extensions
77 ];
78
79 # Tests require encrypted secrets, see
80 # https://github.com/snowflakedb/snowflake-connector-python/tree/master/.github/workflows/parameters
81 doCheck = false;
82
83 pythonImportsCheck = [
84 "snowflake"
85 "snowflake.connector"
86 ];
87
88 meta = with lib; {
89 changelog = "https://github.com/snowflakedb/snowflake-connector-python/blob/v${version}/DESCRIPTION.md";
90 description = "Snowflake Connector for Python";
91 homepage = "https://github.com/snowflakedb/snowflake-connector-python";
92 license = licenses.asl20;
93 maintainers = with maintainers; [ ];
94 };
95}