python310Packages.pathy: support later smart-open releases

This commit is contained in:
Fabian Affolter 2022-04-30 23:53:51 +02:00
parent ce38d2669c
commit e3f55d56f5

View File

@ -1,36 +1,59 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, dataclasses
, fetchPypi , fetchPypi
, pytestCheckHook , fetchpatch
, typer
, smart-open
, mock
, google-cloud-storage , google-cloud-storage
, mock
, pytestCheckHook
, pythonOlder
, smart-open
, typer
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pathy"; pname = "pathy";
version = "0.6.1"; version = "0.6.1";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "838624441f799a06b446a657e4ecc9ebc3fdd05234397e044a7c87e8f6e76b1c"; sha256 = "838624441f799a06b446a657e4ecc9ebc3fdd05234397e044a7c87e8f6e76b1c";
}; };
propagatedBuildInputs = [ smart-open typer google-cloud-storage ]; propagatedBuildInputs = [
smart-open
typer
google-cloud-storage
] ++ lib.optionals (pythonOlder "3.7") [
dataclasses
];
postPatch = '' checkInputs = [
substituteInPlace requirements.txt \ mock
--replace "smart-open>=2.2.0,<4.0.0" "smart-open>=2.2.0" pytestCheckHook
''; ];
checkInputs = [ pytestCheckHook mock ]; patches = [
# Support for smart-open >= 6.0.0, https://github.com/justindujardin/pathy/pull/71
(fetchpatch {
name = "support-later-smart-open.patch";
url = "https://github.com/justindujardin/pathy/commit/ba1c23df6ee5d1e57bdfe845ff6a9315cba3df6a.patch";
sha256 = "sha256-V1i4tx73Xkdqb/wZhQIv4p6FVpF9SEfDhlBkwaaRE3w=";
})
];
# Exclude tests that require provider credentials disabledTestPaths = [
pytestFlagsArray = [ # Exclude tests that require provider credentials
"--ignore=pathy/_tests/test_clients.py" "pathy/_tests/test_clients.py"
"--ignore=pathy/_tests/test_gcs.py" "pathy/_tests/test_gcs.py"
"--ignore=pathy/_tests/test_s3.py" "pathy/_tests/test_s3.py"
];
pythonImportsCheck = [
"pathy"
]; ];
meta = with lib; { meta = with lib; {