nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pysnmplib
5, pytest-asyncio
6, pytest-error-for-skips
7, pytestCheckHook
8, pythonOlder
9}:
10
11buildPythonPackage rec {
12 pname = "brother";
13 version = "1.2.0";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.8";
17
18 src = fetchFromGitHub {
19 owner = "bieniu";
20 repo = pname;
21 rev = version;
22 hash = "sha256-hKOZ5pTDwhM0lOXoatXXVvEVxiTfxIpBRe3fFcUfzwE=";
23 };
24
25 propagatedBuildInputs = [
26 pysnmplib
27 ];
28
29 checkInputs = [
30 pytest-asyncio
31 pytest-error-for-skips
32 pytestCheckHook
33 ];
34
35 postPatch = ''
36 substituteInPlace setup.cfg \
37 --replace "--cov --cov-report term-missing " ""
38 substituteInPlace setup.py \
39 --replace '"pytest-runner"' ""
40 '';
41
42 pythonImportsCheck = [
43 "brother"
44 ];
45
46 meta = with lib; {
47 description = "Python wrapper for getting data from Brother laser and inkjet printers via SNMP";
48 homepage = "https://github.com/bieniu/brother";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ hexa ];
51 };
52}