dycw-utilities 0.175.21__py3-none-any.whl → 0.175.23__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dycw-utilities
3
- Version: 0.175.21
3
+ Version: 0.175.23
4
4
  Summary: Miscellaneous Python utilities
5
5
  Author: Derek Wan
6
6
  Author-email: Derek Wan <d.wan@icloud.com>
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=c3FAa7J9i9A9QwY7M7bRf_yJU_6W4YVirou_51-hDaE,61
1
+ utilities/__init__.py,sha256=TdabuTViObcHRUy-z79TlqsEvhS7grJe0CUouWVbCyM,61
2
2
  utilities/altair.py,sha256=TLfRFbG9HwG7SLXoJ-v0r-t49ZaGgTQZD82cpjVi4vs,9085
3
3
  utilities/asyncio.py,sha256=aJySVxBY0gqsIYnoNmH7-1r8djKuf4vSsU69VCD08t8,16772
4
4
  utilities/atomicwrites.py,sha256=tPo6r-Rypd9u99u66B9z86YBPpnLrlHtwox_8Z7T34Y,5790
@@ -80,7 +80,7 @@ utilities/sqlalchemy.py,sha256=HQYpd7LFxdTF5WYVWYtCJeEBI71EJm7ytvCGyAH9B-U,37163
80
80
  utilities/sqlalchemy_polars.py,sha256=JCGhB37raSR7fqeWV5dTsciRTMVzIdVT9YSqKT0piT0,13370
81
81
  utilities/statsmodels.py,sha256=koyiBHvpMcSiBfh99wFUfSggLNx7cuAw3rwyfAhoKpQ,3410
82
82
  utilities/string.py,sha256=shmBK87zZwzGyixuNuXCiUbqzfeZ9xlrFwz6JTaRvDk,582
83
- utilities/subprocess.py,sha256=1nM6Fb-aD4xO673bqWt79rReS2gAhUGmxiA00ZPHYcU,45578
83
+ utilities/subprocess.py,sha256=nRUXgfCfOSS_pRb068LExpiHO9kWTSTiSp07lQsJ3i4,45914
84
84
  utilities/tempfile.py,sha256=a3_M1QyxGZql_VcGkBOQBeWbbkItjgkfIpVyzU1UAic,3843
85
85
  utilities/testbook.py,sha256=j1KmaVbrX9VrbeMgtPh5gk55myAsn3dyRUn7jGbPbRk,1294
86
86
  utilities/text.py,sha256=7SvwcSR2l_5cOrm1samGnR4C-ZI6qyFLHLzSpO1zeHQ,13958
@@ -97,7 +97,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
97
97
  utilities/whenever.py,sha256=F4ek0-OBWxHYrZdmoZt76N2RnNyKY5KrEHt7rqO4AQE,60183
98
98
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
99
99
  utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
100
- dycw_utilities-0.175.21.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
101
- dycw_utilities-0.175.21.dist-info/entry_points.txt,sha256=cOGtKeJI0KXLSV7MJ8Dhc2G8jPgDcBDm53MVNJU4ycI,136
102
- dycw_utilities-0.175.21.dist-info/METADATA,sha256=y3VJmWeWtzyIF4omQ2e7If6NjJvyNU7DND56LbeP7m4,1443
103
- dycw_utilities-0.175.21.dist-info/RECORD,,
100
+ dycw_utilities-0.175.23.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
101
+ dycw_utilities-0.175.23.dist-info/entry_points.txt,sha256=cOGtKeJI0KXLSV7MJ8Dhc2G8jPgDcBDm53MVNJU4ycI,136
102
+ dycw_utilities-0.175.23.dist-info/METADATA,sha256=UftEkNMzFg65aRkFF5et8cThTCBTJK29s67eZbt2BRc,1443
103
+ dycw_utilities-0.175.23.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.175.21"
3
+ __version__ = "0.175.23"
utilities/subprocess.py CHANGED
@@ -1246,13 +1246,19 @@ def ssh_await(
1246
1246
 
1247
1247
 
1248
1248
  def ssh_keyscan(
1249
- hostname: str, /, *, path: PathLike = KNOWN_HOSTS, port: int | None = None
1249
+ hostname: str,
1250
+ /,
1251
+ *,
1252
+ path: PathLike = KNOWN_HOSTS,
1253
+ retry: Retry | None = None,
1254
+ port: int | None = None,
1250
1255
  ) -> None:
1251
1256
  """Add a known host."""
1252
- ssh_keygen_remove(hostname, path=path) # skipif-ci
1253
- mkdir(path, parent=True) # skipif-ci
1254
- with Path(path).open(mode="a") as fh: # skipif-ci
1255
- _ = fh.write(run(*ssh_keyscan_cmd(hostname, port=port), return_=True))
1257
+ ssh_keygen_remove(hostname, path=path, retry=retry) # skipif-ci
1258
+ result = run( # skipif-ci
1259
+ *ssh_keyscan_cmd(hostname, port=port), return_=True, retry=retry
1260
+ )
1261
+ tee(path, result, append=True) # skipif-ci
1256
1262
 
1257
1263
 
1258
1264
  def ssh_keyscan_cmd(hostname: str, /, *, port: int | None = None) -> list[str]:
@@ -1266,11 +1272,13 @@ def ssh_keyscan_cmd(hostname: str, /, *, port: int | None = None) -> list[str]:
1266
1272
  ##
1267
1273
 
1268
1274
 
1269
- def ssh_keygen_remove(hostname: str, /, *, path: PathLike = KNOWN_HOSTS) -> None:
1275
+ def ssh_keygen_remove(
1276
+ hostname: str, /, *, path: PathLike = KNOWN_HOSTS, retry: Retry | None = None
1277
+ ) -> None:
1270
1278
  """Remove a known host."""
1271
1279
  path = Path(path)
1272
1280
  if path.exists():
1273
- run(*ssh_keygen_remove_cmd(hostname, path=path))
1281
+ run(*ssh_keygen_remove_cmd(hostname, path=path), retry=retry)
1274
1282
 
1275
1283
 
1276
1284
  def ssh_keygen_remove_cmd(
@@ -1415,6 +1423,7 @@ def uv_run(
1415
1423
  module: str,
1416
1424
  /,
1417
1425
  *args: str,
1426
+ env: StrStrMapping | None = None,
1418
1427
  cwd: PathLike | None = None,
1419
1428
  print: bool = False,
1420
1429
  print_stdout: bool = False,
@@ -1430,6 +1439,7 @@ def uv_run(
1430
1439
  module: str,
1431
1440
  /,
1432
1441
  *args: str,
1442
+ env: StrStrMapping | None = None,
1433
1443
  cwd: PathLike | None = None,
1434
1444
  print: bool = False,
1435
1445
  print_stdout: bool = False,
@@ -1445,6 +1455,7 @@ def uv_run(
1445
1455
  module: str,
1446
1456
  /,
1447
1457
  *args: str,
1458
+ env: StrStrMapping | None = None,
1448
1459
  cwd: PathLike | None = None,
1449
1460
  print: bool = False,
1450
1461
  print_stdout: bool = False,
@@ -1460,6 +1471,7 @@ def uv_run(
1460
1471
  module: str,
1461
1472
  /,
1462
1473
  *args: str,
1474
+ env: StrStrMapping | None = None,
1463
1475
  cwd: PathLike | None = None,
1464
1476
  print: bool = False,
1465
1477
  print_stdout: bool = False,
@@ -1475,6 +1487,7 @@ def uv_run(
1475
1487
  module: str,
1476
1488
  /,
1477
1489
  *args: str,
1490
+ env: StrStrMapping | None = None,
1478
1491
  cwd: PathLike | None = None,
1479
1492
  print: bool = False,
1480
1493
  print_stdout: bool = False,
@@ -1490,6 +1503,7 @@ def uv_run(
1490
1503
  /,
1491
1504
  *args: str,
1492
1505
  cwd: PathLike | None = None,
1506
+ env: StrStrMapping | None = None,
1493
1507
  print: bool = False, # noqa: A002
1494
1508
  print_stdout: bool = False,
1495
1509
  print_stderr: bool = False,
@@ -1503,6 +1517,7 @@ def uv_run(
1503
1517
  return run( # pragma: no cover
1504
1518
  *uv_run_cmd(module, *args),
1505
1519
  cwd=cwd,
1520
+ env=env,
1506
1521
  print=print,
1507
1522
  print_stdout=print_stdout,
1508
1523
  print_stderr=print_stderr,