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