summary refs log tree commit diff
path: root/pkgs/development/python-modules/monty/default.nix
blob: f3a564397b5f1e38f56d1c3541ac710aea352122 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, buildPythonPackage, fetchFromGitHub, nose, numpy, six, ruamel_yaml, msgpack-python, coverage, coveralls, pymongo, lsof }:

buildPythonPackage rec {
  pname = "monty";
  version = "1.0.2";

  # No tests in Pypi
  src = fetchFromGitHub {
    owner = "materialsvirtuallab";
    repo = pname;
    rev = "v${version}";
    sha256 = "0ss70fanavqdpj56yymj06lacgnknb4ap39m2q28v9lz32cs6xdg";
  };

  propagatedBuildInputs = [ nose numpy six ruamel_yaml msgpack-python coverage coveralls pymongo lsof ];
  
  preCheck = ''
    substituteInPlace tests/test_os.py \
      --replace 'def test_which(self):' '#' \
      --replace 'py = which("python")' '#' \
      --replace 'self.assertEqual(os.path.basename(py), "python")' '#' \
      --replace 'self.assertEqual("/usr/bin/find", which("/usr/bin/find"))' '#' \
      --replace 'self.assertIs(which("non_existent_exe"), None)' '#' \
  '';

  meta = with stdenv.lib; {
    longDescription = "
      Monty implements supplementary useful functions for Python that are not part of the 
      standard library. Examples include useful utilities like transparent support for zipped files, useful design 
      patterns such as singleton and cached_class, and many more.
    ";
    homepage = https://github.com/materialsvirtuallab/monty;
    license = licenses.mit;
    maintainers = with maintainers; [ psyanticy ];
  };
}