Merge pull request #187997 from RaitoBezarius/ripe-atlas-tools

authored by Martin Weinelt and committed by GitHub c2cbd5c9 59058bae

+97
+95
pkgs/tools/networking/ripe-atlas-tools/default.nix
··· 1 + { lib 2 + , python3 3 + , fetchFromGitHub 4 + , installShellFiles 5 + }: 6 + 7 + python3.pkgs.buildPythonApplication rec { 8 + pname = "ripe-atlas-tools"; 9 + version = "3.0.2"; 10 + 11 + src = fetchFromGitHub { 12 + owner = "RIPE-NCC"; 13 + repo = "ripe-atlas-tools"; 14 + rev = "v${version}"; 15 + sha256 = "sha256-5AMqBXxJZOtI0/2NrEjrUfNXWKc7sn6kZX26766LBUM="; 16 + }; 17 + 18 + postPatch = '' 19 + # This mapping triggers network access on docs generation: https://github.com/RIPE-NCC/ripe-atlas-tools/issues/235 20 + sed -i '/^intersphinx_mapping/d' docs/conf.py 21 + # TODO: Ensure user-agent is picked up during build, remove me when https://github.com/RIPE-NCC/ripe-atlas-tools/pull/236 22 + echo "include ripe/atlas/tools/user-agent" >> MANIFEST.in 23 + ''; 24 + 25 + nativeBuildInputs = with python3.pkgs; [ 26 + sphinx-rtd-theme 27 + sphinxHook 28 + installShellFiles 29 + ]; 30 + 31 + propagatedBuildInputs = with python3.pkgs; [ 32 + ripe-atlas-cousteau 33 + ripe-atlas-sagan 34 + ujson 35 + ipy 36 + python-dateutil 37 + requests 38 + tzlocal 39 + pyyaml 40 + pyopenssl 41 + ]; 42 + 43 + preBuild = '' 44 + echo "RIPE Atlas Tools [NixOS ${lib.trivial.version}] ${version}" > ripe/atlas/tools/user-agent 45 + ''; 46 + 47 + postInstall = '' 48 + installShellCompletion --cmd ripe-atlas --bash ./ripe-atlas-bash-completion.sh 49 + ''; 50 + 51 + pythonImportsCheck = [ 52 + "ripe.atlas.tools" 53 + ]; 54 + 55 + checkInputs = with python3.pkgs; [ 56 + pytestCheckHook 57 + ]; 58 + 59 + disabledTests = [ 60 + # Network tests: https://github.com/RIPE-NCC/ripe-atlas-tools/issues/234 61 + "test_arg_from_file" 62 + "test_arg_from_stdin" 63 + # We injected our user-agent so the tests will fail 64 + "test_user_agent_mac" 65 + "test_user_agent_windows" 66 + "test_user_agent_xdg_absent" 67 + "test_user_agent_xdg_present" 68 + ]; 69 + 70 + disabledTestPaths = [ 71 + # Relies on `ripe-atlas` being available in the PATH, installed with autocompletions 72 + "tests/test_bash_completion.py" 73 + # AS lookups are not mocked up: https://github.com/RIPE-NCC/ripe-atlas-tools/blob/master/tests/renderers/test_traceroute_aspath.py#L26 74 + "tests/renderers/test_traceroute_aspath.py" 75 + # We already build Sphinx so we do not need to test it 76 + "tests/test_docs.py" 77 + ]; 78 + 79 + HOME = "$TMPDIR"; # for cache generation. 80 + 81 + # Necessary because it confuse the tests when it does "from ripe.atlas.sagan import X" 82 + # version.py is used by Sphinx tests. 83 + preCheck = '' 84 + rm -rf ripe 85 + mkdir -p ripe/atlas/tools 86 + echo "__version__ = \"${version}\"" > ripe/atlas/tools/version.py 87 + ''; 88 + 89 + meta = with lib; { 90 + description = "RIPE ATLAS project tools"; 91 + homepage = "https://github.com/RIPE-NCC/ripe-atlas-tools"; 92 + license = licenses.gpl3Only; 93 + maintainers = with maintainers; [ raitobezarius ]; 94 + }; 95 + }
+2
pkgs/top-level/all-packages.nix
··· 4649 4649 inherit (darwin.apple_sdk.frameworks) AppKit Security; 4650 4650 }; 4651 4651 4652 + ripe-atlas-tools = callPackage ../tools/networking/ripe-atlas-tools { }; 4653 + 4652 4654 roundcube = callPackage ../servers/roundcube { }; 4653 4655 4654 4656 roundcubePlugins = dontRecurseIntoAttrs (callPackage ../servers/roundcube/plugins { });