default.nix (1287B)
1 { 2 lib, 3 python3Packages, 4 fetchFromGitHub, 5 fetchurl, 6 writableTmpDirAsHomeHook, 7 }: 8 let 9 testdata = import ./testdata.nix { inherit fetchurl; }; 10 in 11 python3Packages.buildPythonApplication rec { 12 pname = "gpxelevations"; 13 version = "0.3.7"; 14 pyproject = true; 15 16 src = fetchFromGitHub { 17 owner = "tkrajina"; 18 repo = "srtm.py"; 19 tag = "v${version}"; 20 hash = "sha256-/AGvFE74sJTnn70VklQp0MG+7dsooavAdSTyV2oJM+I="; 21 }; 22 23 postPatch = '' 24 # https://docs.python.org/3/whatsnew/3.12.html#id3 25 substituteInPlace test.py \ 26 --replace-fail assertNotEquals assertNotEqual 27 ''; 28 29 build-system = with python3Packages; [ setuptools ]; 30 31 dependencies = with python3Packages; [ 32 requests 33 gpxpy 34 ]; 35 36 nativeCheckInputs = [ writableTmpDirAsHomeHook ]; 37 38 dontUseSetuptoolsCheck = true; 39 40 checkPhase = '' 41 mkdir -p $HOME/.cache/srtm 42 ${lib.concatMapStringsSep "\n" (hgt: '' 43 cp ${hgt} $HOME/.cache/srtm/${hgt.name} 44 '') testdata} 45 46 ${python3Packages.python.interpreter} -m unittest test 47 ''; 48 49 meta = { 50 description = "Geo elevation data parser for \"The Shuttle Radar Topography Mission\" data"; 51 homepage = "https://github.com/tkrajina/srtm.py"; 52 license = lib.licenses.asl20; 53 maintainers = [ lib.maintainers.sikmir ]; 54 }; 55 }