diff --git a/pkgs/development/python-modules/gcs-oauth2-boto-plugin/default.nix b/pkgs/development/python-modules/gcs-oauth2-boto-plugin/default.nix new file mode 100644 index 000000000000..321a6a1de65d --- /dev/null +++ b/pkgs/development/python-modules/gcs-oauth2-boto-plugin/default.nix @@ -0,0 +1,66 @@ +{ lib +, boto +, buildPythonPackage +, fasteners +, fetchFromGitHub +, freezegun +, google-reauth +, httplib2 +, oauth2client +, pyopenssl +, pytestCheckHook +, pythonOlder +, pythonRelaxDepsHook +, retry_decorator +, rsa +, six +}: + +buildPythonPackage rec { + pname = "gcs-oauth2-boto-plugin"; + version = "3.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "GoogleCloudPlatform"; + repo = pname; + rev = "refs/tags/v${version}"; + sha256 = "sha256-slTxh2j9VhLiSyiTmJIFFakzpzH/+mgilDRxx0VqqKQ="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "rsa==4.7.2" "rsa" \ + --replace "version='2.7'" "version='${version}'" + ''; + + propagatedBuildInputs = [ + boto + freezegun + google-reauth + httplib2 + oauth2client + pyopenssl + retry_decorator + rsa + six + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "gcs_oauth2_boto_plugin" + ]; + + meta = with lib; { + description = "Auth plugin allowing use the use of OAuth 2.0 credentials for Google Cloud Storage"; + homepage = "https://github.com/GoogleCloudPlatform/gcs-oauth2-boto-plugin"; + changelog = "https://github.com/GoogleCloudPlatform/gcs-oauth2-boto-plugin/releases/tag/v${version}"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/google-apitools/default.nix b/pkgs/development/python-modules/google-apitools/default.nix new file mode 100644 index 000000000000..24b37fd722e7 --- /dev/null +++ b/pkgs/development/python-modules/google-apitools/default.nix @@ -0,0 +1,70 @@ +{ lib +, buildPythonPackage +, fasteners +, fetchFromGitHub +, gflags +, httplib2 +, mock +, oauth2client +, pytestCheckHook +, pythonOlder +, six +}: + +buildPythonPackage rec { + pname = "google-apitools"; + version = "0.5.32"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "google"; + repo = "apitools"; + rev = "refs/tags/v${version}"; + hash = "sha256-Z9BTDU6KKCcjspVLi5mJqVZMYEapnMXLPL5BXsIKZAw="; + }; + + propagatedBuildInputs = [ + fasteners + httplib2 + oauth2client + six + ]; + + passthru.optional-dependencies = { + cli = [ + gflags + ]; + }; + + checkInputs = [ + mock + pytestCheckHook + ]; + + pythonImportsCheck = [ + "apitools" + ]; + + disabledTests = [ + # AttributeError: 'FieldList' object has no attribute '_FieldList__field' + "testPickle" + "testDecodeBadBase64BytesField" + "testConvertIdThatNeedsEscaping" + "testGeneration" + ]; + + disabledTestPaths = [ + # Samples are partially postfixed with test + "samples" + ]; + + meta = with lib; { + description = "Collection of utilities to make it easier to build client-side tools"; + homepage = "https://github.com/google/apitools"; + changelog = "https://github.com/google/apitools/releases/tag/v${version}"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/google-reauth/default.nix b/pkgs/development/python-modules/google-reauth/default.nix new file mode 100644 index 000000000000..bdb7d78d7d4a --- /dev/null +++ b/pkgs/development/python-modules/google-reauth/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, mock +, oauth2client +, pytestCheckHook +, pythonOlder +, pyu2f +}: + +buildPythonPackage rec { + pname = "google-reauth"; + version = "0.1.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "Google"; + repo = "google-reauth-python"; + rev = "refs/tags/${version}"; + hash = "sha256-J7GVh+iY+69rFzf4hN/KLFZMZ1/S3CL5TZ7SsP5Oy3g="; + }; + + propagatedBuildInputs = [ + oauth2client + pyu2f + ]; + + checkInputs = [ + mock + pytestCheckHook + ]; + + pythonImportsCheck = [ + "google_reauth" + ]; + + meta = with lib; { + description = "Auth plugin allowing use the use of OAuth 2.0 credentials for Google Cloud Storage"; + homepage = "https://github.com/Google/google-reauth-python"; + changelog = "https://github.com/google/google-reauth-python/releases/tag/${version}"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/retry_decorator/default.nix b/pkgs/development/python-modules/retry_decorator/default.nix index c2f91c8fe1b1..2a90adbd8058 100644 --- a/pkgs/development/python-modules/retry_decorator/default.nix +++ b/pkgs/development/python-modules/retry_decorator/default.nix @@ -1,21 +1,36 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { - pname = "retry_decorator"; + pname = "retry-decorator"; version = "1.1.1"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "e1e8ad02e518fe11073f2ea7d80b6b8be19daa27a60a1838aff7c731ddcf2ebe"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pnpnpn"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-0dZq4YbPcH4ItyMnpF7B20YYLtzwniJClBK9gRndU1M="; }; + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "retry_decorator" + ]; + meta = with lib; { + description = "Decorator for retrying when exceptions occur"; homepage = "https://github.com/pnpnpn/retry-decorator"; - description = "Retry Decorator for python functions"; - license = licenses.mit; + changelog = "https://github.com/pnpnpn/retry-decorator/releases/tag/v${version}"; + license = with licenses; [ asl20 ]; }; - } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0f91e48d0fbd..4f1471b32658 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3603,6 +3603,8 @@ self: super: with self; { gcovr = callPackage ../development/python-modules/gcovr { }; + gcs-oauth2-boto-plugin = callPackage ../development/python-modules/gcs-oauth2-boto-plugin { }; + gcsfs = callPackage ../development/python-modules/gcsfs { }; gdal = toPythonModule (pkgs.gdal.override { python3 = python; }); @@ -3787,6 +3789,8 @@ self: super: with self; { google-api-python-client = callPackage ../development/python-modules/google-api-python-client { }; + google-apitools = callPackage ../development/python-modules/google-apitools { }; + googleapis-common-protos = callPackage ../development/python-modules/googleapis-common-protos { }; google-auth = callPackage ../development/python-modules/google-auth { }; @@ -3903,6 +3907,8 @@ self: super: with self; { google-re2 = callPackage ../development/python-modules/google-re2 { }; + google-reauth = callPackage ../development/python-modules/google-reauth { }; + google-resumable-media = callPackage ../development/python-modules/google-resumable-media { }; googletrans = callPackage ../development/python-modules/googletrans { };