1{ lib, buildPythonPackage, fetchPypi
2, fetchpatch
3, packaging
4, python
5, pythonAtLeast
6, pythonOlder
7, unittest2
8, unittestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "deprecation";
13 version = "2.1.0";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "1zqqjlgmhgkpzg9ss5ki8wamxl83xn51fs6gn2a8cxsx9vkbvcvj";
18 };
19
20 patches = lib.optionals (pythonAtLeast "3.10") [
21 # fixes for python 3.10 test suite
22 (fetchpatch {
23 url = "https://github.com/briancurtin/deprecation/pull/57/commits/e13e23068cb8d653a02a434a159e8b0b7226ffd6.patch";
24 sha256 = "sha256-/5zr2V1s5ULUZnbLXsgyHxZH4m7/a27QYuqQt2Savc8=";
25 includes = [ "tests/test_deprecation.py" ];
26 })
27 ];
28
29 propagatedBuildInputs = [ packaging ];
30
31 # avoiding mass rebuilds for python3.9, but no longer
32 # needed with patch
33 checkInputs = [ unittestCheckHook ] ++ lib.optionals (pythonOlder "3.10") [
34 unittest2
35 ];
36
37 meta = with lib; {
38 description = "A library to handle automated deprecations";
39 homepage = "https://deprecation.readthedocs.io/";
40 license = licenses.asl20;
41 };
42}