1{ lib
2, buildPythonPackage
3, fetchPypi
4, pytestCheckHook
5, typer
6, dataclasses
7, smart-open
8, pytest
9, mock
10, google-cloud-storage
11}:
12
13buildPythonPackage rec {
14 pname = "pathy";
15 version = "0.5.2";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "sha256-nb8my/5rkc7thuHnXZHe1Hg8j+sLBlYyJcLHWrrKZ5M=";
20 };
21
22 propagatedBuildInputs = [ smart-open typer google-cloud-storage ];
23
24 postPatch = ''
25 substituteInPlace requirements.txt \
26 --replace "smart-open>=2.2.0,<4.0.0" "smart-open>=2.2.0"
27 '';
28
29 checkInputs = [ pytestCheckHook mock ];
30
31 # Exclude tests that require provider credentials
32 pytestFlagsArray = [
33 "--ignore=pathy/_tests/test_clients.py"
34 "--ignore=pathy/_tests/test_gcs.py"
35 "--ignore=pathy/_tests/test_s3.py"
36 ];
37
38 meta = with lib; {
39 description = "A Path interface for local and cloud bucket storage";
40 homepage = "https://github.com/justindujardin/pathy";
41 license = licenses.asl20;
42 maintainers = with maintainers; [ melling ];
43 };
44}