From 192f7b218a10f4a86d9e1d4b1fe942f289817dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 17 Sep 2024 10:14:19 -0700 Subject: [PATCH 1/2] python312Packages.snowflake-connector-python: update dependencies --- .../snowflake-connector-python/default.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/snowflake-connector-python/default.nix b/pkgs/development/python-modules/snowflake-connector-python/default.nix index cdf0c3d9a2a4..9cfd5a04e218 100644 --- a/pkgs/development/python-modules/snowflake-connector-python/default.nix +++ b/pkgs/development/python-modules/snowflake-connector-python/default.nix @@ -5,17 +5,16 @@ certifi, cffi, charset-normalizer, + cryptography, cython, fetchPypi, filelock, idna, keyring, - oscrypto, packaging, pandas, platformdirs, pyarrow, - pycryptodomex, pyjwt, pyopenssl, pythonOlder, @@ -25,7 +24,6 @@ sortedcontainers, tomlkit, typing-extensions, - wheel, }: buildPythonPackage rec { @@ -44,21 +42,18 @@ buildPythonPackage rec { build-system = [ cython setuptools - wheel ]; - dependencies = [ asn1crypto certifi cffi charset-normalizer + cryptography filelock idna - oscrypto packaging platformdirs - pycryptodomex pyjwt pyopenssl pytz @@ -68,7 +63,7 @@ buildPythonPackage rec { typing-extensions ]; - passthru.optional-dependencies = { + optional-dependencies = { pandas = [ pandas pyarrow From 23aed73929db488d089c5ed281fee9c4cf1441aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 17 Sep 2024 11:05:31 -0700 Subject: [PATCH 2/2] python312Packages.snowflake-connector-python: run tests --- .../snowflake-connector-python/default.nix | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/snowflake-connector-python/default.nix b/pkgs/development/python-modules/snowflake-connector-python/default.nix index 9cfd5a04e218..0dd9835e617b 100644 --- a/pkgs/development/python-modules/snowflake-connector-python/default.nix +++ b/pkgs/development/python-modules/snowflake-connector-python/default.nix @@ -7,7 +7,7 @@ charset-normalizer, cryptography, cython, - fetchPypi, + fetchFromGitHub, filelock, idna, keyring, @@ -17,6 +17,8 @@ pyarrow, pyjwt, pyopenssl, + pytest-xdist, + pytestCheckHook, pythonOlder, pytz, requests, @@ -33,10 +35,11 @@ buildPythonPackage rec { disabled = pythonOlder "3.8"; - src = fetchPypi { - pname = "snowflake_connector_python"; - inherit version; - hash = "sha256-/ZvCqxv1OE0si2W8ALsEdVV9UvBHenESkzSqtT+Wef0="; + src = fetchFromGitHub { + owner = "snowflakedb"; + repo = "snowflake-connector-python"; + rev = "refs/tags/v${version}"; + hash = "sha256-A6QnKCROd1vJpFCTrLEoHVo43xojdjpgYS3qQm64gcY="; }; build-system = [ @@ -71,9 +74,35 @@ buildPythonPackage rec { secure-local-storage = [ keyring ]; }; - # Tests require encrypted secrets, see - # https://github.com/snowflakedb/snowflake-connector-python/tree/master/.github/workflows/parameters - doCheck = false; + preCheck = '' + export HOME=$(mktemp -d) + ''; + + nativeCheckInputs = [ + pytest-xdist + pytestCheckHook + ]; + + disabledTestPaths = [ + # Tests require encrypted secrets, see + # https://github.com/snowflakedb/snowflake-connector-python/tree/master/.github/workflows/parameters + "test/extras/simple_select1.py" + "test/integ" + # error getting schema from stream, error code: 0, error info: Expected to + # be able to read 19504 bytes for message body but got 19503 + "test/unit/test_connection.py" + "test/unit/test_cursor.py" + "test/unit/test_error_arrow_stream.py" + "test/unit/test_ocsp.py" + "test/unit/test_retry_network.py" + "test/unit/test_s3_util.py" + ]; + + disabledTests = [ + # Tests connect to the internet + "test_status_when_num_of_chunks_is_zero" + "test_test_socket_get_cert" + ]; pythonImportsCheck = [ "snowflake"