1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytest-runner
5, pytestCheckHook
6, pythonOlder
7, morphys
8, six
9, varint
10}:
11
12buildPythonPackage rec {
13 pname = "py-multicodec";
14 version = "0.2.1";
15 disabled = pythonOlder "3.5";
16
17 src = fetchFromGitHub {
18 owner = "multiformats";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "sha256-2aK+bfhqCMqSO+mtrHIfNQmQpQHpwd7yHseI/3O7Sp4=";
22 };
23
24 # Error when not substituting:
25 # Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.
26 postPatch = ''
27 substituteInPlace setup.cfg --replace "[pytest]" "[tool:pytest]"
28 '';
29
30 nativeBuildInputs = [
31 pytest-runner
32 ];
33
34 propagatedBuildInputs = [
35 varint
36 six
37 morphys
38 ];
39
40 checkInputs = [
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [ "multicodec" ];
45
46 meta = with lib; {
47 description = "Compact self-describing codecs";
48 homepage = "https://github.com/multiformats/py-multicodec";
49 license = licenses.mit;
50 maintainers = with maintainers; [ Luflosi ];
51 };
52}