1{ 2 lib, 3 buildPythonPackage, 4 fetchzip, 5 mercurial, 6 pytestCheckHook, 7 fetchpatch2, 8 setuptools, 9}: 10 11buildPythonPackage rec { 12 pname = "python-hglib"; 13 version = "2.6.2"; 14 pyproject = true; 15 16 src = fetchzip { 17 url = "https://repo.mercurial-scm.org/python-hglib/archive/${version}.tar.gz"; 18 hash = "sha256-UXersegqJ9VAxy4Kvpb2IiOJfQbWryeeaGvwiR4ncW8="; 19 }; 20 21 patches = [ 22 (fetchpatch2 { 23 name = "remove-nose.patch"; 24 excludes = [ "heptapod-ci.yml" ]; 25 url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/8341f2494b3fc1c0d9ee55fa4487c0ac82f64d2a"; 26 hash = "sha256-4gicVCAH94itxHY0l8ek0L/RVhUrw2lMbbnENbWrV6U="; 27 }) 28 (fetchpatch2 { 29 name = "fix-tests.patch"; 30 url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/a2afbf236ca86287e72f54e1248413625d1bc405"; 31 hash = "sha256-T/yKJ8cMMOBVk24SXwyPOoD321S1fZEIunaPJAxI0KI="; 32 }) 33 ]; 34 35 build-system = [ setuptools ]; 36 37 nativeCheckInputs = [ 38 mercurial 39 pytestCheckHook 40 ]; 41 42 preCheck = '' 43 export HGTMP=$(mktemp -d) 44 export HGUSER=test 45 ''; 46 47 pythonImportsCheck = [ "hglib" ]; 48 49 meta = { 50 description = "Library with a fast, convenient interface to Mercurial. It uses Mercurials command server for communication with hg"; 51 homepage = "https://www.mercurial-scm.org/wiki/PythonHglibs"; 52 license = lib.licenses.mit; 53 maintainers = [ ]; 54 }; 55}