From 4ca35bf4b477f1b7cb236223230f60a6b0df4bf2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 22 Jun 2026 23:28:46 +0200 Subject: [PATCH] python3Packages.cloudcheck: 7.2.11 -> 11.0.0 --- .../python-modules/cloudcheck/default.nix | 72 +++++++++++++------ 1 file changed, 49 insertions(+), 23 deletions(-) diff --git a/pkgs/development/python-modules/cloudcheck/default.nix b/pkgs/development/python-modules/cloudcheck/default.nix index b9094e6ca190..aada97af0dce 100644 --- a/pkgs/development/python-modules/cloudcheck/default.nix +++ b/pkgs/development/python-modules/cloudcheck/default.nix @@ -2,56 +2,82 @@ lib, buildPythonPackage, fetchFromGitHub, - httpx, - poetry-core, - poetry-dynamic-versioning, + fetchurl, + openssl, + perl, + pkg-config, pydantic, pytest-asyncio, pytestCheckHook, - radixtarget, - regex, + requests, + rustPlatform, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "cloudcheck"; - version = "7.2.11"; + version = "11.0.0"; pyproject = true; src = fetchFromGitHub { owner = "blacklanternsecurity"; repo = "cloudcheck"; - tag = "v${version}"; - hash = "sha256-z2KJ6EaqQLc2oQBZCfKMejPlTdgYGzmDPm/rGLHXCQA="; + tag = "v${finalAttrs.version}"; + hash = "sha256-ao5NSGu2QOPn0P/51vjIu71IlhTWd1h4q9q++B+p4Po="; }; - pythonRelaxDeps = [ - "radixtarget" - "regex" + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) pname version src; + hash = "sha256-8uMyBhD8dybSFS4KqFHBfamyTdFYawoM0P4R6WAy10E="; + }; + + nativeBuildInputs = with rustPlatform; [ + cargoSetupHook + maturinBuildHook + perl + pkg-config ]; - build-system = [ - poetry-core - poetry-dynamic-versioning - ]; + env.SWAGGER_UI_DOWNLOAD_URL = + let + swaggerUi = fetchurl { + url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.14.zip"; + hash = "sha256-SBJE0IEgl7Efuu73n3HZQrFxYX+cn5UU5jrL4T5xzNw="; + }; + in + "file://${swaggerUi}"; - dependencies = [ - httpx - pydantic - radixtarget - regex - ]; + buildInputs = [ openssl ]; nativeCheckInputs = [ + pydantic pytest-asyncio pytestCheckHook + requests ]; pythonImportsCheck = [ "cloudcheck" ]; + disabledTestPaths = [ + # Test requires network access + "cloudcheck_update/test_cloudcheck_update.py" + ]; + + disabledTests = [ + # Tests require network access + "test_lookup_google_dns" + "test_lookup_amazon_domain" + "test_lookup_endpoint" + ]; + + preCheck = '' + rm -rf cloudcheck + ''; + meta = { description = "Module to check whether an IP address or hostname belongs to popular cloud providers"; homepage = "https://github.com/blacklanternsecurity/cloudcheck"; + changelog = "https://github.com/blacklanternsecurity/cloudcheck/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ fab ]; }; -} +})