1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 psutil,
11 six,
12
13 # tests
14 mock,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "pylink-square";
20 version = "1.6.0";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "square";
25 repo = "pylink";
26 tag = "v${version}";
27 hash = "sha256-rkkdnpkl9UHcBDjp6lsFXR1zNn7tH1KeTQ7wV+yJ3m0=";
28 };
29
30 patches = [
31 # ERROR: /build/source/setup.cfg:16: unexpected value continuation
32 ./fix-setup-cfg-syntax.patch
33 ];
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 psutil
39 six
40 ];
41
42 nativeCheckInputs = [
43 mock
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "pylink" ];
48
49 disabledTests = [
50 # AttributeError: 'called_once_with' is not a valid assertion
51 "test_cp15_register_write_success"
52 "test_jlink_restarted"
53 "test_set_log_file_success"
54 ];
55
56 meta = {
57 description = "Python interface for the SEGGER J-Link";
58 homepage = "https://github.com/square/pylink";
59 changelog = "https://github.com/square/pylink/blob/${src.tag}/CHANGELOG.md";
60 license = lib.licenses.asl20;
61 maintainers = with lib.maintainers; [ dump_stack ];
62 };
63}