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.10.1";
15 pyproject = true;
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "boto";
21 repo = "s3transfer";
22 rev = "refs/tags/${version}";
23 hash = "sha256-EHNkYviafnuU8AADp9oyaDuAnoPOdOVNSLCcoONnHPY=";
24 };
25
26 nativeBuildInputs = [ setuptools ];
27
28 propagatedBuildInputs = [ botocore ];
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 disabledTestPaths =
33 [
34 # Requires network access
35 "tests/integration"
36 ]
37 ++
38 # There was a change in python 3.8 that defaults multiprocessing to spawn instead of fork on macOS
39 # See https://bugs.python.org/issue33725 and https://github.com/python/cpython/pull/13603.
40 # 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
41 lib.optionals stdenv.isDarwin [ "tests/unit/test_compat.py" ];
42
43 pythonImportsCheck = [ "s3transfer" ];
44
45 passthru.optional-dependencies = {
46 crt = [ botocore.optional-dependencies.crt ];
47 };
48
49 meta = with lib; {
50 description = "Library for managing Amazon S3 transfers";
51 homepage = "https://github.com/boto/s3transfer";
52 changelog = "https://github.com/boto/s3transfer/blob/${version}/CHANGELOG.rst";
53 license = licenses.asl20;
54 maintainers = with maintainers; [ nickcao ];
55 };
56}