From e0516f24a9a8db7cd6e0c7dcfc8180b8c113b52e Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 25 Apr 2022 18:46:30 +0200 Subject: [PATCH 1/2] python3Packages.dropbox: Clean up package and enable more tests --- .../python-modules/dropbox/default.nix | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/dropbox/default.nix b/pkgs/development/python-modules/dropbox/default.nix index 77abbc938eb4..59b9b8fe0af7 100644 --- a/pkgs/development/python-modules/dropbox/default.nix +++ b/pkgs/development/python-modules/dropbox/default.nix @@ -1,12 +1,13 @@ { lib , buildPythonPackage +, pythonOlder , fetchFromGitHub , requests -, urllib3 -, mock -, setuptools +, six , stone -, pythonOlder +, mock +, pytest-mock +, pytestCheckHook }: buildPythonPackage rec { @@ -20,29 +21,54 @@ buildPythonPackage rec { owner = "dropbox"; repo = "dropbox-sdk-python"; rev = "v${version}"; - sha256 = "sha256-pq/LkyOCS0PnujfN9aIx42aeZ8tw4XvRQ4Vid/nXgWE="; + hash = "sha256-pq/LkyOCS0PnujfN9aIx42aeZ8tw4XvRQ4Vid/nXgWE="; }; propagatedBuildInputs = [ requests - urllib3 - mock - setuptools + six stone ]; + checkInputs = [ + mock + pytest-mock + pytestCheckHook + ]; + postPatch = '' substituteInPlace setup.py \ --replace "'pytest-runner == 5.2.0'," "" ''; - # Set DROPBOX_TOKEN environment variable to a valid token. - doCheck = false; + doCheck = true; pythonImportsCheck = [ "dropbox" ]; + # Set SCOPED_USER_DROPBOX_TOKEN environment variable to a valid value. + disabledTests = [ + "test_default_oauth2_urls" + "test_bad_auth" + "test_multi_auth" + "test_refresh" + "test_app_auth" + "test_downscope" + "test_rpc" + "test_upload_download" + "test_bad_upload_types" + "test_clone_when_user_linked" + "test_with_path_root_constructor" + "test_path_root" + "test_path_root_err" + "test_versioned_route" + "test_team" + "test_as_user" + "test_as_admin" + "test_clone_when_team_linked" + ]; + meta = with lib; { description = "Python library for Dropbox's HTTP-based Core and Datastore APIs"; homepage = "https://github.com/dropbox/dropbox-sdk-python"; From 2f39155ad40b7826fcd7d4d82a3170d4d2d59fe6 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 25 Apr 2022 22:57:37 +0200 Subject: [PATCH 2/2] python3Packages.dropbox: Update hash for re-release of 11.30.0 The version of the package was not set properly and defaulted to 0.0.0 . The package was re-released by upstream (with the same version number) after it was reported. This package will now have a correct version number in the dist-info when built, fixing packages that require it to be within certain version bounds. --- pkgs/development/python-modules/dropbox/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/dropbox/default.nix b/pkgs/development/python-modules/dropbox/default.nix index 59b9b8fe0af7..d98b37f49c84 100644 --- a/pkgs/development/python-modules/dropbox/default.nix +++ b/pkgs/development/python-modules/dropbox/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "dropbox"; repo = "dropbox-sdk-python"; rev = "v${version}"; - hash = "sha256-pq/LkyOCS0PnujfN9aIx42aeZ8tw4XvRQ4Vid/nXgWE="; + hash = "sha256-w07r95MBAClf0F3SICiZsHLdslzf+JuxC+BVdTACCog="; }; propagatedBuildInputs = [