1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 pytestCheckHook,
7}:
8
9buildPythonPackage rec {
10 pname = "more-properties";
11 version = "1.1.1";
12
13 # upstream requires >= 3.6 but only 3.7 includes dataclasses
14 disabled = pythonOlder "3.7";
15
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "madman-bob";
20 repo = "python-more-properties";
21 rev = version;
22 hash = "sha256-dKG97rw5IG19m7u3ZDBM2yGScL5cFaKBvGZxPVJaUTE=";
23 };
24
25 postPatch = ''
26 mv pypi_upload/setup.py .
27 substituteInPlace setup.py \
28 --replace "project_root = Path(__file__).parents[1]" "project_root = Path(__file__).parents[0]"
29
30 # dataclasses is included in Python 3.7
31 substituteInPlace requirements.txt \
32 --replace dataclasses ""
33 '';
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 pythonImportsCheck = [ "more_properties" ];
38
39 meta = {
40 description = "A collection of property variants";
41 homepage = "https://github.com/madman-bob/python-more-properties";
42 license = lib.licenses.mit;
43 maintainers = with lib.maintainers; [ dotlambda ];
44 };
45}