From 1ea0000c9613186f692c235b6fb3e5606333af43 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Oct 2024 10:28:24 +0200 Subject: [PATCH] mitmproxy2swagger: refactor --- .../security/mitmproxy2swagger/default.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/security/mitmproxy2swagger/default.nix b/pkgs/tools/security/mitmproxy2swagger/default.nix index 6731d7c21c53..baf318573ee7 100644 --- a/pkgs/tools/security/mitmproxy2swagger/default.nix +++ b/pkgs/tools/security/mitmproxy2swagger/default.nix @@ -1,29 +1,29 @@ -{ lib -, fetchFromGitHub -, python3 +{ + lib, + fetchFromGitHub, + python3, }: python3.pkgs.buildPythonApplication rec { pname = "mitmproxy2swagger"; version = "0.13.0"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "alufers"; - repo = pname; + repo = "mitmproxy2swagger"; rev = "refs/tags/${version}"; hash = "sha256-VHxqxee5sQWRS13V4SfY4LWaN0oxxWsNVDOEqUyKHfg="; }; - nativeBuildInputs = with python3.pkgs; [ - poetry-core - ]; - pythonRelaxDeps = [ + "mitmproxy" "ruamel.yaml" ]; - propagatedBuildInputs = with python3.pkgs; [ + build-system = with python3.pkgs; [ poetry-core ]; + + dependencies = with python3.pkgs; [ json-stream mitmproxy ruamel-yaml @@ -32,16 +32,14 @@ python3.pkgs.buildPythonApplication rec { # No tests available doCheck = false; - pythonImportsCheck = [ - "mitmproxy2swagger" - ]; + pythonImportsCheck = [ "mitmproxy2swagger" ]; meta = with lib; { description = "Tool to automagically reverse-engineer REST APIs"; - mainProgram = "mitmproxy2swagger"; homepage = "https://github.com/alufers/mitmproxy2swagger"; changelog = "https://github.com/alufers/mitmproxy2swagger/releases/tag/${version}"; license = licenses.mit; maintainers = with maintainers; [ fab ]; + mainProgram = "mitmproxy2swagger"; }; }