1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 libusb1,
6 mock,
7 ndeflib,
8 pydes,
9 pyserial,
10 pytest-mock,
11 pytestCheckHook,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "nfcpy";
17 version = "1.0.4";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "nfcpy";
24 repo = "nfcpy";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-HFWOCiz6ISfxEeC6KPKNKGZoHvFjFGUn7QJWnwvJKYw=";
27 };
28
29 propagatedBuildInputs = [
30 libusb1
31 ndeflib
32 pydes
33 pyserial
34 ];
35
36 nativeCheckInputs = [
37 mock
38 pytest-mock
39 pytestCheckHook
40 ];
41
42 pythonImportsCheck = [ "nfc" ];
43
44 disabledTestPaths = [
45 # AttributeError: 'NoneType' object has no attribute 'EC_KEY'
46 "tests/test_llcp_llc.py"
47 "tests/test_llcp_sec.py"
48 # Doesn't work on Hydra
49 "tests/test_clf_udp.py"
50 ];
51
52 meta = with lib; {
53 description = "A Python module to read/write NFC tags or communicate with another NFC device";
54 homepage = "https://github.com/nfcpy/nfcpy";
55 changelog = "https://github.com/nfcpy/nfcpy/blob/v${version}/HISTORY.rst";
56 license = licenses.eupl11;
57 maintainers = with maintainers; [ fab ];
58 };
59}