arkindex-client 1.0.13__tar.gz → 1.0.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/PKG-INFO +5 -5
  2. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/README.rst +3 -3
  3. arkindex-client-1.0.15/VERSION +1 -0
  4. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/client.py +4 -2
  5. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/pagination.py +3 -2
  6. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/transports.py +5 -0
  7. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex_client.egg-info/PKG-INFO +5 -5
  8. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex_client.egg-info/requires.txt +1 -1
  9. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/requirements.txt +1 -1
  10. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/setup.py +1 -1
  11. arkindex-client-1.0.13/VERSION +0 -1
  12. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/MANIFEST.in +0 -0
  13. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/__init__.py +0 -0
  14. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/auth.py +0 -0
  15. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/exceptions.py +0 -0
  16. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex/mock.py +0 -0
  17. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex_client.egg-info/SOURCES.txt +0 -0
  18. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex_client.egg-info/dependency_links.txt +0 -0
  19. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/arkindex_client.egg-info/top_level.txt +0 -0
  20. {arkindex-client-1.0.13 → arkindex-client-1.0.15}/setup.cfg +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkindex-client
3
- Version: 1.0.13
3
+ Version: 1.0.15
4
4
  Summary: API client for the Arkindex project
5
- Home-page: https://gitlab.com/teklia/arkindex/api-client
5
+ Home-page: https://gitlab.teklia.com/arkindex/api-client
6
6
  Author: Teklia <contact@teklia.com>
7
7
  License: MIT
8
8
  Keywords: api client arkindex
@@ -164,13 +164,13 @@ exception's attributes:
164
164
  except ErrorResponse as e:
165
165
  print(e.title) # "400 Bad Request"
166
166
  print(e.status_code) # 400
167
- print(e.result) # Any kind of response body the server might give
167
+ print(e.content) # Any kind of response body the server might give
168
168
 
169
169
  Note that by default, using ``repr()`` or ``str()`` on APIStar exceptions will
170
170
  not give any useful messages; a fix in APIStar is waiting to be merged. In
171
171
  the meantime, you can use Teklia's `APIStar fork`_::
172
172
 
173
- pip install git+https://gitlab.com/teklia/apistar.git
173
+ pip install git+https://gitlab.teklia.com/arkindex/apistar.git
174
174
 
175
175
  This will provide support for ``repr()`` and ``str()``, which will also
176
176
  enhance error messages on unhandled exceptions.
@@ -197,7 +197,7 @@ Download full logs for each Ponos task in a workflow
197
197
  f.write(cli.request('RetrieveTaskLog', id=task['id']))
198
198
 
199
199
  .. _APIStar: http://docs.apistar.com/
200
- .. _APIStar fork: https://gitlab.com/teklia/apistar
200
+ .. _APIStar fork: https://gitlab.teklia.com/arkindex/apistar
201
201
 
202
202
  Linting
203
203
  -------
@@ -142,13 +142,13 @@ exception's attributes:
142
142
  except ErrorResponse as e:
143
143
  print(e.title) # "400 Bad Request"
144
144
  print(e.status_code) # 400
145
- print(e.result) # Any kind of response body the server might give
145
+ print(e.content) # Any kind of response body the server might give
146
146
 
147
147
  Note that by default, using ``repr()`` or ``str()`` on APIStar exceptions will
148
148
  not give any useful messages; a fix in APIStar is waiting to be merged. In
149
149
  the meantime, you can use Teklia's `APIStar fork`_::
150
150
 
151
- pip install git+https://gitlab.com/teklia/apistar.git
151
+ pip install git+https://gitlab.teklia.com/arkindex/apistar.git
152
152
 
153
153
  This will provide support for ``repr()`` and ``str()``, which will also
154
154
  enhance error messages on unhandled exceptions.
@@ -175,7 +175,7 @@ Download full logs for each Ponos task in a workflow
175
175
  f.write(cli.request('RetrieveTaskLog', id=task['id']))
176
176
 
177
177
  .. _APIStar: http://docs.apistar.com/
178
- .. _APIStar fork: https://gitlab.com/teklia/apistar
178
+ .. _APIStar fork: https://gitlab.teklia.com/arkindex/apistar
179
179
 
180
180
  Linting
181
181
  -------
@@ -0,0 +1 @@
1
+ 1.0.15
@@ -84,6 +84,7 @@ class ArkindexClient(apistar.Client):
84
84
  schema_url=None,
85
85
  csrf_cookie=None,
86
86
  sleep=0,
87
+ verify=True,
87
88
  **kwargs,
88
89
  ):
89
90
  r"""
@@ -103,6 +104,7 @@ class ArkindexClient(apistar.Client):
103
104
  if not schema_url:
104
105
  schema_url = urljoin(base_url, SCHEMA_ENDPOINT)
105
106
 
107
+ self.verify = verify
106
108
  try:
107
109
  split = urlsplit(schema_url)
108
110
  if split.scheme == "file" or not (split.scheme or split.netloc):
@@ -110,7 +112,7 @@ class ArkindexClient(apistar.Client):
110
112
  with open(schema_url) as f:
111
113
  schema = yaml.safe_load(f)
112
114
  else:
113
- resp = requests.get(schema_url)
115
+ resp = requests.get(schema_url, verify=self.verify)
114
116
  resp.raise_for_status()
115
117
  schema = yaml.safe_load(resp.content)
116
118
  except Exception as e:
@@ -173,7 +175,7 @@ class ArkindexClient(apistar.Client):
173
175
  )
174
176
 
175
177
  def init_transport(self, *args, **kwargs):
176
- return ArkindexHTTPTransport(*args, **kwargs)
178
+ return ArkindexHTTPTransport(self.verify, *args, **kwargs)
177
179
 
178
180
  def configure(
179
181
  self,
@@ -117,9 +117,10 @@ class ResponsePaginator(Sized, Iterator):
117
117
  if "with_count" in operation_fields:
118
118
  extra_kwargs["with_count"] = "true"
119
119
  else:
120
+ remaining_count = self.pages_count - self.pages_loaded
120
121
  logger.info(
121
122
  f"Loading {self.mode.value} {index} on try {self.retries - retry + 1}/{self.retries}"
122
- f" - remains {self.pages_count - self.pages_loaded} pages to load."
123
+ f" - remains {remaining_count} page{'s' if remaining_count > 1 else ''} to load."
123
124
  )
124
125
 
125
126
  # Fetch the next page
@@ -147,7 +148,7 @@ class ResponsePaginator(Sized, Iterator):
147
148
  return False
148
149
  self.pages_count = math.ceil(self.count / len(self.results))
149
150
  logger.info(
150
- f"Pagination will load a total of {self.pages_count} pages."
151
+ f"Pagination will load a total of {self.pages_count} page{'s' if self.pages_count > 1 else ''}."
151
152
  )
152
153
  if self.mode == PaginationMode.PageNumber:
153
154
  # Initialize all pages once
@@ -3,7 +3,12 @@ from apistar.client.transports import HTTPTransport
3
3
 
4
4
 
5
5
  class ArkindexHTTPTransport(HTTPTransport):
6
+ def __init__(self, verify=True, *args, **kwargs):
7
+ super().__init__(*args, **kwargs)
8
+ self.verify = verify
9
+
6
10
  def get_request_options(self, *args, **kwargs):
7
11
  options = super().get_request_options(*args, **kwargs)
8
12
  options["timeout"] = (30, 60)
13
+ options["verify"] = self.verify
9
14
  return options
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkindex-client
3
- Version: 1.0.13
3
+ Version: 1.0.15
4
4
  Summary: API client for the Arkindex project
5
- Home-page: https://gitlab.com/teklia/arkindex/api-client
5
+ Home-page: https://gitlab.teklia.com/arkindex/api-client
6
6
  Author: Teklia <contact@teklia.com>
7
7
  License: MIT
8
8
  Keywords: api client arkindex
@@ -164,13 +164,13 @@ exception's attributes:
164
164
  except ErrorResponse as e:
165
165
  print(e.title) # "400 Bad Request"
166
166
  print(e.status_code) # 400
167
- print(e.result) # Any kind of response body the server might give
167
+ print(e.content) # Any kind of response body the server might give
168
168
 
169
169
  Note that by default, using ``repr()`` or ``str()`` on APIStar exceptions will
170
170
  not give any useful messages; a fix in APIStar is waiting to be merged. In
171
171
  the meantime, you can use Teklia's `APIStar fork`_::
172
172
 
173
- pip install git+https://gitlab.com/teklia/apistar.git
173
+ pip install git+https://gitlab.teklia.com/arkindex/apistar.git
174
174
 
175
175
  This will provide support for ``repr()`` and ``str()``, which will also
176
176
  enhance error messages on unhandled exceptions.
@@ -197,7 +197,7 @@ Download full logs for each Ponos task in a workflow
197
197
  f.write(cli.request('RetrieveTaskLog', id=task['id']))
198
198
 
199
199
  .. _APIStar: http://docs.apistar.com/
200
- .. _APIStar fork: https://gitlab.com/teklia/apistar
200
+ .. _APIStar fork: https://gitlab.teklia.com/arkindex/apistar
201
201
 
202
202
  Linting
203
203
  -------
@@ -1,3 +1,3 @@
1
1
  apistar==0.7.2
2
- requests==2.28.2
2
+ requests~=2.28
3
3
  typesystem==0.2.5
@@ -1,3 +1,3 @@
1
1
  apistar==0.7.2
2
- requests==2.28.2
2
+ requests~=2.28
3
3
  typesystem==0.2.5
@@ -22,7 +22,7 @@ setup(
22
22
  long_description=open("README.rst").read(),
23
23
  long_description_content_type="text/x-rst",
24
24
  keywords="api client arkindex",
25
- url="https://gitlab.com/teklia/arkindex/api-client",
25
+ url="https://gitlab.teklia.com/arkindex/api-client",
26
26
  classifiers=[
27
27
  "License :: OSI Approved :: MIT License",
28
28
  "Natural Language :: English",
@@ -1 +0,0 @@
1
- 1.0.13