about summary refs log tree commit diff
path: root/pkgs/development/python-modules/s3transfer/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/s3transfer/default.nix')
-rw-r--r--pkgs/development/python-modules/s3transfer/default.nix67
1 files changed, 34 insertions, 33 deletions
diff --git a/pkgs/development/python-modules/s3transfer/default.nix b/pkgs/development/python-modules/s3transfer/default.nix
index 9ed50fb9e49e3..3b07fe5b6d400 100644
--- a/pkgs/development/python-modules/s3transfer/default.nix
+++ b/pkgs/development/python-modules/s3transfer/default.nix
@@ -1,52 +1,53 @@
 { lib
-, fetchPypi
-, pythonOlder
+, botocore
 , buildPythonPackage
 , docutils
+, fetchFromGitHub
 , mock
-, nose
-, coverage
+, pytestCheckHook
+, pythonOlder
+, stdenv
 , 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;
-
-  buildInputs = [
-    docutils
-    mock
-    nose
-    coverage
-    wheel
-    unittest2
-  ];
-
-  checkPhase = ''
-    pushd s3transfer/tests
-    nosetests -v unit/ functional/
-    popd
-  '';
-
-  # version on pypi has no tests/ dir
-  doCheck = false;
+  propagatedBuildInputs = [ botocore ];
+
+  buildInputs = [ docutils mock pytestCheckHook wheel ];
+
+  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"
+  ] ++
+  # There was a change in python 3.8 that defaults multiprocessing to spawn instead of fork on macOS
+  # See https://bugs.python.org/issue33725 and https://github.com/python/cpython/pull/13603.
+  # 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
+  lib.optionals stdenv.isDarwin [ "tests/unit/test_compat.py" ];
+
+  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; [ ];
   };
 }