nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 exabgp,
6 testers,
7}:
8
9python3Packages.buildPythonApplication rec {
10 pname = "exabgp";
11 version = "5.0.1";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "Exa-Networks";
16 repo = "exabgp";
17 tag = version;
18 hash = "sha256-UFo92jS/QmwTUEAhxQnbtY9K905jiBrJujfqGIUCUOg=";
19 };
20
21 postPatch = ''
22 # https://github.com/Exa-Networks/exabgp/pull/1344
23 substituteInPlace src/exabgp/application/healthcheck.py --replace-fail \
24 "f'/sbin/ip -o address show dev {ifname}'.split()" \
25 '["ip", "-o", "address", "show", "dev", ifname]'
26 '';
27
28 build-system = with python3Packages; [
29 setuptools
30 ];
31
32 pythonImportsCheck = [
33 "exabgp"
34 ];
35
36 nativeCheckInputs = with python3Packages; [
37 hypothesis
38 psutil
39 pytest-asyncio
40 pytest-benchmark
41 pytest-timeout
42 pytest-xdist
43 pytestCheckHook
44 ];
45
46 __darwinAllowLocalNetworking = true;
47
48 pytestFlags = [ "--benchmark-disable" ];
49
50 enabledTests = [ "tests" ];
51
52 disabledTests = [
53 # AssertionError: Server should receive connection
54 "test_outgoing_connection_establishment"
55 ];
56
57 passthru.tests = {
58 version = testers.testVersion {
59 package = exabgp;
60 command = "exabgp version";
61 };
62 };
63
64 meta = {
65 description = "BGP swiss army knife of networking";
66 homepage = "https://github.com/Exa-Networks/exabgp";
67 changelog = "https://github.com/Exa-Networks/exabgp/blob/${src.tag}/CHANGELOG.rst";
68 license = lib.licenses.bsd3;
69 mainProgram = "exabgp";
70 maintainers = with lib.maintainers; [
71 hexa
72 raitobezarius
73 ];
74 };
75}