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

View File

@ -6,30 +6,6 @@ let
py = python3.override {
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 {
version = "1.5.0";
src = oldAttrs.src.override {
@ -52,7 +28,7 @@ buildPythonApplication rec {
owner = "bridgecrewio";
repo = pname;
rev = version;
sha256 = "sha256-qnRYxbw42vN0w+x1ARRz60e8q9LCPWglprOBm7rkxsE=";
hash = "sha256-qnRYxbw42vN0w+x1ARRz60e8q9LCPWglprOBm7rkxsE=";
};
nativeBuildInputs = with py.pkgs; [

View File

@ -1,4 +1,9 @@
{ lib, python3, groff, less, fetchFromGitHub }:
{ lib
, python3
, groff
, less
, fetchFromGitHub
}:
let
py = python3.override {
packageOverrides = self: super: {
@ -10,7 +15,9 @@ let
sha256 = "sha256:1cmfkcv2zzirxsb989vx1hvna9nv24pghcvypl0zaxsjphv97mka";
};
});
botocore = super.botocore.overridePythonAttrs (oldAttrs: rec {
# Releases: https://github.com/boto/botocore/commits/v2
version = "2.0.0dev155";
src = fetchFromGitHub {
owner = "boto";
@ -20,6 +27,7 @@ let
};
propagatedBuildInputs = super.botocore.propagatedBuildInputs ++ [py.pkgs.awscrt];
});
prompt-toolkit = super.prompt-toolkit.overridePythonAttrs (oldAttrs: rec {
version = "2.0.10";
src = oldAttrs.src.override {
@ -27,41 +35,21 @@ let
sha256 = "1nr990i4b04rnlw1ghd0xmgvvvhih698mb6lb6jylr76cs7zcnpi";
};
});
s3transfer = super.s3transfer.overridePythonAttrs (oldAttrs: rec {
version = "0.4.2";
src = oldAttrs.src.override {
inherit version;
sha256 = "sha256-ywIvSxZVHt67sxo3fT8JYA262nNj2MXbeXbn9Hcy4bI=";
};
});
};
};
in
with py.pkgs; buildPythonApplication rec {
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 {
owner = "aws";
repo = "aws-cli";
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 = [
awscrt
bcdoc
@ -76,11 +64,26 @@ with py.pkgs; buildPythonApplication rec {
pyyaml
rsa
ruamel-yaml
s3transfer
six
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 = ''
export PATH=$PATH:$out/bin