1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 lxml,
6 paramiko,
7 setuptools,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "ncclient";
13 version = "0.7.0";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "ncclient";
18 repo = "ncclient";
19 tag = "v${version}";
20 # Upstream uses .gitattributes to inject information about the revision
21 # hash and the refname into `ncclient/_version.py`, see:
22 #
23 # - https://git-scm.com/docs/gitattributes#_export_subst and
24 # - https://github.com/ncclient/ncclient/blob/e056e38af2843de0608da58e2f4662465c96d587/ncclient/_version.py#L25-L28
25 postFetch = ''
26 sed -i 's/git_refnames = "[^"]*"/git_refnames = " (tag: ${src.tag})"/' $out/ncclient/_version.py
27 '';
28 hash = "sha256-vSX+9nTl4r6vnP/vmavdmdChzOC8P2G093/DQNMQwS4=";
29 };
30
31 build-system = [
32 setuptools
33 ];
34
35 dependencies = [
36 paramiko
37 lxml
38 ];
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 pythonImportsCheck = [ "ncclient" ];
43
44 meta = {
45 description = "Python library for NETCONF clients";
46 homepage = "https://github.com/ncclient/ncclient";
47 changelog = "https://github.com/ncclient/ncclient/releases/tag/${src.tag}";
48 license = lib.licenses.asl20;
49 maintainers = with lib.maintainers; [ xnaveira ];
50 };
51}