2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, click
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, pytestCheckHook
|
2023-05-24 13:37:59 +00:00
|
|
|
, pythonAtLeast
|
2022-04-27 09:35:20 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, six
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "xdis";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "6.0.5";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# No support for Python 3.11, https://github.com/rocky/python-xdis/issues/98
|
|
|
|
disabled = pythonOlder "3.6" || pythonAtLeast "3.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rocky";
|
|
|
|
repo = "python-xdis";
|
2022-12-28 21:21:41 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-3mL0EuPHF/dithovrYvMjweYGwGhrN75N9MRfLjNC34=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Our Python release is not in the test matrix
|
|
|
|
substituteInPlace xdis/magics.py \
|
2023-05-24 13:37:59 +00:00
|
|
|
--replace "3.10.4" "3.10.5 3.10.6 3.10.7 3.10.8 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14"
|
2022-08-21 13:32:41 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"xdis"
|
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
# import file mismatch:
|
|
|
|
# imported module 'test_disasm' has this __file__ attribute:
|
|
|
|
# /build/source/pytest/test_disasm.py
|
|
|
|
# which is not the same as the test file we want to collect:
|
|
|
|
# /build/source/test_unit/test_disasm.py
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"test_unit/test_disasm.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTests = [
|
2022-08-21 13:32:41 +00:00
|
|
|
# AssertionError: events did not match expectation
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_big_linenos"
|
2022-08-21 13:32:41 +00:00
|
|
|
# AssertionError: False is not true : PYTHON VERSION 4.0 is not in magic.magics.keys
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_basic"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python cross-version byte-code disassembler and marshal routines";
|
2022-06-26 10:26:21 +00:00
|
|
|
homepage = "https://github.com/rocky/python-xdis";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/rocky/python-xdis/releases/tag/${version}";
|
2021-03-20 04:20:00 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2022-08-21 13:32:41 +00:00
|
|
|
maintainers = with maintainers; [ onny ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|