flagsmith 5.5.0__tar.gz → 6.0.0__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.
@@ -1,16 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flagsmith
3
- Version: 5.5.0
3
+ Version: 6.0.0
4
4
  Summary: Flagsmith Python SDK
5
5
  License: BSD3
6
6
  License-File: LICENSE
7
7
  Keywords: feature,flag,flagsmith,remote,config
8
8
  Author: Flagsmith
9
9
  Author-email: support@flagsmith.com
10
- Requires-Python: >=3.9,<4
10
+ Requires-Python: >=3.10,<4
11
11
  Classifier: License :: Other/Proprietary License
12
12
  Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
@@ -357,12 +357,13 @@ class Flagsmith:
357
357
 
358
358
  Skips the exposure event when the resolved flag is a `DefaultFlag`
359
359
  (i.e. the feature was not present and was served via the
360
- `default_flag_handler`), to keep experimentation data clean.
360
+ `default_flag_handler`) or when the feature is disabled, to keep
361
+ experimentation data clean.
361
362
  """
362
363
  if not self._event_processor:
363
364
  raise ValueError("Events must be enabled to use experiment flags.")
364
365
  flag = self.get_identity_flags(identifier, traits).get_flag(feature_name)
365
- if isinstance(flag, Flag):
366
+ if isinstance(flag, Flag) and flag.enabled:
366
367
  self.track_exposure_event(
367
368
  feature_name=feature_name,
368
369
  identifier=identifier,
@@ -2,7 +2,6 @@ from __future__ import annotations
2
2
 
3
3
  import logging
4
4
  import threading
5
- import time
6
5
  import typing
7
6
 
8
7
  if typing.TYPE_CHECKING:
@@ -26,8 +25,11 @@ class EnvironmentDataPollingManager(threading.Thread):
26
25
 
27
26
  def run(self) -> None:
28
27
  while not self._stop_event.is_set():
29
- self.main.update_environment()
30
- time.sleep(self.refresh_interval_seconds)
28
+ try:
29
+ self.main.update_environment()
30
+ except Exception:
31
+ logger.exception("Error updating environment")
32
+ self._stop_event.wait(self.refresh_interval_seconds)
31
33
 
32
34
  def stop(self) -> None:
33
35
  self._stop_event.set()
@@ -40,8 +40,9 @@ class EventStreamManager(threading.Thread):
40
40
  for event in sse_client.events():
41
41
  self.on_event(map_sse_event_to_stream_event(event))
42
42
 
43
- except (requests.RequestException, ValueError, TypeError):
43
+ except Exception:
44
44
  logger.exception("Error opening or reading from the event stream")
45
+ self._stop_event.wait(1)
45
46
 
46
47
  def stop(self) -> None:
47
48
  self._stop_event.set()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "flagsmith"
3
- version = "5.5.0"
3
+ version = "6.0.0"
4
4
  description = "Flagsmith Python SDK"
5
5
  authors = ["Flagsmith <support@flagsmith.com>"]
6
6
  license = "BSD3"
@@ -12,7 +12,7 @@ packages = [{ include = "flagsmith" }]
12
12
  [tool.poetry.dependencies]
13
13
  flagsmith-flag-engine = "^10.2.0"
14
14
  iso8601 = { version = "^2.1.0", python = "<3.11" }
15
- python = ">=3.9,<4"
15
+ python = ">=3.10,<4"
16
16
  requests = "^2.32.3"
17
17
  requests-futures = "^1.0.1"
18
18
  sseclient-py = "^1.8.0"
@@ -22,11 +22,11 @@ typing-extensions = "^4.15.0"
22
22
  optional = true
23
23
 
24
24
  [tool.poetry.group.dev.dependencies]
25
- mypy = { version = "^1.16.1", python = ">=3.9,<4" }
26
- pytest = "^7.4.0"
25
+ mypy = "^1.16.1"
26
+ pytest = ">=7.4,<10.0"
27
27
  pytest-cov = "^4.1.0"
28
28
  pytest-mock = "^3.6.1"
29
- pre-commit = { version = "^4.2.0", python = ">=3.9,<4" }
29
+ pre-commit = "^4.2.0"
30
30
  responses = "^0.24.1"
31
31
  types-requests = "^2.32"
32
32
  pyfakefs = "^5.9.2"
@@ -35,7 +35,7 @@ pyfakefs = "^5.9.2"
35
35
  exclude = ["example/*"]
36
36
 
37
37
  [tool.black]
38
- target-version = ["py39"]
38
+ target-version = ["py310"]
39
39
 
40
40
  [build-system]
41
41
  requires = ["poetry-core>=1.0.0"]
File without changes
File without changes
File without changes
File without changes
File without changes