pybiolib 1.1.1569__py3-none-any.whl → 1.1.1571__py3-none-any.whl

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.
@@ -1,5 +1,5 @@
1
- import datetime
2
- from urllib.parse import urlparse, parse_qs
1
+ from datetime import datetime, timedelta
2
+ # from urllib.parse import urlparse, parse_qs
3
3
 
4
4
  from biolib.biolib_logging import logger
5
5
 
@@ -12,19 +12,21 @@ class RemoteJobStorageResultEndpoint(RemoteEndpoint):
12
12
  self._job_id = job_id
13
13
  self._job_auth_token = job_auth_token
14
14
  self._expires_at = None
15
- self.presigned_url = None
15
+ self._presigned_url = None
16
16
 
17
17
  def get_remote_url(self):
18
- if not self.presigned_url or datetime.datetime.now() > self._expires_at:
19
- self.presigned_url = BiolibJobApi.get_job_storage_download_url(
18
+ if not self._presigned_url or datetime.utcnow() > self._expires_at:
19
+ self._presigned_url = BiolibJobApi.get_job_storage_download_url(
20
20
  job_auth_token=self._job_auth_token,
21
21
  job_uuid=self._job_id,
22
22
  storage_type='results'
23
23
  )
24
- parsed_url = urlparse(self.presigned_url)
25
- query_params = parse_qs(parsed_url.query)
26
- time_at_generation = datetime.datetime.strptime(query_params['X-Amz-Date'][0], '%Y%m%dT%H%M%SZ')
27
- self._expires_at = time_at_generation + datetime.timedelta(seconds=int(query_params['X-Amz-Expires'][0]))
24
+ self._expires_at = datetime.utcnow() + timedelta(minutes=8)
25
+ # TODO: Use expires at from url
26
+ # parsed_url = urlparse(self._presigned_url)
27
+ # query_params = parse_qs(parsed_url.query)
28
+ # time_at_generation = datetime.datetime.strptime(query_params['X-Amz-Date'][0], '%Y%m%dT%H%M%SZ')
29
+ # self._expires_at = time_at_generation + timedelta(seconds=int(query_params['X-Amz-Expires'][0]))
28
30
  logger.debug(f'Job "{self._job_id}" fetched presigned URL with expiry at {self._expires_at.isoformat()}')
29
31
 
30
- return self.presigned_url
32
+ return self._presigned_url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.1569
3
+ Version: 1.1.1571
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -24,7 +24,7 @@ biolib/biolib_binary_format/base_bbf_package.py,sha256=vxRV4iKy0dXeDOlFWnMFI0hGn
24
24
  biolib/biolib_binary_format/file_in_container.py,sha256=j1eEPRxf_ew8I6G8sDiiZZxn4Wx1ppagfM9K8zTDG4U,3591
25
25
  biolib/biolib_binary_format/module_input.py,sha256=led2QhHeec_ymBPw5uEn3_3vJKI-1T8zrFQGqwEWLMY,2788
26
26
  biolib/biolib_binary_format/module_output_v2.py,sha256=J5ZO5gCSeudpE12EVDrjYrNTS2DwgszY-SVXT7Qjuyg,5913
27
- biolib/biolib_binary_format/remote_endpoints.py,sha256=LgWd_cewZK4ncPR8303GM_PmIEZZJ5RQatJ_NSXUgbU,1306
27
+ biolib/biolib_binary_format/remote_endpoints.py,sha256=aeW479pm4YQPF4hXYJoKfBq_auE1QW6r066HTcYRwOY,1447
28
28
  biolib/biolib_binary_format/remote_stream_seeker.py,sha256=uyi6kJBU1C1DWfiuR0kRUQIY7nalG7ocgwgngd3Ul4U,1999
29
29
  biolib/biolib_binary_format/saved_job.py,sha256=nFHVFRNTNcAFGODLSiBntCtMk55QKwreUq6qLX80dI4,1125
30
30
  biolib/biolib_binary_format/stdout_and_stderr.py,sha256=WfUUJFFCBrtfXjuWIaRPiWCpuBLxfko68oxoTKhrwx8,1023
@@ -99,8 +99,8 @@ biolib/utils/cache_state.py,sha256=BFrZlV4XZIueIFzAFiPidX4hmwADKY5Y5ZuqlerF5l0,3
99
99
  biolib/utils/multipart_uploader.py,sha256=PEorMsTNg5f72e3Y-KA3LrI-F6EAnsD9vENV-5EuiX0,9896
100
100
  biolib/utils/seq_util.py,sha256=hudZ7o1LI7xdpjb1OFKPBZvGVxjiqKez8zMwjtWT0TY,3269
101
101
  biolib/utils/zip/remote_zip.py,sha256=NCdUnVbGCv7SfXCI-yVU-is_OnyWmLAnVpIdSvo-W4k,23500
102
- pybiolib-1.1.1569.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
103
- pybiolib-1.1.1569.dist-info/METADATA,sha256=I_W08aoyJxw4f_hRRaFy76KyLJeeTmFOcRPrLD-quCc,1543
104
- pybiolib-1.1.1569.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
105
- pybiolib-1.1.1569.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
106
- pybiolib-1.1.1569.dist-info/RECORD,,
102
+ pybiolib-1.1.1571.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
103
+ pybiolib-1.1.1571.dist-info/METADATA,sha256=GCYfZN1iDWCNkywGtwy9ueqTTcI4A2SxYSXs-fykT4o,1543
104
+ pybiolib-1.1.1571.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
105
+ pybiolib-1.1.1571.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
106
+ pybiolib-1.1.1571.dist-info/RECORD,,