From 3aacc1a324466853ddc871936bcda36816515c25 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sat, 16 Sep 2023 04:34:29 -0700 Subject: [PATCH 1/3] python3Packages.mypy-boto3-ebs, python3Packages.mypy-boto3-s3: build using shared buildMypyBoto3Package --- .../python-modules/mypy-boto3-ebs/default.nix | 39 --------------- .../python-modules/mypy-boto3-s3/default.nix | 46 ----------------- .../python-modules/mypy-boto3/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 8 ++- 4 files changed, 56 insertions(+), 87 deletions(-) delete mode 100644 pkgs/development/python-modules/mypy-boto3-ebs/default.nix delete mode 100644 pkgs/development/python-modules/mypy-boto3-s3/default.nix create mode 100644 pkgs/development/python-modules/mypy-boto3/default.nix diff --git a/pkgs/development/python-modules/mypy-boto3-ebs/default.nix b/pkgs/development/python-modules/mypy-boto3-ebs/default.nix deleted file mode 100644 index 8b22c42f0f7b..000000000000 --- a/pkgs/development/python-modules/mypy-boto3-ebs/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ lib -, boto3 -, buildPythonPackage -, fetchPypi -, pythonOlder -, typing-extensions -}: - -buildPythonPackage rec { - pname = "mypy-boto3-ebs"; - version = "1.28.36"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-w9OLKJAn9UBnA7x+uedhplSV8plZRYlBpviU9Gv1Ny8="; - }; - - propagatedBuildInputs = [ - boto3 - typing-extensions - ]; - - # Project has no tests - doCheck = false; - - pythonImportsCheck = [ - "mypy_boto3_ebs" - ]; - - meta = with lib; { - description = "Type annotations for boto3.s3"; - homepage = "https://github.com/youtype/mypy_boto3_builder"; - license = with licenses; [ mit ]; - maintainers = with maintainers; [ fab ]; - }; -} diff --git a/pkgs/development/python-modules/mypy-boto3-s3/default.nix b/pkgs/development/python-modules/mypy-boto3-s3/default.nix deleted file mode 100644 index 572506275a7c..000000000000 --- a/pkgs/development/python-modules/mypy-boto3-s3/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ lib -, boto3 -, buildPythonPackage -, cython_3 -, fetchPypi -, pythonOlder -, typing-extensions -}: - -buildPythonPackage rec { - pname = "mypy-boto3-s3"; - version = "1.28.55"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-sAiAn0SOdAdQEtT8VLAXbeC09JvDjjneMMoOdk63UFY="; - }; - - nativeBuildInputs = [ - cython_3 - ]; - - propagatedBuildInputs = [ - boto3 - ] ++ lib.optionals (pythonOlder "3.12") [ - typing-extensions - ]; - - # Project has no tests - doCheck = false; - - pythonImportsCheck = [ - "mypy_boto3_s3" - ]; - - meta = with lib; { - description = "Type annotations for boto3.s3"; - homepage = "https://github.com/youtype/mypy_boto3_builder"; - changelog = "https://github.com/youtype/mypy_boto3_builder/releases/tag/${version}"; - license = with licenses; [ mit ]; - maintainers = with maintainers; [ fab ]; - }; -} diff --git a/pkgs/development/python-modules/mypy-boto3/default.nix b/pkgs/development/python-modules/mypy-boto3/default.nix new file mode 100644 index 000000000000..9b3cd4b7fa1f --- /dev/null +++ b/pkgs/development/python-modules/mypy-boto3/default.nix @@ -0,0 +1,50 @@ +{ lib +, boto3 +, buildPythonPackage +, pythonOlder +, typing-extensions +, fetchPypi +}: +let + toUnderscore = str: builtins.replaceStrings [ "-" ] [ "_" ] str; + + buildMypyBoto3Package = serviceName: version: hash: + buildPythonPackage rec { + pname = "mypy-boto3-${serviceName}"; + inherit version; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version hash; + }; + + propagatedBuildInputs = [ + boto3 + ] ++ lib.optionals (pythonOlder "3.12") [ + typing-extensions + ]; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ + "mypy_boto3_${toUnderscore serviceName}" + ]; + + meta = with lib; { + description = "Type annotations for boto3 ${serviceName}"; + homepage = "https://github.com/youtype/mypy_boto3_builder"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; + }; +in +rec { + + mypy-boto3-ebs = buildMypyBoto3Package "ebs" "1.28.36" "sha256-w9OLKJAn9UBnA7x+uedhplSV8plZRYlBpviU9Gv1Ny8="; + + mypy-boto3-s3 = buildMypyBoto3Package "s3" "1.28.55" "sha256-sAiAn0SOdAdQEtT8VLAXbeC09JvDjjneMMoOdk63UFY="; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cf7d72b5347d..9e55bac8168a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7063,9 +7063,13 @@ self: super: with self; { mypy-boto3-builder = callPackage ../development/python-modules/mypy-boto3-builder { }; - mypy-boto3-ebs = callPackage ../development/python-modules/mypy-boto3-ebs { }; + inherit (callPackage ../development/python-modules/mypy-boto3 { }) - mypy-boto3-s3 = callPackage ../development/python-modules/mypy-boto3-s3 { }; + mypy-boto3-ebs + + mypy-boto3-s3 + + ; mypy-extensions = callPackage ../development/python-modules/mypy/extensions.nix { }; From 9ffd5471c7f255b7bad0b3d136464f37660d010c Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sat, 16 Sep 2023 04:36:01 -0700 Subject: [PATCH 2/3] python3Packages.mypy-boto3-cognito-idp: init at 1.28.36 --- pkgs/development/python-modules/mypy-boto3/default.nix | 2 ++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/mypy-boto3/default.nix b/pkgs/development/python-modules/mypy-boto3/default.nix index 9b3cd4b7fa1f..c6d5027ef377 100644 --- a/pkgs/development/python-modules/mypy-boto3/default.nix +++ b/pkgs/development/python-modules/mypy-boto3/default.nix @@ -43,6 +43,8 @@ let in rec { + mypy-boto3-cognito-idp = buildMypyBoto3Package "cognito-idp" "1.28.36" "sha256-pnLO62LZvr4sJsye3gWJROY+xHikSe7dX8erBTRXrPc="; + mypy-boto3-ebs = buildMypyBoto3Package "ebs" "1.28.36" "sha256-w9OLKJAn9UBnA7x+uedhplSV8plZRYlBpviU9Gv1Ny8="; mypy-boto3-s3 = buildMypyBoto3Package "s3" "1.28.55" "sha256-sAiAn0SOdAdQEtT8VLAXbeC09JvDjjneMMoOdk63UFY="; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9e55bac8168a..1a7679eb49e4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7065,6 +7065,8 @@ self: super: with self; { inherit (callPackage ../development/python-modules/mypy-boto3 { }) + mypy-boto3-cognito-idp + mypy-boto3-ebs mypy-boto3-s3 From a097cfe10a5e074218e00de705a18e32ab1c4c28 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sat, 16 Sep 2023 04:36:39 -0700 Subject: [PATCH 3/3] python3Packages.mypy-boto3-*: add myself (mbalatsko) as maintainer --- pkgs/development/python-modules/mypy-boto3/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/mypy-boto3/default.nix b/pkgs/development/python-modules/mypy-boto3/default.nix index c6d5027ef377..9beda6e1aab5 100644 --- a/pkgs/development/python-modules/mypy-boto3/default.nix +++ b/pkgs/development/python-modules/mypy-boto3/default.nix @@ -37,7 +37,7 @@ let description = "Type annotations for boto3 ${serviceName}"; homepage = "https://github.com/youtype/mypy_boto3_builder"; license = with licenses; [ mit ]; - maintainers = with maintainers; [ fab ]; + maintainers = with maintainers; [ fab mbalatsko ]; }; }; in