1{ lib
2, buildPythonPackage
3, callPackage
4, fetchPypi
5, pytestCheckHook
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "pycategories";
11 version = "1.2.0";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-vXDstelOdlnlZOoVPwx2cykdw3xSbCRoAPwI1sU3gJk=";
19 };
20
21 postPatch = ''
22 substituteInPlace setup.py \
23 --replace "'pytest-runner'," ""
24 substituteInPlace setup.cfg \
25 --replace "--cov-report term --cov=categories" ""
26 '';
27
28 # Is private because the author states it's unmaintained
29 # and shouldn't be used in production code
30 propagatedBuildInputs = [ (callPackage ./infix.nix { }) ];
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 ];
35
36 meta = with lib; {
37 description = "Implementation of some concepts from category theory";
38 homepage = "https://gitlab.com/danielhones/pycategories";
39 changelog = "https://gitlab.com/danielhones/pycategories/-/blob/v${version}/CHANGELOG.rst";
40 license = licenses.mit;
41 maintainers = with maintainers; [ dmvianna ];
42 };
43}