omnata-plugin-runtime 0.3.28a81__tar.gz → 0.3.28a83__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.3.28a81
3
+ Version: 0.3.28a83
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -11,7 +11,6 @@ Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Requires-Dist: certifi (<=2023.11.17)
13
13
  Requires-Dist: charset-normalizer (<=2.0.4)
14
- Requires-Dist: dateparser (<=1.1.8)
15
14
  Requires-Dist: idna (<=3.4)
16
15
  Requires-Dist: jinja2 (>=3.1.2)
17
16
  Requires-Dist: markupsafe (<=2.1.3)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.3.28-a81"
3
+ version = "0.3.28-a83"
4
4
  description = "Classes and common runtime components for building and running Omnata Plugins"
5
5
  authors = ["James Weakley <james.weakley@omnata.com>"]
6
6
  readme = "README.md"
@@ -28,7 +28,6 @@ setuptools = ">=68.2.2" # 68.2.2 was latest version available on Snowflake Anaco
28
28
  tomlkit = ">=0.11.1" # 0.11.1 was latest version available on Snowflake Anaconda
29
29
  urllib3 = "<=2.1.0" # latest version available on Snowflake Anaconda
30
30
  wheel = "<=0.41.2" # latest version available on Snowflake Anaconda
31
- dateparser = "<=1.1.8" # latest version available on Snowflake Anaconda
32
31
 
33
32
  [tool.poetry.dev-dependencies]
34
33
  pytest = "^6.2.4"
@@ -13,9 +13,7 @@ import requests
13
13
  from pydantic import Field, root_validator
14
14
  from pydantic.json import pydantic_encoder
15
15
  from .configuration import SubscriptableBaseModel
16
- import time
17
16
  import pytz
18
- import dateparser
19
17
  from requests.adapters import HTTPAdapter
20
18
  from urllib3.util.retry import Retry
21
19
 
@@ -411,7 +409,10 @@ class RateLimitedSession(requests.Session):
411
409
  if retry_after.isdigit():
412
410
  wait_time = int(retry_after)
413
411
  else:
414
- retry_datetime = dateparser.parse(retry_after)
412
+ # Retry-After can be a date in the format specified in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
413
+ # e.g. Fri, 31 Dec 1999 23:59:59 GMT
414
+ # we'll parse it using the standard datetime parser
415
+ retry_datetime = datetime.datetime.strptime(retry_after, "%a, %d %b %Y %H:%M:%S %Z")
415
416
  retry_datetime = retry_datetime.replace(tzinfo=pytz.UTC)
416
417
  current_datetime = datetime.datetime.now(pytz.UTC)
417
418
  wait_time = (retry_datetime - current_datetime).total_seconds()