1{
2 lib,
3 buildPythonPackage,
4 click,
5 fetchFromGitHub,
6 pytestCheckHook,
7 pythonOlder,
8 setuptools,
9 six,
10}:
11
12buildPythonPackage rec {
13 pname = "xdis";
14 version = "6.1.6";
15 pyproject = true;
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "rocky";
21 repo = "python-xdis";
22 tag = version;
23 hash = "sha256-G4BpvMYjBUBfStP1csfFaFCin0eYEnXwsztCS4amvdY=";
24 };
25
26 build-system = [
27 setuptools
28 ];
29
30 dependencies = [
31 click
32 six
33 ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 pythonImportsCheck = [ "xdis" ];
38
39 disabledTestPaths = [
40 # import file mismatch:
41 # imported module 'test_disasm' has this __file__ attribute:
42 # /build/source/pytest/test_disasm.py
43 # which is not the same as the test file we want to collect:
44 # /build/source/test_unit/test_disasm.py
45 "test_unit/test_disasm.py"
46
47 # Doesn't run on non-2.7 but has global-level mis-import
48 "test_unit/test_dis27.py"
49
50 # Has Python 2 style prints
51 "test/decompyle/test_nested_scopes.py"
52 ];
53
54 disabledTests = [
55 # AssertionError: events did not match expectation
56 "test_big_linenos"
57 # AssertionError: False is not true : PYTHON VERSION 4.0 is not in magic.magics.keys
58 "test_basic"
59 ];
60
61 meta = {
62 description = "Python cross-version byte-code disassembler and marshal routines";
63 homepage = "https://github.com/rocky/python-xdis";
64 changelog = "https://github.com/rocky/python-xdis/releases/tag/${src.tag}";
65 license = lib.licenses.gpl2Plus;
66 maintainers = with lib.maintainers; [
67 onny
68 melvyn2
69 ];
70 };
71}