dyndnsc: refactor

This commit is contained in:
Fabian Affolter 2024-05-23 10:32:11 +02:00
parent 1349027dbc
commit ed907ddac8

View File

@ -1,33 +1,57 @@
{ lib, python3Packages, fetchPypi, stdenv }: { lib
, stdenv
, python3Packages
, fetchPypi
}:
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
pname = "dyndnsc"; pname = "dyndnsc";
version = "0.6.1"; version = "0.6.1";
pyproject = true;
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "13078d29eea2f9a4ca01f05676c3309ead5e341dab047e0d51c46f23d4b7fbb4"; hash = "sha256-EweNKe6i+aTKAfBWdsMwnq1eNB2rBH4NUcRvI9S3+7Q=";
}; };
postPatch = '' postPatch = ''
substituteInPlace setup.py --replace "bottle==" "bottle>=" substituteInPlace setup.py \
--replace-fail '"pytest-runner"' ""
''; '';
nativeBuildInputs = with python3Packages; [ pytest-runner ]; pythonRelaxDeps = [
propagatedBuildInputs = with python3Packages; [ "bottle"
daemonocle ];
dnspython
netifaces build-system = with python3Packages; [
requests
json-logging
setuptools 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 = [ disabledTests = [
# dnswanip connects to an external server to discover the # dnswanip connects to an external server to discover the
# machine's IP address. # machine's IP address.
"dnswanip" "dnswanip"
# AssertionError
"test_null_dummy"
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
# The tests that spawn a server using Bottle cannot be run on # The tests that spawn a server using Bottle cannot be run on
# macOS or Windows as the default multiprocessing start method # macOS or Windows as the default multiprocessing start method
@ -42,20 +66,21 @@ python3Packages.buildPythonApplication rec {
meta = with lib; { meta = with lib; {
description = "Dynamic DNS update client with support for multiple protocols"; description = "Dynamic DNS update client with support for multiple protocols";
mainProgram = "dyndnsc";
longDescription = '' longDescription = ''
Dyndnsc is a command line client for sending updates to Dynamic Dyndnsc is a command line client for sending updates to Dynamic
DNS (DDNS, DynDNS) services. It supports multiple protocols and DNS (DDNS, DynDNS) services. It supports multiple protocols and
services, and it has native support for IPv6. The configuration services, and it has native support for IPv6. The configuration
file allows using foreign, but compatible services. Dyndnsc file allows using foreign, but compatible services. Dyndnsc
ships many different IP detection mechanisms, support for ships many different IP detection mechanisms, support for
configuring multiple services in one place and it has a daemon 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. external notification services.
''; '';
homepage = "https://github.com/infothrill/python-dyndnsc"; homepage = "https://github.com/infothrill/python-dyndnsc";
changelog = "https://github.com/infothrill/python-dyndnsc/releases/tag/${version}";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ AluisioASG ]; maintainers = with maintainers; [ AluisioASG ];
mainProgram = "dyndnsc";
platforms = platforms.unix; platforms = platforms.unix;
}; };
} }