2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, asn1crypto
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildPythonPackage
|
2023-08-10 07:59:29 +00:00
|
|
|
, pythonRelaxDepsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, certifi
|
|
|
|
, cffi
|
2022-06-16 17:23:12 +00:00
|
|
|
, charset-normalizer
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2022-09-30 11:47:45 +00:00
|
|
|
, filelock
|
2020-04-24 23:36:52 +00:00
|
|
|
, idna
|
2023-08-04 22:07:22 +00:00
|
|
|
, keyring
|
2020-04-24 23:36:52 +00:00
|
|
|
, oscrypto
|
2023-08-22 20:05:09 +00:00
|
|
|
, packaging
|
|
|
|
, platformdirs
|
2020-04-24 23:36:52 +00:00
|
|
|
, pycryptodomex
|
|
|
|
, pyjwt
|
|
|
|
, pyopenssl
|
2022-06-16 17:23:12 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytz
|
|
|
|
, requests
|
2022-06-16 17:23:12 +00:00
|
|
|
, setuptools
|
2023-08-22 20:05:09 +00:00
|
|
|
, sortedcontainers
|
|
|
|
, tomlkit
|
2022-09-30 11:47:45 +00:00
|
|
|
, typing-extensions
|
2023-08-10 07:59:29 +00:00
|
|
|
, wheel
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "snowflake-connector-python";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "3.6.0";
|
2023-01-20 10:41:00 +00:00
|
|
|
format = "pyproject";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-FWZ6kYeA152nVeamC79pGAUYVJUej1bM31aSKD6ahHk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
# snowflake-connector-python requires arrow 10.0.1, which we don't have in
|
|
|
|
# nixpkgs, so we cannot build the C extensions that use it. thus, patch out
|
|
|
|
# cython and pyarrow from the build dependencies
|
|
|
|
#
|
|
|
|
# keep an eye on following issue for improvements to this situation:
|
|
|
|
#
|
|
|
|
# https://github.com/snowflakedb/snowflake-connector-python/issues/1144
|
|
|
|
#
|
2023-01-20 10:41:00 +00:00
|
|
|
postPatch = ''
|
2023-08-10 07:59:29 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '"cython",' "" \
|
|
|
|
--replace '"pyarrow>=10.0.1,<10.1.0",' ""
|
2023-01-20 10:41:00 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"pyOpenSSL"
|
|
|
|
"charset-normalizer"
|
|
|
|
"cryptography"
|
2023-08-22 20:05:09 +00:00
|
|
|
"platformdirs"
|
2023-08-10 07:59:29 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
asn1crypto
|
|
|
|
certifi
|
|
|
|
cffi
|
2022-06-16 17:23:12 +00:00
|
|
|
charset-normalizer
|
2022-09-30 11:47:45 +00:00
|
|
|
filelock
|
2020-04-24 23:36:52 +00:00
|
|
|
idna
|
|
|
|
oscrypto
|
2023-08-22 20:05:09 +00:00
|
|
|
packaging
|
|
|
|
platformdirs
|
2020-04-24 23:36:52 +00:00
|
|
|
pycryptodomex
|
|
|
|
pyjwt
|
|
|
|
pyopenssl
|
|
|
|
pytz
|
|
|
|
requests
|
2023-08-22 20:05:09 +00:00
|
|
|
sortedcontainers
|
|
|
|
tomlkit
|
2022-09-30 11:47:45 +00:00
|
|
|
typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
secure-local-storage = [ keyring ];
|
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# Tests require encrypted secrets, see
|
2020-10-19 00:13:06 +00:00
|
|
|
# https://github.com/snowflakedb/snowflake-connector-python/tree/master/.github/workflows/parameters
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"snowflake"
|
|
|
|
"snowflake.connector"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-12-02 08:20:57 +00:00
|
|
|
changelog = "https://github.com/snowflakedb/snowflake-connector-python/blob/v${version}/DESCRIPTION.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Snowflake Connector for Python";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/snowflakedb/snowflake-connector-python";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2021-08-27 14:25:00 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|