1{ 2 lib, 3 stdenv, 4 botocore, 5 buildPythonPackage, 6 fetchFromGitHub, 7 pytestCheckHook, 8 pythonOlder, 9 setuptools, 10}: 11 12buildPythonPackage rec { 13 pname = "s3transfer"; 14 version = "0.11.2"; 15 pyproject = true; 16 17 disabled = pythonOlder "3.8"; 18 19 src = fetchFromGitHub { 20 owner = "boto"; 21 repo = "s3transfer"; 22 tag = version; 23 hash = "sha256-59uyCgormgRX1JnOUtZv6wRXQiy5CvM/2sSzSC3h1Rc="; 24 }; 25 26 build-system = [ 27 setuptools 28 ]; 29 30 dependencies = [ 31 botocore 32 ]; 33 34 nativeCheckInputs = [ 35 pytestCheckHook 36 ]; 37 38 disabledTestPaths = 39 [ 40 # Requires network access 41 "tests/integration" 42 ] 43 ++ 44 # There was a change in python 3.8 that defaults multiprocessing to spawn instead of fork on macOS 45 # See https://bugs.python.org/issue33725 and https://github.com/python/cpython/pull/13603. 46 # I suspect the underlying issue here is that upstream tests aren't compatible with spawn multiprocessing, and pass on linux where the default is still fork 47 lib.optionals stdenv.hostPlatform.isDarwin [ "tests/unit/test_compat.py" ]; 48 49 pythonImportsCheck = [ "s3transfer" ]; 50 51 optional-dependencies = { 52 crt = botocore.optional-dependencies.crt; 53 }; 54 55 meta = { 56 description = "Library for managing Amazon S3 transfers"; 57 homepage = "https://github.com/boto/s3transfer"; 58 changelog = "https://github.com/boto/s3transfer/blob/${version}/CHANGELOG.rst"; 59 license = lib.licenses.asl20; 60 maintainers = with lib.maintainers; [ nickcao ]; 61 }; 62}