Skip to content

Commit 14e770e

Browse files
arouteserver: init at 1.23.1 (#353218)
2 parents f48ee02 + 89ab955 commit 14e770e

File tree

5 files changed

+144
-0
lines changed

5 files changed

+144
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{ python3Packages }:
2+
3+
with python3Packages;
4+
toPythonApplication aggregate6
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
lib,
3+
python3Packages,
4+
fetchFromGitHub,
5+
bgpq4,
6+
}:
7+
8+
python3Packages.buildPythonPackage rec {
9+
pname = "arouteserver";
10+
version = "1.23.1";
11+
pyproject = true;
12+
13+
src = fetchFromGitHub {
14+
owner = "pierky";
15+
repo = "arouteserver";
16+
rev = "v${version}";
17+
hash = "sha256-EZOBMDBsxbuVzzjQWU8V4n3gcLkRQxCq2eVK/Tyko4E=";
18+
};
19+
20+
postPatch = ''
21+
substituteInPlace tests/static/test_irr_queries_failover.py --replace-fail 'bgpq4 -h' '${lib.getExe bgpq4} -h'
22+
23+
substituteInPlace pierky/arouteserver/builder.py pierky/arouteserver/config/program.py tests/static/test_cfg_program.py \
24+
--replace-fail '"bgpq4"' '"${lib.getExe bgpq4}"'
25+
'';
26+
27+
build-system = with python3Packages; [ setuptools ];
28+
29+
dependencies = with python3Packages; [
30+
aggregate6
31+
jinja2
32+
pyyaml
33+
requests
34+
packaging
35+
urllib3
36+
setuptools
37+
];
38+
39+
nativeCheckInputs = with python3Packages; [
40+
pytestCheckHook
41+
requests-mock
42+
];
43+
44+
pythonImportsCheck = [
45+
"pierky"
46+
"pierky.arouteserver"
47+
];
48+
49+
pytestFlagsArray = [ "tests/static" ];
50+
51+
meta = {
52+
description = "Automatically build (and test) feature-rich configurations for BGP route servers";
53+
mainProgram = "arouteserver";
54+
homepage = "https://github.com/pierky/arouteserver";
55+
changelog = "https://github.com/pierky/arouteserver/blob/v${version}/CHANGES.rst";
56+
license = with lib.licenses; [ gpl3Only ];
57+
maintainers = lib.teams.wdz.members ++ (with lib.maintainers; [ marcel ]);
58+
};
59+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From d20c7039316ea7c76da86963b266d3c34001b9f7 Mon Sep 17 00:00:00 2001
2+
From: Marcel <[email protected]>
3+
Date: Sat, 2 Nov 2024 21:13:37 +0100
4+
Subject: [PATCH] setup: remove nose, coverage
5+
6+
---
7+
setup.py | 3 +--
8+
1 file changed, 1 insertion(+), 2 deletions(-)
9+
10+
diff --git a/setup.py b/setup.py
11+
index b880f27..7a47360 100644
12+
--- a/setup.py
13+
+++ b/setup.py
14+
@@ -70,7 +70,7 @@ setup(
15+
'Programming Language :: Python :: 3',
16+
'Programming Language :: Python :: 3.6'
17+
],
18+
- setup_requires=["nose", "coverage", "mock"],
19+
+ setup_requires=["mock"],
20+
install_requires=["py-radix==0.10.0"] + (
21+
["future", "ipaddress"] if sys.version_info.major == 2 else []
22+
),
23+
@@ -78,5 +78,4 @@ setup(
24+
entry_points={'console_scripts':
25+
['aggregate6 = aggregate6.aggregate6:main']},
26+
data_files = [('man/man7', ['aggregate6.7'])],
27+
- test_suite='nose.collector'
28+
)
29+
--
30+
2.44.1
31+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
setuptools,
6+
py-radix-sr,
7+
pytestCheckHook,
8+
mock,
9+
}:
10+
11+
buildPythonPackage rec {
12+
pname = "aggregate6";
13+
version = "1.0.12";
14+
pyproject = true;
15+
16+
src = fetchFromGitHub {
17+
owner = "job";
18+
repo = "aggregate6";
19+
rev = version;
20+
hash = "sha256-tBo9LSmEu/0KPSeg17dlh7ngUvP9GyW6b01qqpr5Bx0=";
21+
};
22+
23+
patches = [ ./0001-setup-remove-nose-coverage.patch ];
24+
25+
# py-radix-sr is a fork, with fixes
26+
postPatch = ''
27+
substituteInPlace setup.py --replace-fail 'py-radix==0.10.0' 'py-radix-sr'
28+
'';
29+
30+
build-system = [ setuptools ];
31+
32+
dependencies = [ py-radix-sr ];
33+
34+
nativeCheckInputs = [
35+
pytestCheckHook
36+
mock
37+
];
38+
39+
pythonImportsCheck = [ "aggregate6" ];
40+
41+
meta = {
42+
description = "IPv4 and IPv6 prefix aggregation tool";
43+
mainProgram = "aggregate6";
44+
homepage = "https://github.com/job/aggregate6";
45+
license = with lib.licenses; [ bsd2 ];
46+
maintainers = lib.teams.wdz.members ++ (with lib.maintainers; [ marcel ]);
47+
};
48+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ self: super: with self; {
123123

124124
agent-py = callPackage ../development/python-modules/agent-py { };
125125

126+
aggregate6 = callPackage ../development/python-modules/aggregate6 { };
127+
126128
ago = callPackage ../development/python-modules/ago { };
127129

128130
aggdraw = callPackage ../development/python-modules/aggdraw { };

0 commit comments

Comments
 (0)