1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 spark-parser,
7 xdis,
8 nose,
9 pytest,
10 hypothesis,
11 six,
12}:
13
14buildPythonPackage rec {
15 pname = "uncompyle6";
16 version = "3.9.1";
17 format = "setuptools";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-xFHDjrPFzINOuLip5uCwzzIm5NlNCP0nbdA/6RWO2yc=";
22 };
23
24 propagatedBuildInputs = [
25 spark-parser
26 xdis
27 ];
28
29 nativeCheckInputs = [
30 nose
31 pytest
32 hypothesis
33 six
34 ];
35
36 # Tests attempt to decompile bytecode of the python version
37 # that is running the tests - this does not work for versions
38 # above 3.8, but they decompile older bytecode fine
39 doCheck = pythonOlder "3.9";
40 # six import errors (yet it is supplied...)
41 checkPhase = ''
42 runHook preCheck
43 pytest ./pytest --ignore=pytest/test_function_call.py
44 runHook postCheck
45 '';
46
47 meta = with lib; {
48 description = "Python cross-version byte-code deparser";
49 homepage = "https://github.com/rocky/python-uncompyle6/";
50 license = licenses.gpl3;
51 };
52}