summary refs log tree commit diff
path: root/pkgs/development/python-modules/pathy/default.nix
blob: d656a752cf5509b6ab9a44f711118bf6dc7f3f3f (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
38
39
40
41
42
43
44
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, typer
, dataclasses
, smart-open
, pytest
, mock
, google-cloud-storage
}:

buildPythonPackage rec {
  pname = "pathy";
  version = "0.5.2";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-nb8my/5rkc7thuHnXZHe1Hg8j+sLBlYyJcLHWrrKZ5M=";
  };

  propagatedBuildInputs = [ smart-open typer google-cloud-storage ];

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "smart-open>=2.2.0,<4.0.0" "smart-open>=2.2.0"
  '';

  checkInputs = [ pytestCheckHook mock ];

  # Exclude tests that require provider credentials
  pytestFlagsArray = [
    "--ignore=pathy/_tests/test_clients.py"
    "--ignore=pathy/_tests/test_gcs.py"
    "--ignore=pathy/_tests/test_s3.py"
  ];

  meta = with lib; {
    description = "A Path interface for local and cloud bucket storage";
    homepage = "https://github.com/justindujardin/pathy";
    license = licenses.asl20;
    maintainers = with maintainers; [ melling ];
  };
}