Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, google-cloud-storage
6, mock
7, pytestCheckHook
8, pythonOlder
9, smart-open
10, typer
11}:
12
13buildPythonPackage rec {
14 pname = "pathy";
15 version = "0.6.1";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "838624441f799a06b446a657e4ecc9ebc3fdd05234397e044a7c87e8f6e76b1c";
23 };
24
25 propagatedBuildInputs = [
26 smart-open
27 typer
28 google-cloud-storage
29 ];
30
31 checkInputs = [
32 mock
33 pytestCheckHook
34 ];
35
36 patches = [
37 # Support for smart-open >= 6.0.0, https://github.com/justindujardin/pathy/pull/71
38 (fetchpatch {
39 name = "support-later-smart-open.patch";
40 url = "https://github.com/justindujardin/pathy/commit/ba1c23df6ee5d1e57bdfe845ff6a9315cba3df6a.patch";
41 sha256 = "sha256-V1i4tx73Xkdqb/wZhQIv4p6FVpF9SEfDhlBkwaaRE3w=";
42 })
43 ];
44
45 disabledTestPaths = [
46 # Exclude tests that require provider credentials
47 "pathy/_tests/test_clients.py"
48 "pathy/_tests/test_gcs.py"
49 "pathy/_tests/test_s3.py"
50 ];
51
52 pythonImportsCheck = [
53 "pathy"
54 ];
55
56 meta = with lib; {
57 description = "A Path interface for local and cloud bucket storage";
58 homepage = "https://github.com/justindujardin/pathy";
59 license = licenses.asl20;
60 maintainers = with maintainers; [ melling ];
61 };
62}