Repository: minio/minio-py
Pull request #818 (2019-10-29 06:10:49)

Remove future depdency for python3
Only needed for python2

https://pypi.org/project/future/


Patch:
diff --git a/minio/api.py b/minio/api.py
index 47e06d5..de98b8c 100644
--- a/minio/api.py
+++ b/minio/api.py
@@ -924,7 +924,6 @@ class Minio(object):
 
         # Initialize query parameters.
         query = {
-            'max-keys': '1000',
             'prefix': prefix
         }
 
@@ -1218,7 +1217,6 @@ class Minio(object):
         # Initialize query parameters.
         query = {
             'uploads': '',
-            'max-uploads': '1000',
             'prefix': prefix
         }
 
@@ -1275,7 +1273,6 @@ class Minio(object):
 
         query = {
             'uploadId': upload_id,
-            'max-parts': '1000'
         }
 
         is_truncated = True
diff --git a/setup.py b/setup.py
index dbf8942..eb15d6e 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ packages = [
 ]
 
 requires = [
-    'future',
+    'future;python_version<"3.0"',
     'urllib3',
     'pytz',
     'certifi',


Test patch:
diff --git a/tests/unit/list_incomplete_uploads_test.py b/tests/unit/list_incomplete_uploads_test.py
index b13e124..28882e4 100644
--- a/tests/unit/list_incomplete_uploads_test.py
+++ b/tests/unit/list_incomplete_uploads_test.py
@@ -45,7 +45,7 @@ class ListIncompleteUploadsTest(TestCase):
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(
             MockResponse('GET',
-                         'https://localhost:9000/bucket/?max-uploads=1000&prefix=&uploads=',
+                         'https://localhost:9000/bucket/?prefix=&uploads=',
                          {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data))
         client = Minio('localhost:9000')
         upload_iter = client._list_incomplete_uploads('bucket', '', True, False)
@@ -102,7 +102,7 @@ class ListIncompleteUploadsTest(TestCase):
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(
             MockResponse('GET',
-                         'https://localhost:9000/bucket/?delimiter=%2F&max-uploads=1000&prefix=&uploads=',
+                         'https://localhost:9000/bucket/?delimiter=%2F&prefix=&uploads=',
                          {'User-Agent': _DEFAULT_USER_AGENT},
                          200, content=mock_data))
 
@@ -203,7 +203,7 @@ class ListIncompleteUploadsTest(TestCase):
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(
             MockResponse('GET',
-                         'https://localhost:9000/bucket/?max-uploads=1000&prefix=&uploads=',
+                         'https://localhost:9000/bucket/?prefix=&uploads=',
                          {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data1))
 
         client = Minio('localhost:9000')
@@ -213,7 +213,7 @@ class ListIncompleteUploadsTest(TestCase):
             mock_server.mock_add_request(MockResponse('GET',
                                                       'https://localhost:9000/bucket/?'
                                                       'key-marker=keymarker&'
-                                                      'max-uploads=1000&prefix=&'
+                                                      'prefix=&'
                                                       'upload-id-marker=uploadidmarker&uploads=',
                                                       {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data2))
             uploads.append(upload)
diff --git a/tests/unit/list_objects_test.py b/tests/unit/list_objects_test.py
index 174b2dd..b416377 100644
--- a/tests/unit/list_objects_test.py
+++ b/tests/unit/list_objects_test.py
@@ -40,7 +40,7 @@ class ListObjectsTest(TestCase):
         mock_server = MockConnection()
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(MockResponse('GET',
-                                                  'https://localhost:9000/bucket/?max-keys=1000&prefix=',
+                                                  'https://localhost:9000/bucket/?prefix=',
                                                   {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data))
         client = Minio('localhost:9000')
         bucket_iter = client.list_objects('bucket', recursive=True)
@@ -87,7 +87,7 @@ class ListObjectsTest(TestCase):
         mock_server = MockConnection()
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(MockResponse('GET',
-                                                  'https://localhost:9000/bucket/?delimiter=%2F&max-keys=1000&prefix=',
+                                                  'https://localhost:9000/bucket/?delimiter=%2F&prefix=',
                                                   {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data))
         client = Minio('localhost:9000')
         bucket_iter = client.list_objects('bucket')
@@ -95,7 +95,7 @@ class ListObjectsTest(TestCase):
         for bucket in bucket_iter:
             # cause an xml exception and fail if we try retrieving again
             mock_server.mock_add_request(MockResponse('GET',
-                                                      'https://localhost:9000/bucket/?delimiter=%2F&max-keys=1000&prefix=',
+                                                      'https://localhost:9000/bucket/?delimiter=%2F&prefix=',
                                                       {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=''))
             buckets.append(bucket)
 
@@ -172,13 +172,13 @@ class ListObjectsTest(TestCase):
         mock_server = MockConnection()
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(MockResponse('GET',
-                                                  'https://localhost:9000/bucket/?max-keys=1000&prefix=',
+                                                  'https://localhost:9000/bucket/?prefix=',
                                                   {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data1))
         client = Minio('localhost:9000')
         bucket_iter = client.list_objects('bucket', recursive=True)
         buckets = []
         for bucket in bucket_iter:
-            url = 'https://localhost:9000/bucket/?marker=marker&max-keys=1000&prefix='
+            url = 'https://localhost:9000/bucket/?marker=marker&prefix='
             mock_server.mock_add_request(MockResponse('GET', url,
                                                       {'User-Agent': _DEFAULT_USER_AGENT}, 200,
                                                       content=mock_data2))
diff --git a/tests/unit/list_uploaded_parts_test.py b/tests/unit/list_uploaded_parts_test.py
index 316884c..e5cd040 100644
--- a/tests/unit/list_uploaded_parts_test.py
+++ b/tests/unit/list_uploaded_parts_test.py
@@ -51,7 +51,7 @@ class ListPartsTest(TestCase):
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(
             MockResponse('GET',
-                         'https://localhost:9000/bucket/key?max-parts=1000&uploadId=upload_id',
+                         'https://localhost:9000/bucket/key?uploadId=upload_id',
                          {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data))
 
         client = Minio('localhost:9000')
@@ -98,7 +98,7 @@ class ListPartsTest(TestCase):
         mock_server = MockConnection()
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(MockResponse('GET',
-                                                  'https://localhost:9000/bucket/key?max-parts=1000&uploadId=upload_id',
+                                                  'https://localhost:9000/bucket/key?uploadId=upload_id',
                                                   {'User-Agent': _DEFAULT_USER_AGENT}, 200,
                                                   content=mock_data))
         client = Minio('localhost:9000')
@@ -179,7 +179,7 @@ class ListPartsTest(TestCase):
         mock_connection.return_value = mock_server
         mock_server.mock_add_request(
             MockResponse('GET',
-                         'https://localhost:9000/bucket/key?max-parts=1000&uploadId=upload_id',
+                         'https://localhost:9000/bucket/key?uploadId=upload_id',
                          {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data1))
 
 
@@ -190,7 +190,7 @@ class ListPartsTest(TestCase):
         for part in part_iter:
             mock_server.mock_add_request(
                 MockResponse('GET',
-                             'https://localhost:9000/bucket/key?max-parts=1000&part-number-marker=2&uploadId=upload_id',
+                             'https://localhost:9000/bucket/key?part-number-marker=2&uploadId=upload_id',
                              {'User-Agent': _DEFAULT_USER_AGENT}, 200, content=mock_data2))
             parts.append(part)
         eq_(4, len(parts))