From ed907ddac82fceb5701ee82eb36835de44dddfa8 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 23 May 2024 10:32:11 +0200 Subject: [PATCH] dyndnsc: refactor --- .../networking/dyndns/dyndnsc/default.nix | 57 +++++++++++++------ 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/networking/dyndns/dyndnsc/default.nix b/pkgs/applications/networking/dyndns/dyndnsc/default.nix index 6a9a57d67c3b..1e4e3fde1e39 100644 --- a/pkgs/applications/networking/dyndns/dyndnsc/default.nix +++ b/pkgs/applications/networking/dyndns/dyndnsc/default.nix @@ -1,33 +1,57 @@ -{ lib, python3Packages, fetchPypi, stdenv }: +{ lib +, stdenv +, python3Packages +, fetchPypi +}: python3Packages.buildPythonApplication rec { pname = "dyndnsc"; version = "0.6.1"; + pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "13078d29eea2f9a4ca01f05676c3309ead5e341dab047e0d51c46f23d4b7fbb4"; + hash = "sha256-EweNKe6i+aTKAfBWdsMwnq1eNB2rBH4NUcRvI9S3+7Q="; }; postPatch = '' - substituteInPlace setup.py --replace "bottle==" "bottle>=" + substituteInPlace setup.py \ + --replace-fail '"pytest-runner"' "" ''; - nativeBuildInputs = with python3Packages; [ pytest-runner ]; - propagatedBuildInputs = with python3Packages; [ - daemonocle - dnspython - netifaces - requests - json-logging + pythonRelaxDeps = [ + "bottle" + ]; + + build-system = with python3Packages; [ setuptools ]; - nativeCheckInputs = with python3Packages; [ bottle mock pytest-console-scripts pytestCheckHook ]; + + nativeBuildInputs = with python3Packages; [ + pythonRelaxDepsHook + ]; + + dependencies = with python3Packages; [ + daemonocle + dnspython + json-logging + netifaces + requests + setuptools + ]; + + nativeCheckInputs = with python3Packages; [ + bottle + pytest-console-scripts + pytestCheckHook + ]; disabledTests = [ # dnswanip connects to an external server to discover the # machine's IP address. "dnswanip" + # AssertionError + "test_null_dummy" ] ++ lib.optionals stdenv.isDarwin [ # The tests that spawn a server using Bottle cannot be run on # macOS or Windows as the default multiprocessing start method @@ -42,20 +66,21 @@ python3Packages.buildPythonApplication rec { meta = with lib; { description = "Dynamic DNS update client with support for multiple protocols"; - mainProgram = "dyndnsc"; longDescription = '' Dyndnsc is a command line client for sending updates to Dynamic - DNS (DDNS, DynDNS) services. It supports multiple protocols and - services, and it has native support for IPv6. The configuration - file allows using foreign, but compatible services. Dyndnsc + DNS (DDNS, DynDNS) services. It supports multiple protocols and + services, and it has native support for IPv6. The configuration + file allows using foreign, but compatible services. Dyndnsc ships many different IP detection mechanisms, support for configuring multiple services in one place and it has a daemon - mode for running unattended. It has a plugin system to provide + mode for running unattended. It has a plugin system to provide external notification services. ''; homepage = "https://github.com/infothrill/python-dyndnsc"; + changelog = "https://github.com/infothrill/python-dyndnsc/releases/tag/${version}"; license = licenses.mit; maintainers = with maintainers; [ AluisioASG ]; + mainProgram = "dyndnsc"; platforms = platforms.unix; }; }