omnata-plugin-runtime 0.5.0a112__tar.gz → 0.5.1a114__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.5.0a112
3
+ Version: 0.5.1a114
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
@@ -9,8 +9,11 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.8
10
10
  Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
+ Requires-Dist: annotated-types (<=0.6.0)
12
13
  Requires-Dist: certifi (<=2024.7.4)
13
14
  Requires-Dist: charset-normalizer (<=2.0.4)
15
+ Requires-Dist: cryptography (<=42.0.5)
16
+ Requires-Dist: filelock (<=3.13.1)
14
17
  Requires-Dist: idna (<=3.7)
15
18
  Requires-Dist: jinja2 (>=3.1.2,<=3.1.4)
16
19
  Requires-Dist: markupsafe (<=2.1.3)
@@ -18,7 +21,9 @@ Requires-Dist: numpy (<=1.26.4)
18
21
  Requires-Dist: packaging (<=24.1)
19
22
  Requires-Dist: pandas (<=2.2.2)
20
23
  Requires-Dist: platformdirs (<=3.10.0)
24
+ Requires-Dist: pycparser (<=2.21)
21
25
  Requires-Dist: pydantic (>=2,<=2.5.3)
26
+ Requires-Dist: pydantic-core (<=2.14.6)
22
27
  Requires-Dist: pyjwt (<=2.8.0)
23
28
  Requires-Dist: pyopenssl (<=24.0.0)
24
29
  Requires-Dist: pytz (<=2024.1)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "omnata-plugin-runtime"
3
- version = "0.5.0-a112"
3
+ version = "0.5.1-a114"
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"
@@ -10,6 +10,11 @@ packages = [{include = "omnata_plugin_runtime", from = "src"}]
10
10
  python = ">=3.8, <3.11"
11
11
  snowflake-snowpark-python = "1.19.0" # fixes an issue
12
12
  snowflake-connector-python = "^3, <=3.12.0" # latest version available on Snowflake Anaconda
13
+ cryptography = "<=42.0.5"
14
+ annotated-types = "<=0.6.0"
15
+ pycparser = "<=2.21"
16
+ filelock = "<=3.13.1"
17
+ pydantic-core = "<=2.14.6"
13
18
  # had to relax some of these thanks to snowcli pinning newer versions
14
19
  certifi = "<=2024.7.4" # latest version available on Snowflake Anaconda
15
20
  charset-normalizer = "<=2.0.4" # latest version available on Snowflake Anaconda
@@ -178,10 +178,9 @@ class RateLimitState(SubscriptableBaseModel):
178
178
  [],
179
179
  description="A list of timestamps where previous requests have been made, used to calculate the next request time",
180
180
  )
181
-
182
- _request_timestamps_lock: threading.Lock = PrivateAttr( # or use Any to annotate the type and use Field to initialize
183
- default_factory=lambda: threading.Lock()
184
- )
181
+ # can't set this as a class variable because it's not serializable
182
+ # TODO: probably shouldn't mix models with functionality like this
183
+ _request_timestamps_lock: Optional[threading.Lock] = None
185
184
 
186
185
  @field_serializer('wait_until',when_used='always')
187
186
  def serialize_wait_until(self, value:Optional[datetime.datetime]) -> Optional[int]:
@@ -253,6 +252,8 @@ class RateLimitState(SubscriptableBaseModel):
253
252
  You only need to use this if your HTTP requests are not automatically being
254
253
  registered, which happens if http.client.HTTPConnection is not being used.
255
254
  """
255
+ if self._request_timestamps_lock is None:
256
+ self._request_timestamps_lock = threading.Lock()
256
257
  with self._request_timestamps_lock:
257
258
  append_time = datetime.datetime.now(datetime.timezone.utc)
258
259
  if self.previous_request_timestamps is None: