1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, pythonOlder
5, flit-core
6, py-cid
7, pytestCheckHook
8, pytest-cov
9}:
10
11buildPythonPackage rec {
12 pname = "pytest-cid";
13 version = "1.1.2";
14 format = "pyproject";
15 disabled = pythonOlder "3.5";
16
17 src = fetchFromGitHub {
18 owner = "ntninja";
19 repo = pname;
20 rev = "refs/tags/v${version}";
21 hash = "sha256-dcL/i5+scmdXh7lfE8+32w9PdHWf+mkunJL1vpJ5+Co=";
22 };
23
24 postPatch = ''
25 substituteInPlace pyproject.toml \
26 --replace "pytest >= 5.0, < 7.0" "pytest >= 5.0"
27 '';
28
29 nativeBuildInputs = [
30 flit-core
31 ];
32
33 propagatedBuildInputs = [
34 py-cid
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 pytest-cov
40 ];
41
42 pythonImportsCheck = [ "pytest_cid" ];
43
44 meta = with lib; {
45 homepage = "https://github.com/ntninja/pytest-cid";
46 description = "A simple wrapper around py-cid for easily writing tests involving CIDs in datastructures";
47 license = licenses.mpl20;
48 maintainers = with maintainers; [ Luflosi ];
49 };
50}