From 156a0827bd7c9b06703b3cbf94f2035cd984d9f3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 2 Oct 2022 14:37:04 +0200 Subject: [PATCH] python3Packages.mypy-protobuf: Build using buildPythonPackage Reformat, tried to enable tests but we miss a dependency, added pythonImportsCheck. Added top-level attribute to expose executables. --- .../python-modules/mypy-protobuf/default.nix | 28 +++++++++++++++++-- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/mypy-protobuf/default.nix b/pkgs/development/python-modules/mypy-protobuf/default.nix index 007fd2fd015f..c63910abc56c 100644 --- a/pkgs/development/python-modules/mypy-protobuf/default.nix +++ b/pkgs/development/python-modules/mypy-protobuf/default.nix @@ -1,6 +1,14 @@ -{ lib, fetchPypi, buildPythonApplication, protobuf, types-protobuf, grpcio-tools, pythonOlder }: +{ lib +, fetchPypi +, buildPythonPackage +, protobuf +, types-protobuf +, grpcio-tools +, pytestCheckHook +, pythonOlder +}: -buildPythonApplication rec { +buildPythonPackage rec { pname = "mypy-protobuf"; version = "3.3.0"; format = "pyproject"; @@ -12,7 +20,21 @@ buildPythonApplication rec { sha256 = "sha256-JPOwrssGZW6YP1jgfHMqkFd7nXrz4QZvwrZju/A3Akg="; }; - propagatedBuildInputs = [ protobuf types-protobuf grpcio-tools ]; + propagatedBuildInputs = [ + protobuf + types-protobuf + grpcio-tools + ]; + + doCheck = false; # ModuleNotFoundError: No module named 'testproto' + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "mypy_protobuf" + ]; meta = with lib; { description = "Generate mypy stub files from protobuf specs"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 80f7c717a3da..bd1184d1f98b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17614,6 +17614,8 @@ with pkgs; mypy = with python3Packages; toPythonApplication mypy; + mypy-protobuf = with python3Packages; toPythonApplication mypy-protobuf; + nsis = callPackage ../development/tools/nsis { }; tockloader = callPackage ../development/tools/misc/tockloader { };