hardpy 0.10.0__py3-none-any.whl → 0.10.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.
@@ -12,6 +12,8 @@ import secrets
12
12
  import socket
13
13
  import subprocess
14
14
  import sys
15
+ from contextlib import suppress
16
+ from platform import system
15
17
  from time import sleep
16
18
  from typing import TYPE_CHECKING
17
19
  from urllib.parse import urlencode
@@ -109,6 +111,12 @@ def logout() -> bool:
109
111
  delete_password(service_name, cred.username)
110
112
  except KeyringError:
111
113
  return False
114
+ # TODO(xorialexandrov): fix keyring clearing
115
+ # Windows does not clear refresh token by itself
116
+ if system() == "Windows":
117
+ storage_keyring, _ = get_token_store()
118
+ with suppress(KeyringError):
119
+ storage_keyring.delete_password(service_name, "refresh_token")
112
120
  return True
113
121
 
114
122
 
@@ -147,6 +155,18 @@ def _create_callback_process(port: str) -> subprocess.Popen:
147
155
  "--log-level=error",
148
156
  ]
149
157
 
158
+ if system() == "Windows":
159
+ env = os.environ.copy()
160
+ env["PYTHONUNBUFFERED"] = "1"
161
+
162
+ return subprocess.Popen( # noqa: S603
163
+ args,
164
+ stdout=subprocess.PIPE,
165
+ bufsize=1,
166
+ universal_newlines=True,
167
+ env=env,
168
+ creationflags=subprocess.CREATE_NEW_PROCESS_GROUP, # type: ignore
169
+ )
150
170
  return subprocess.Popen( # noqa: S603
151
171
  args,
152
172
  stdout=subprocess.PIPE,
@@ -187,7 +207,14 @@ def _check_incorrect_response(response: dict, state: str) -> None:
187
207
  print(f"{error}: {error_description}")
188
208
  sys.exit(1)
189
209
 
190
- def _par_data(code_verifier: str, client_id: str, port: str, state: str, api_url: str) -> dict:
210
+
211
+ def _par_data(
212
+ code_verifier: str,
213
+ client_id: str,
214
+ port: str,
215
+ state: str,
216
+ api_url: str,
217
+ ) -> dict:
191
218
  """Create pushed authorization request data.
192
219
 
193
220
  Returns:
@@ -2,6 +2,7 @@
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  from __future__ import annotations
4
4
 
5
+ from platform import system
5
6
  from typing import TYPE_CHECKING
6
7
 
7
8
  from keyring.core import load_keyring
@@ -16,7 +17,10 @@ def get_token_store() -> tuple[KeyringBackend, KeyringBackend]:
16
17
  Returns:
17
18
  tuple[KeyringBackend, KeyringBackend]: token store
18
19
  """
19
- storage_keyring = load_keyring("keyring.backends.SecretService.Keyring")
20
+ if system() == "Linux":
21
+ storage_keyring = load_keyring("keyring.backends.SecretService.Keyring")
22
+ elif system() == "Windows":
23
+ storage_keyring = load_keyring("keyring.backends.Windows.WinVaultKeyring")
20
24
  # TODO(xorialexandrov): add memory keyring or other store
21
25
  mem_keyring = storage_keyring
22
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hardpy
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: HardPy library for device testing
5
5
  Project-URL: Homepage, https://github.com/everypinio/hardpy/
6
6
  Project-URL: Documentation, https://everypinio.github.io/hardpy/
@@ -8,8 +8,8 @@ hardpy/common/stand_cloud/__init__.py,sha256=iOLOLdz06j8TLZBzHbYYuc0V5RYdEuG9ZbA
8
8
  hardpy/common/stand_cloud/connector.py,sha256=RBG-RDQmKGDey7mT13KiDtl-0ETIGivF-3LGtI67Odg,7334
9
9
  hardpy/common/stand_cloud/exception.py,sha256=eKkqu5ylDRIGN_yZhvz2xVGm49XmlZ8nryALgdRqpbY,287
10
10
  hardpy/common/stand_cloud/oauth_callback.py,sha256=GkADOnQ46HwxKEdgG_4bS1xX0ybfdQqMK3us-dMuHVw,3322
11
- hardpy/common/stand_cloud/registration.py,sha256=QoQLRx69AdUF-uS8ACSlUeI5bxzHRpuvLLvWylX-lrQ,6007
12
- hardpy/common/stand_cloud/token_storage.py,sha256=g-wqGV2Cq0UJwQQX7k84WbgbUfelfJys-Te1JYdBnLw,681
11
+ hardpy/common/stand_cloud/registration.py,sha256=HxvTex-PxanfVMYt7jiOuxs2lSMt0-f5PbWBvbobvCU,6754
12
+ hardpy/common/stand_cloud/token_storage.py,sha256=aH3-BRefCR-CHd0La6wOEwWxBZY8wOkdXh8WE86vLMo,856
13
13
  hardpy/hardpy_panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  hardpy/hardpy_panel/api.py,sha256=2brUDu8gAV7WduZTlxfW_ax-Z7loE-RXzZgrUUd33L4,3073
15
15
  hardpy/hardpy_panel/frontend/dist/asset-manifest.json,sha256=PgtjHvX6HPsAzUrKaCldhGUmr0wyFIv8brWW2pitHUQ,2824
@@ -79,8 +79,8 @@ hardpy/pytest_hardpy/utils/machineid.py,sha256=6JAzUt7KtjTYn8kL9hSMaCQ20U8liH-zD
79
79
  hardpy/pytest_hardpy/utils/node_info.py,sha256=mA7u1KHHLIq70ZNOOF7NVlxMmfhwGanVyXpBNfBWQDk,4121
80
80
  hardpy/pytest_hardpy/utils/progress_calculator.py,sha256=TPl2gG0ZSvMe8otPythhF9hkD6fa6-mJAhy9yI83-yE,1071
81
81
  hardpy/pytest_hardpy/utils/singleton.py,sha256=tjUGs48o_vBeVpRsEBZEOTCoCUikpIFmQ1c3rsfymso,948
82
- hardpy-0.10.0.dist-info/METADATA,sha256=A6XFOyxpBR8ENne-9TGG2SSXJ5MIHQpvhwp8JuooWDg,3909
83
- hardpy-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- hardpy-0.10.0.dist-info/entry_points.txt,sha256=nL2sMkKMScNaOE0IPkYnu9Yr-BUswZvGSrwY-SxHY3E,102
85
- hardpy-0.10.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
86
- hardpy-0.10.0.dist-info/RECORD,,
82
+ hardpy-0.10.1.dist-info/METADATA,sha256=XglDrNrTyGzBPJt7pGnQQiL8KerkYGEj320TQpIB4mg,3909
83
+ hardpy-0.10.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ hardpy-0.10.1.dist-info/entry_points.txt,sha256=nL2sMkKMScNaOE0IPkYnu9Yr-BUswZvGSrwY-SxHY3E,102
85
+ hardpy-0.10.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
86
+ hardpy-0.10.1.dist-info/RECORD,,