Merge pull request #154280 from fabaff/tests-s3transfer

python3Packages.s3transfer: enable tests
This commit is contained in:
Fabian Affolter 2022-01-11 09:30:24 +01:00 committed by GitHub
commit 23afed2a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 75 deletions

View File

@ -1,52 +1,57 @@
{ lib { lib
, fetchPypi , botocore
, pythonOlder
, buildPythonPackage , buildPythonPackage
, docutils , docutils
, fetchFromGitHub
, mock , mock
, nose , pytestCheckHook
, coverage , pythonOlder
, wheel , wheel
, unittest2
, botocore
, futures ? null
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "s3transfer"; pname = "s3transfer";
version = "0.5.0"; version = "0.5.0";
format = "setuptools";
src = fetchPypi { disabled = pythonOlder "3.6";
inherit pname version;
sha256 = "sha256-UO2CPh3FhorUDI3JIHL3V6oOZToZKEXJSjtnb0pi2kw="; src = fetchFromGitHub {
owner = "boto";
repo = pname;
rev = version;
hash = "sha256-0Dl7oKB2xxq/a8do3HgBUIGay88yOGBUdOGo+QCtnUE=";
}; };
propagatedBuildInputs = propagatedBuildInputs = [
[ botocore
botocore ];
] ++ lib.optional (pythonOlder "3") futures;
buildInputs = [ buildInputs = [
docutils docutils
mock mock
nose pytestCheckHook
coverage
wheel wheel
unittest2
]; ];
checkPhase = '' disabledTestPaths = [
pushd s3transfer/tests # Requires network access
nosetests -v unit/ functional/ "tests/integration/test_copy.py"
popd "tests/integration/test_delete.py"
''; "tests/integration/test_download.py"
"tests/integration/test_processpool.py"
"tests/integration/test_s3transfer.py"
"tests/integration/test_upload.py"
];
# version on pypi has no tests/ dir pythonImportsCheck = [
doCheck = false; "s3transfer"
];
meta = with lib; { meta = with lib; {
description = "Library for managing Amazon S3 transfers";
homepage = "https://github.com/boto/s3transfer"; homepage = "https://github.com/boto/s3transfer";
license = licenses.asl20; license = licenses.asl20;
description = "A library for managing Amazon S3 transfers"; maintainers = with maintainers; [ ];
}; };
} }

View File

@ -6,30 +6,6 @@ let
py = python3.override { py = python3.override {
packageOverrides = self: super: { packageOverrides = self: super: {
boto3 = super.boto3.overridePythonAttrs (oldAttrs: rec {
version = "1.17.112";
src = oldAttrs.src.override {
inherit version;
sha256 = "1byqrffbgpp1mq62gnn3w3hnm54dfar0cwgvmkl7mrgbwz5xmdh8";
};
});
botocore = super.botocore.overridePythonAttrs (oldAttrs: rec {
version = "1.20.112";
src = oldAttrs.src.override {
inherit version;
sha256 = "1ksdjh3mwbzgqgfj58vyrhann23b9gqam8id2svmpdmmdq5vgffh";
};
});
s3transfer = super.s3transfer.overridePythonAttrs (oldAttrs: rec {
version = "0.4.2";
src = oldAttrs.src.override {
inherit version;
sha256 = "1cp169vz9rvng7dwbn33fgdbl3b014zpsdqsnfxxw7jm2r5jy0nb";
};
});
dpath = super.dpath.overridePythonAttrs (oldAttrs: rec { dpath = super.dpath.overridePythonAttrs (oldAttrs: rec {
version = "1.5.0"; version = "1.5.0";
src = oldAttrs.src.override { src = oldAttrs.src.override {
@ -52,7 +28,7 @@ buildPythonApplication rec {
owner = "bridgecrewio"; owner = "bridgecrewio";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "sha256-qnRYxbw42vN0w+x1ARRz60e8q9LCPWglprOBm7rkxsE="; hash = "sha256-qnRYxbw42vN0w+x1ARRz60e8q9LCPWglprOBm7rkxsE=";
}; };
nativeBuildInputs = with py.pkgs; [ nativeBuildInputs = with py.pkgs; [

View File

@ -1,4 +1,9 @@
{ lib, python3, groff, less, fetchFromGitHub }: { lib
, python3
, groff
, less
, fetchFromGitHub
}:
let let
py = python3.override { py = python3.override {
packageOverrides = self: super: { packageOverrides = self: super: {
@ -10,7 +15,9 @@ let
sha256 = "sha256:1cmfkcv2zzirxsb989vx1hvna9nv24pghcvypl0zaxsjphv97mka"; sha256 = "sha256:1cmfkcv2zzirxsb989vx1hvna9nv24pghcvypl0zaxsjphv97mka";
}; };
}); });
botocore = super.botocore.overridePythonAttrs (oldAttrs: rec { botocore = super.botocore.overridePythonAttrs (oldAttrs: rec {
# Releases: https://github.com/boto/botocore/commits/v2
version = "2.0.0dev155"; version = "2.0.0dev155";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "boto"; owner = "boto";
@ -20,6 +27,7 @@ let
}; };
propagatedBuildInputs = super.botocore.propagatedBuildInputs ++ [py.pkgs.awscrt]; propagatedBuildInputs = super.botocore.propagatedBuildInputs ++ [py.pkgs.awscrt];
}); });
prompt-toolkit = super.prompt-toolkit.overridePythonAttrs (oldAttrs: rec { prompt-toolkit = super.prompt-toolkit.overridePythonAttrs (oldAttrs: rec {
version = "2.0.10"; version = "2.0.10";
src = oldAttrs.src.override { src = oldAttrs.src.override {
@ -27,41 +35,21 @@ let
sha256 = "1nr990i4b04rnlw1ghd0xmgvvvhih698mb6lb6jylr76cs7zcnpi"; sha256 = "1nr990i4b04rnlw1ghd0xmgvvvhih698mb6lb6jylr76cs7zcnpi";
}; };
}); });
s3transfer = super.s3transfer.overridePythonAttrs (oldAttrs: rec {
version = "0.4.2";
src = oldAttrs.src.override {
inherit version;
sha256 = "sha256-ywIvSxZVHt67sxo3fT8JYA262nNj2MXbeXbn9Hcy4bI=";
};
});
}; };
}; };
in in
with py.pkgs; buildPythonApplication rec { with py.pkgs; buildPythonApplication rec {
pname = "awscli2"; pname = "awscli2";
version = "2.3.4"; # N.B: if you change this, change botocore to a matching version too version = "2.4.9"; # N.B: if you change this, change botocore to a matching version too
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "aws"; owner = "aws";
repo = "aws-cli"; repo = "aws-cli";
rev = version; rev = version;
sha256 = "sha256-C/NrU+1AixuN4T1N5Zs8xduUQiwuQWvXkitQRnPJdNw="; sha256 = "sha256-ihmbw+gS7zZz/nebrmpEr9MR+dVabc70DBPPSrm3eeE=";
}; };
postPatch = ''
substituteInPlace setup.cfg \
--replace "colorama>=0.2.5,<0.4.4" "colorama" \
--replace "cryptography>=3.3.2,<3.4.0" "cryptography" \
--replace "docutils>=0.10,<0.16" "docutils" \
--replace "ruamel.yaml>=0.15.0,<0.16.0" "ruamel.yaml" \
--replace "s3transfer>=0.4.2,<0.5.0" "s3transfer" \
--replace "wcwidth<0.2.0" "wcwidth" \
--replace "distro>=1.5.0,<1.6.0" "distro"
'';
checkInputs = [ jsonschema mock pytestCheckHook pytest-xdist ];
propagatedBuildInputs = [ propagatedBuildInputs = [
awscrt awscrt
bcdoc bcdoc
@ -76,11 +64,26 @@ with py.pkgs; buildPythonApplication rec {
pyyaml pyyaml
rsa rsa
ruamel-yaml ruamel-yaml
s3transfer
six
wcwidth wcwidth
]; ];
checkInputs = [
jsonschema
mock
pytestCheckHook
pytest-xdist
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "colorama>=0.2.5,<0.4.4" "colorama" \
--replace "cryptography>=3.3.2,<3.4.0" "cryptography" \
--replace "docutils>=0.10,<0.16" "docutils" \
--replace "ruamel.yaml>=0.15.0,<0.16.0" "ruamel.yaml" \
--replace "wcwidth<0.2.0" "wcwidth" \
--replace "distro>=1.5.0,<1.6.0" "distro"
'';
checkPhase = '' checkPhase = ''
export PATH=$PATH:$out/bin export PATH=$PATH:$out/bin