learning-loop-node 0.16.0__py3-none-any.whl → 0.16.1__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.

Potentially problematic release.


This version of learning-loop-node might be problematic. Click here for more details.

@@ -8,7 +8,8 @@ from httpx import Cookies, Timeout
8
8
 
9
9
  from .helpers import environment_reader
10
10
 
11
- logging.basicConfig(level=logging.INFO)
11
+ logger = logging.getLogger('loop_communication')
12
+ logging.getLogger("httpx").setLevel(logging.WARNING)
12
13
 
13
14
  SLEEP_TIME_ON_429 = 5
14
15
  MAX_RETRIES_ON_429 = 20
@@ -37,9 +38,9 @@ class LoopCommunicator():
37
38
  host: str = environment_reader.host(default='learning-loop.ai')
38
39
  self.ssl_cert_path = environment_reader.ssl_certificate_path()
39
40
  if self.ssl_cert_path:
40
- logging.info('Using SSL certificate at %s', self.ssl_cert_path)
41
+ logger.info('Using SSL certificate at %s', self.ssl_cert_path)
41
42
  else:
42
- logging.info('No SSL certificate path set')
43
+ logger.info('No SSL certificate path set')
43
44
  self.host: str = host
44
45
  self.username: str = environment_reader.username()
45
46
  self.password: str = environment_reader.password()
@@ -52,7 +53,7 @@ class LoopCommunicator():
52
53
  else:
53
54
  self.async_client = httpx.AsyncClient(base_url=self.base_url, timeout=Timeout(60.0))
54
55
 
55
- logging.info('Loop interface initialized with base_url: %s / user: %s', self.base_url, self.username)
56
+ logger.info('Loop interface initialized with base_url: %s / user: %s', self.base_url, self.username)
56
57
 
57
58
  def websocket_url(self) -> str:
58
59
  return f'ws{"s" if "learning-loop.ai" in self.host else ""}://' + self.host
@@ -65,7 +66,7 @@ class LoopCommunicator():
65
66
  self.async_client.cookies.clear()
66
67
  response = await self.async_client.post('/api/login', data={'username': self.username, 'password': self.password})
67
68
  if response.status_code != 200:
68
- logging.info('Login failed with response: %s', response)
69
+ logger.info('Login failed with response: %s', response)
69
70
  raise LoopCommunicationException('Login failed with response: ' + str(response))
70
71
  self.async_client.cookies.update(response.cookies)
71
72
 
@@ -74,7 +75,7 @@ class LoopCommunicator():
74
75
 
75
76
  response = await self.async_client.post('/api/logout')
76
77
  if response.status_code != 200:
77
- logging.info('Logout failed with response: %s', response)
78
+ logger.info('Logout failed with response: %s', response)
78
79
  raise LoopCommunicationException('Logout failed with response: ' + str(response))
79
80
  self.async_client.cookies.clear()
80
81
 
@@ -90,12 +91,12 @@ class LoopCommunicator():
90
91
  start_time = time.time()
91
92
  while True:
92
93
  try:
93
- logging.info('Checking if backend is ready')
94
+ logger.info('Checking if backend is ready')
94
95
  response = await self.get('/status', requires_login=False)
95
96
  if response.status_code == 200:
96
97
  return True
97
98
  except Exception:
98
- logging.info('backend not ready yet.')
99
+ logger.info('backend not ready yet.')
99
100
  if timeout is not None and time.time() + 10 - start_time > timeout:
100
101
  raise TimeoutError('Backend not ready within timeout')
101
102
  await asyncio.sleep(10)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: learning-loop-node
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: Python Library for Nodes which connect to the Zauberzeug Learning Loop
5
5
  Home-page: https://github.com/zauberzeug/learning_loop_node
6
6
  License: MIT
@@ -40,7 +40,7 @@ learning_loop_node/helpers/gdrive_downloader.py,sha256=zeYJciTAJVRpu_eFjwgYLCpIa
40
40
  learning_loop_node/helpers/log_conf.py,sha256=hqVAa_9NnYEU6N0dcOKmph82p7MpgKqeF_eomTLYzWY,961
41
41
  learning_loop_node/helpers/misc.py,sha256=J29iBmsEUAraKKDN1m1NKiHQ3QrP5ub5HBU6cllSP2g,7384
42
42
  learning_loop_node/helpers/run.py,sha256=_uox-j3_K_bL3yCAwy3JYSOiIxrnhzVxyxWpCe8_J9U,876
43
- learning_loop_node/loop_communication.py,sha256=opulqBKRLXlUQgjA3t0pg8CNA-JXJRCPPUspRxRuuGw,7556
43
+ learning_loop_node/loop_communication.py,sha256=d1tJZ9T_y22FrEq1XzvidgH6d-byGxFq3ovLvPBS4FA,7611
44
44
  learning_loop_node/node.py,sha256=xK-xODRo7ov-dNNMcpLW2GAauvjKAK3K9RQh4P9S994,12160
45
45
  learning_loop_node/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  learning_loop_node/rest.py,sha256=5X9IVW9kf1gNf8jifGW9g_gI_-9TEeoMMOW16jvwpRE,1599
@@ -99,6 +99,6 @@ learning_loop_node/trainer/test_executor.py,sha256=6BVGDN_6f5GEMMEvDLSG1yzMybSvg
99
99
  learning_loop_node/trainer/trainer_logic.py,sha256=eK-01qZzi10UjLMCQX8vy5eW2FoghPj3rzzDC-s3Si4,8792
100
100
  learning_loop_node/trainer/trainer_logic_generic.py,sha256=KcHmXr-Hp8_Wuejzj8odY6sRPqi6aw1SEXv3YlbjM98,27057
101
101
  learning_loop_node/trainer/trainer_node.py,sha256=tsAMzJewdS7Bi_1b9FwG0d2lGlv2lY37pgOLWr0bP_I,4582
102
- learning_loop_node-0.16.0.dist-info/METADATA,sha256=z8fX3WJhdBUbBVFTSC0tXu1wb-t4M1777nshv_k3u6Y,13509
103
- learning_loop_node-0.16.0.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
104
- learning_loop_node-0.16.0.dist-info/RECORD,,
102
+ learning_loop_node-0.16.1.dist-info/METADATA,sha256=nHAEMpBL_tSXA00hNvuLoAuh0RcS1FACaCS_JsCP7rA,13509
103
+ learning_loop_node-0.16.1.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
104
+ learning_loop_node-0.16.1.dist-info/RECORD,,