2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
deprecat,
|
|
|
|
dnspython,
|
|
|
|
fetchFromGitHub,
|
|
|
|
loguru,
|
|
|
|
passlib,
|
|
|
|
poetry-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
toml,
|
2022-03-05 16:20:37 +00:00
|
|
|
}:
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ciscoconfparse";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.7.24";
|
2022-02-21 08:47:16 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mpenning";
|
|
|
|
repo = pname;
|
2023-02-22 10:55:15 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-vL/CQdYcOP356EyRToviWylP1EBtxmeov6qkhfQNZ2Y=";
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "loguru" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
postPatch = ''
|
2023-08-22 20:05:09 +00:00
|
|
|
# The line below is in the [build-system] section, which is invalid and
|
|
|
|
# rejected by PyPA's build tool. It belongs in [project] but upstream has
|
|
|
|
# had problems with putting that there (see comment in pyproject.toml).
|
|
|
|
sed -i '/requires-python/d' pyproject.toml
|
|
|
|
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '"poetry>=1.3.2",' ""
|
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
patchShebangs tests
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2022-02-21 08:47:16 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
passlib
|
2023-02-22 10:55:15 +00:00
|
|
|
deprecat
|
2022-03-05 16:20:37 +00:00
|
|
|
dnspython
|
|
|
|
loguru
|
2022-04-15 01:41:22 +00:00
|
|
|
toml
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTestPaths = [ "tests/parse_test.py" ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
2022-05-18 14:49:53 +00:00
|
|
|
# Tests require network access
|
2022-03-05 16:20:37 +00:00
|
|
|
"test_dns_lookup"
|
|
|
|
"test_reverse_dns_lookup"
|
2023-02-22 10:55:15 +00:00
|
|
|
# Path issues with configuration files
|
|
|
|
"testParse_valid_filepath"
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ciscoconfparse" ];
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-02-22 10:55:15 +00:00
|
|
|
description = "Module to parse, audit, query, build, and modify Cisco IOS-style configurations";
|
2022-02-21 08:47:16 +00:00
|
|
|
homepage = "https://github.com/mpenning/ciscoconfparse";
|
2023-02-22 10:55:15 +00:00
|
|
|
changelog = "https://github.com/mpenning/ciscoconfparse/blob/${version}/CHANGES.md";
|
2022-02-21 08:47:16 +00:00
|
|
|
license = licenses.gpl3Only;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ astro ];
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
}
|