From f31024ffc3a0cb1823780643c2832e20f014a1b2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 24 Nov 2022 17:46:28 +0100 Subject: [PATCH 1/4] python310Packages.google-reauth: init at 0.1.1 --- .../python-modules/google-reauth/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/google-reauth/default.nix 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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6935f3efff29..efe6d856a098 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3901,6 +3901,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 { }; From 04576632978a7fa6c465b725dc1b592d4c407c4c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 24 Nov 2022 16:21:32 +0100 Subject: [PATCH 2/4] python310Packages.retry_decorator: switch to pytestCheckHook - add pythonImportsCheck - add changelog to meta - disable on older Python releases --- .../retry_decorator/default.nix | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) 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 ]; }; - } From 68abb937978c83c1d820afbb5cdd992c6780c449 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 24 Nov 2022 17:01:14 +0100 Subject: [PATCH 3/4] python310Packages.google-apitools: init at 0.5.32 --- .../google-apitools/default.nix | 70 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 72 insertions(+) create mode 100644 pkgs/development/python-modules/google-apitools/default.nix 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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index efe6d856a098..0e1a93b31c29 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3785,6 +3785,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 { }; From 7dfe967b9a6352a32a419273761e5c72a21be075 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 24 Nov 2022 17:26:37 +0100 Subject: [PATCH 4/4] python310Packages.gcs-oauth2-boto-plugin: init at 3.0 --- .../gcs-oauth2-boto-plugin/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/gcs-oauth2-boto-plugin/default.nix 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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0e1a93b31c29..a3db70985fdf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3601,6 +3601,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; });