2021-03-20 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, pytestCheckHook
|
2022-01-13 20:06:32 +00:00
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
2021-03-20 04:20:00 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "boltons";
|
2021-03-20 04:20:00 +00:00
|
|
|
version = "20.2.1";
|
2022-01-13 20:06:32 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mahmoud";
|
|
|
|
repo = "boltons";
|
|
|
|
rev = version;
|
2022-01-13 20:06:32 +00:00
|
|
|
hash = "sha256-iCueZsi/gVbko7MW43vaUQMWRVI/YhmdfN29gD6AgG8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# pprint has no attribute _safe_repr, https://github.com/mahmoud/boltons/issues/294
|
2021-03-20 04:20:00 +00:00
|
|
|
(fetchpatch {
|
2022-01-13 20:06:32 +00:00
|
|
|
name = "fix-pprint-attribute.patch";
|
|
|
|
url = "https://github.com/mahmoud/boltons/commit/270e974975984f662f998c8f6eb0ebebd964de82.patch";
|
|
|
|
sha256 = "sha256-pZLfr6SRCw2aLwZeYaX7bzfJeZC4cFUILEmnVsKR6zc=";
|
2021-03-20 04:20:00 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-01-13 20:06:32 +00:00
|
|
|
# This test is broken without this PR. Merged but not released
|
2021-03-20 04:20:00 +00:00
|
|
|
# https://github.com/mahmoud/boltons/pull/283
|
2022-01-13 20:06:32 +00:00
|
|
|
"test_frozendict"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"boltons"
|
2021-03-20 04:20:00 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/mahmoud/boltons";
|
2022-01-13 20:06:32 +00:00
|
|
|
description = "Constructs, recipes, and snippets extending the Python standard library";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
2022-01-13 20:06:32 +00:00
|
|
|
Boltons is a set of over 200 BSD-licensed, pure-Python utilities
|
|
|
|
in the same spirit as - and yet conspicuously missing from - the
|
2020-04-24 23:36:52 +00:00
|
|
|
standard library, including:
|
|
|
|
|
|
|
|
- Atomic file saving, bolted on with fileutils
|
|
|
|
- A highly-optimized OrderedMultiDict, in dictutils
|
|
|
|
- Two types of PriorityQueue, in queueutils
|
|
|
|
- Chunked and windowed iteration, in iterutils
|
|
|
|
- Recursive data structure iteration and merging, with iterutils.remap
|
|
|
|
- Exponential backoff functionality, including jitter, through
|
|
|
|
iterutils.backoff
|
|
|
|
- A full-featured TracebackInfo type, for representing stack
|
|
|
|
traces, in tbutils
|
|
|
|
'';
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ twey ];
|
|
|
|
};
|
|
|
|
}
|