default.nix (958B)
1 { lib, python3Packages, fetchFromGitHub, fetchurl }: 2 let 3 testdata = import ./testdata.nix { inherit fetchurl; }; 4 in 5 python3Packages.buildPythonApplication rec { 6 pname = "gpxelevations"; 7 version = "0.3.7"; 8 9 src = fetchFromGitHub { 10 owner = "tkrajina"; 11 repo = "srtm.py"; 12 rev = "v${version}"; 13 hash = "sha256-/AGvFE74sJTnn70VklQp0MG+7dsooavAdSTyV2oJM+I="; 14 }; 15 16 propagatedBuildInputs = with python3Packages; [ requests gpxpy ]; 17 18 dontUseSetuptoolsCheck = true; 19 20 checkPhase = '' 21 mkdir -p tmp_home/.cache/srtm 22 ${lib.concatMapStringsSep "\n" (hgt: '' 23 cp ${hgt} tmp_home/.cache/srtm/${hgt.name} 24 '') testdata} 25 26 HOME=tmp_home ${python3Packages.python.interpreter} -m unittest test 27 ''; 28 29 meta = with lib; { 30 description = "Geo elevation data parser for \"The Shuttle Radar Topography Mission\" data"; 31 inherit (src.meta) homepage; 32 license = licenses.asl20; 33 maintainers = [ maintainers.sikmir ]; 34 }; 35 }