1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, msgpack
5, numpy
6, pandas
7, pydantic
8, pymongo
9, pytestCheckHook
10, pythonOlder
11, ruamel-yaml
12, torch
13, tqdm
14}:
15
16buildPythonPackage rec {
17 pname = "monty";
18 version = "2023.9.5";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "materialsvirtuallab";
25 repo = pname;
26 rev = "refs/tags/v${version}";
27 hash = "sha256-VzOu0gLQcobWQs8uMFzI4CyN+1OVx94VqhJYB+rMpMI=";
28 };
29
30 postPatch = ''
31 substituteInPlace tests/test_os.py \
32 --replace 'self.assertEqual("/usr/bin/find", which("/usr/bin/find"))' '#'
33 '';
34
35 propagatedBuildInputs = [
36 msgpack
37 ruamel-yaml
38 tqdm
39 ];
40
41 nativeCheckInputs = [
42 numpy
43 pandas
44 pydantic
45 pymongo
46 pytestCheckHook
47 torch
48 ];
49
50 pythonImportsCheck = [
51 "monty"
52 ];
53
54 disabledTests = [
55 # Test file was removed and re-added after 2022.9.9
56 "test_reverse_readfile_gz"
57 "test_Path_objects"
58 "test_zopen"
59 "test_zpath"
60 ];
61
62 meta = with lib; {
63 description = "Serves as a complement to the Python standard library by providing a suite of tools to solve many common problems";
64 longDescription = "
65 Monty implements supplementary useful functions for Python that are not part of the
66 standard library. Examples include useful utilities like transparent support for zipped files, useful design
67 patterns such as singleton and cached_class, and many more.
68 ";
69 homepage = "https://github.com/materialsvirtuallab/monty";
70 changelog = "https://github.com/materialsvirtuallab/monty/releases/tag/v${version}";
71 license = licenses.mit;
72 maintainers = with maintainers; [ psyanticy ];
73 };
74}