lol

python310Packages.pathy: support later smart-open releases

+37 -14
+37 -14
pkgs/development/python-modules/pathy/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 + , dataclasses 3 4 , fetchPypi 5 + , fetchpatch 6 + , google-cloud-storage 7 + , mock 4 8 , pytestCheckHook 9 + , pythonOlder 10 + , smart-open 5 11 , typer 6 - , smart-open 7 - , mock 8 - , google-cloud-storage 9 12 }: 10 13 11 14 buildPythonPackage rec { 12 15 pname = "pathy"; 13 16 version = "0.6.1"; 17 + format = "setuptools"; 18 + 19 + disabled = pythonOlder "3.6"; 14 20 15 21 src = fetchPypi { 16 22 inherit pname version; 17 23 sha256 = "838624441f799a06b446a657e4ecc9ebc3fdd05234397e044a7c87e8f6e76b1c"; 18 24 }; 19 25 20 - propagatedBuildInputs = [ smart-open typer google-cloud-storage ]; 26 + propagatedBuildInputs = [ 27 + smart-open 28 + typer 29 + google-cloud-storage 30 + ] ++ lib.optionals (pythonOlder "3.7") [ 31 + dataclasses 32 + ]; 21 33 22 - postPatch = '' 23 - substituteInPlace requirements.txt \ 24 - --replace "smart-open>=2.2.0,<4.0.0" "smart-open>=2.2.0" 25 - ''; 34 + checkInputs = [ 35 + mock 36 + pytestCheckHook 37 + ]; 38 + 39 + patches = [ 40 + # Support for smart-open >= 6.0.0, https://github.com/justindujardin/pathy/pull/71 41 + (fetchpatch { 42 + name = "support-later-smart-open.patch"; 43 + url = "https://github.com/justindujardin/pathy/commit/ba1c23df6ee5d1e57bdfe845ff6a9315cba3df6a.patch"; 44 + sha256 = "sha256-V1i4tx73Xkdqb/wZhQIv4p6FVpF9SEfDhlBkwaaRE3w="; 45 + }) 46 + ]; 26 47 27 - checkInputs = [ pytestCheckHook mock ]; 48 + disabledTestPaths = [ 49 + # Exclude tests that require provider credentials 50 + "pathy/_tests/test_clients.py" 51 + "pathy/_tests/test_gcs.py" 52 + "pathy/_tests/test_s3.py" 53 + ]; 28 54 29 - # Exclude tests that require provider credentials 30 - pytestFlagsArray = [ 31 - "--ignore=pathy/_tests/test_clients.py" 32 - "--ignore=pathy/_tests/test_gcs.py" 33 - "--ignore=pathy/_tests/test_s3.py" 55 + pythonImportsCheck = [ 56 + "pathy" 34 57 ]; 35 58 36 59 meta = with lib; {