1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonAtLeast,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "ndeflib";
13 version = "0.3.3";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "nfcpy";
20 repo = "ndeflib";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-cpfztE+/AW7P0J7QeTDfVGYc2gEkr7gzA352hC9bdTM=";
23 };
24
25 nativeBuildInputs = [ setuptools ];
26
27 nativeCheckInputs = [ pytestCheckHook ];
28
29 pythonImportsCheck = [ "ndef" ];
30
31 disabledTests = [
32 # AssertionError caused due to wrong size
33 "test_decode_error"
34 ] ++ lib.optionals (pythonAtLeast "3.12") [ "test_encode_error" ];
35
36 meta = with lib; {
37 description = "Python package for parsing and generating NFC Data Exchange Format messages";
38 homepage = "https://github.com/nfcpy/ndeflib";
39 changelog = "https://github.com/nfcpy/ndeflib/releases/tag/v${version}";
40 license = licenses.isc;
41 maintainers = with maintainers; [ fab ];
42 };
43}