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 {
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,7 +66,6 @@ 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
@ -54,8 +77,10 @@ python3Packages.buildPythonApplication rec {
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;
};
}