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"