2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchpatch,
|
|
|
|
fetchPypi,
|
|
|
|
parameterized,
|
|
|
|
pytestCheckHook,
|
|
|
|
pynose,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2023-02-02 18:25:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pprintpp";
|
|
|
|
version = "0.4.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-6oJhCOLH9J3G1mx1KXPD/JdJFCp5jWslTh4wHP28ZAM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2023-02-02 18:25:31 +00:00
|
|
|
# Replace nose-parameterized with parameterized, https://github.com/wolever/pprintpp/pull/21
|
2020-04-24 23:36:52 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/wolever/pprintpp/commit/873217674cc824b4c1cfdad4867c560c60e8d806.patch";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-Y+2yVUkDHkwo49ynNHYXVXJpX4DfVYJ0CWKgzFX/HWc=";
|
|
|
|
})
|
|
|
|
# Remove "U" move from open(), https://github.com/wolever/pprintpp/pull/31
|
|
|
|
(fetchpatch {
|
|
|
|
name = "remove-u.patch";
|
|
|
|
url = "https://github.com/wolever/pprintpp/commit/deec5e5efad562fc2f9084abfe249ed0c7dd65fa.patch";
|
|
|
|
hash = "sha256-I84pnY/KyCIPPI9q0uvj64t8oPeMkgVTPEBRANkZNa4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
parameterized
|
2024-04-21 15:54:59 +00:00
|
|
|
pynose
|
|
|
|
pytestCheckHook
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "pprintpp" ];
|
|
|
|
|
|
|
|
pytestFlagsArray = [ "test.py" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTests = [
|
|
|
|
# AttributeError: 'EncodedFile' object has no attribute 'getvalue'
|
|
|
|
"test_pp"
|
|
|
|
"test_pp_pprint"
|
|
|
|
"test_fmt"
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A drop-in replacement for pprint that's actually pretty";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://github.com/wolever/pprintpp";
|
|
|
|
changelog = "https://github.com/wolever/pprintpp/blob/${version}/CHANGELOG.txt";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ jakewaksbaum ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pypprint";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|