meerschaum 2.7.3__py3-none-any.whl → 2.7.4__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -183,7 +183,7 @@ def _start_jobs(
183
183
  ### Cannot find dameon_id
184
184
  else:
185
185
  msg = (
186
- f"Unknown job" + ('s' if len(action) != 1 else '') + ' '
186
+ "Unknown job" + ('s' if len(action) != 1 else '') + ' '
187
187
  + items_str(action, and_str='or') + '.'
188
188
  )
189
189
  return False, msg
@@ -216,7 +216,7 @@ def _start_jobs(
216
216
  return job.start(debug=debug), name
217
217
 
218
218
  def _run_existing_job(name: str):
219
- job = Job(name, executor_keys=executor_keys)
219
+ job = jobs.get(name, Job(name, executor_keys=executor_keys))
220
220
  return job.start(debug=debug), name
221
221
 
222
222
  if not names:
@@ -2,4 +2,4 @@
2
2
  Specify the Meerschaum release version.
3
3
  """
4
4
 
5
- __version__ = "2.7.3"
5
+ __version__ = "2.7.4"
@@ -6,8 +6,6 @@
6
6
  Higher-level utilities for managing `meerschaum.utils.daemon.Daemon`.
7
7
  """
8
8
 
9
- import pathlib
10
-
11
9
  import meerschaum as mrsm
12
10
  from meerschaum.utils.typing import Dict, Optional, List, SuccessTuple
13
11
 
@@ -13,7 +13,6 @@ import pathlib
13
13
  import json
14
14
  import shutil
15
15
  import signal
16
- import sys
17
16
  import time
18
17
  import traceback
19
18
  from functools import partial
@@ -301,6 +300,7 @@ class Daemon:
301
300
  os.environ['LINES'], os.environ['COLUMNS'] = str(int(lines)), str(int(columns))
302
301
  with self._daemon_context:
303
302
  sys.stdin = self.stdin_file
303
+ _ = os.environ.pop(STATIC_CONFIG['environment']['systemd_stdin_path'], None)
304
304
  os.environ[STATIC_CONFIG['environment']['daemon_id']] = self.daemon_id
305
305
  os.environ['PYTHONUNBUFFERED'] = '1'
306
306
 
@@ -104,7 +104,10 @@ class StdinFile(io.TextIOBase):
104
104
  if self._file_handler is not None:
105
105
  self.sel.unregister(self._file_handler)
106
106
  self._file_handler.close()
107
- os.close(self._fd)
107
+ try:
108
+ os.close(self._fd)
109
+ except OSError:
110
+ pass
108
111
  self._file_handler = None
109
112
  self._fd = None
110
113
 
@@ -395,9 +395,13 @@ def init_venv(
395
395
 
396
396
  def update_lock(active: bool):
397
397
  try:
398
- if active:
398
+ if not active:
399
+ if debug:
400
+ print(f"Releasing lock: '{lock_path}'")
399
401
  lock_path.unlink()
400
402
  else:
403
+ if debug:
404
+ print(f"Acquiring lock: '{lock_path}'")
401
405
  lock_path.touch()
402
406
  except Exception:
403
407
  pass
@@ -408,7 +412,10 @@ def init_venv(
408
412
  init_venv_check_start = time.perf_counter()
409
413
  while (time.perf_counter() - init_venv_check_start < max_lock_seconds):
410
414
  if not lock_path.exists():
411
- continue
415
+ break
416
+
417
+ if debug:
418
+ print(f"Lock exists for '{venv}', sleeping...")
412
419
  time.sleep(step_sleep_seconds)
413
420
  update_lock(False)
414
421
 
@@ -441,10 +448,9 @@ def init_venv(
441
448
  rename_vtp = vtp.exists() and not temp_vtp.exists()
442
449
 
443
450
  if rename_vtp:
444
- try:
445
- vtp.rename(temp_vtp)
446
- except FileExistsError:
447
- pass
451
+ if debug:
452
+ print(f"Moving '{vtp}' to '{temp_vtp}'...")
453
+ shutil.move(vtp, temp_vtp)
448
454
 
449
455
  wait_for_lock()
450
456
  update_lock(True)
@@ -491,7 +497,9 @@ def init_venv(
491
497
  + "Please install `virtualenv` via pip then restart Meerschaum."
492
498
  )
493
499
  if rename_vtp and temp_vtp.exists():
494
- temp_vtp.rename(vtp)
500
+ if debug:
501
+ print(f"Moving '{temp_vtp}' back to '{vtp}'...")
502
+ shutil.move(temp_vtp, vtp)
495
503
  update_lock(False)
496
504
  return False
497
505
 
@@ -530,7 +538,7 @@ def init_venv(
530
538
  import traceback
531
539
  traceback.print_exc()
532
540
  if rename_vtp and temp_vtp.exists():
533
- temp_vtp.rename(vtp)
541
+ shutil.move(temp_vtp, vtp)
534
542
  update_lock(False)
535
543
  return False
536
544
  if verify:
@@ -538,7 +546,9 @@ def init_venv(
538
546
  verified_venvs.add(venv)
539
547
 
540
548
  if rename_vtp and temp_vtp.exists():
541
- temp_vtp.rename(vtp)
549
+ if debug:
550
+ print(f"Cleanup: move '{temp_vtp}' back to '{vtp}'.")
551
+ shutil.move(temp_vtp, vtp)
542
552
 
543
553
  update_lock(False)
544
554
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: meerschaum
3
- Version: 2.7.3
3
+ Version: 2.7.4
4
4
  Summary: Sync Time-Series Pipes with Meerschaum
5
5
  Home-page: https://meerschaum.io
6
6
  Author: Bennett Meares
@@ -44,7 +44,7 @@ meerschaum/actions/sh.py,sha256=hSkGNTVqP5dNjhJ64zy3V3VCFPTKnDlH3PxdKdxtkGQ,1990
44
44
  meerschaum/actions/show.py,sha256=T8Ol1o-762cI9rlUzd-8svvwgT4slYXYfOPQETh9Koo,28446
45
45
  meerschaum/actions/sql.py,sha256=vAsxbSl-Hkw3wfrM1BLnKex_kJrZwIJICAXysprQGWM,4220
46
46
  meerschaum/actions/stack.py,sha256=ZwrCTGJ0x3jjZkRieWcvqasQHYCqNtB1HYvTX-r3Z3g,5996
47
- meerschaum/actions/start.py,sha256=26i2Pqg3c_Ltw3lgYzl3sZL2wG0XBgOuJrPK8qPPHdI,21281
47
+ meerschaum/actions/start.py,sha256=NtdVzeB00PQBnDSUSu8ypHmMrZT8_Idmw5BfVZ--Zic,21296
48
48
  meerschaum/actions/stop.py,sha256=5fdUw70YN-yuUWrC-NhA88cxr9FZ5NbssbQ8xXO8nFU,4632
49
49
  meerschaum/actions/sync.py,sha256=QGhf0ZyrNaplPL6TkwHO9VQLEu_Gemmid93vdaovXoo,17153
50
50
  meerschaum/actions/tag.py,sha256=SJf5qFW0ccLXjqlTdkK_0MCcrCMdg6xhYrhKdco0hdA,3053
@@ -143,7 +143,7 @@ meerschaum/config/_preprocess.py,sha256=-AEA8m_--KivZwTQ1sWN6LTn5sio_fUr2XZ51BO6
143
143
  meerschaum/config/_read_config.py,sha256=RLC3HHi_1ndj7ITVDKLD9_uULY3caGRwSz3ATYE-ixA,15014
144
144
  meerschaum/config/_shell.py,sha256=46_m49Txc5q1rGfCgO49ca48BODx45DQJi8D0zz1R18,4245
145
145
  meerschaum/config/_sync.py,sha256=jHcWRkxd82_BgX8Xo8agsWvf7BSbv3qHLWmYl6ehp_0,4242
146
- meerschaum/config/_version.py,sha256=15LlFyoMeeTpuVYA_73PnLwLlzhwvMJLmuNnG_C0Rys,71
146
+ meerschaum/config/_version.py,sha256=MXSVkU-_rIMkbFaFaLStOfNg5rNqfnzfD42W6YOfi6s,71
147
147
  meerschaum/config/paths.py,sha256=JjibeGN3YAdSNceRwsd42aNmeUrIgM6ndzC8qZAmNI0,621
148
148
  meerschaum/config/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
149
  meerschaum/config/stack/__init__.py,sha256=2UukC0Lmk-aVL1o1qXzumqmuIrw3vu9fD7iCuz4XD4I,10544
@@ -212,7 +212,7 @@ meerschaum/core/User/_User.py,sha256=qbI0GIkr3G0PI4d9S49uatbJQ2kH_-z5-GoVJ0fuEtA
212
212
  meerschaum/core/User/__init__.py,sha256=9qNy-Gobui4x6GiaE8U7-WOggsdniOM3_wegLN3SVKs,988
213
213
  meerschaum/jobs/_Executor.py,sha256=qM62BhFTM4tyJ7p90KOM0y3qyeRY9k3ZV_aTDJMHnO8,1682
214
214
  meerschaum/jobs/_Job.py,sha256=wRsmrQ1bm898BxXELbHTltKYBj0bK0GmegE8zeL0FG8,32161
215
- meerschaum/jobs/__init__.py,sha256=1GFkF-bnkC_rnemKCW_WM9oIq7oyLglux3TssXGBwz0,12189
215
+ meerschaum/jobs/__init__.py,sha256=YjwB6t8HCT593ckrOlImgk0kLX-1NgAYzNXVwS-uvyY,12173
216
216
  meerschaum/jobs/systemd.py,sha256=Rq-tsDPslG17ZhpKMrVJ5r8Z0IPr6DEc9APObfIoXCg,24614
217
217
  meerschaum/plugins/_Plugin.py,sha256=bIo4HX8TTWIcwIHROwMt4VK6OoEUhY_3Qc8q-2dp-ZA,33895
218
218
  meerschaum/plugins/__init__.py,sha256=6krcqaMKyzuVqesXMqEL0XEy2SJQ4xfNt2-oI_fJ6v0,26278
@@ -233,10 +233,10 @@ meerschaum/utils/threading.py,sha256=awjbVL_QR6G-o_9Qk85utac9cSdqkiC8tQSdERCdrG8
233
233
  meerschaum/utils/typing.py,sha256=U3MC347sh1umpa3Xr1k71eADyDmk4LB6TnVCpq8dVzI,2830
234
234
  meerschaum/utils/warnings.py,sha256=n-phr3BftNNgyPnvnXC_VMSjtCvjiCZ-ewmVfcROhkc,6611
235
235
  meerschaum/utils/yaml.py,sha256=PoC1du0pn2hLwTHwL-zuOf_EBWZSbCGOz-P-AZ4BWN0,3901
236
- meerschaum/utils/daemon/Daemon.py,sha256=R_LM0zZS4Tng5OQLNZ-Dzyk2dn_EPR7z8FNiphYgvBs,42622
236
+ meerschaum/utils/daemon/Daemon.py,sha256=PfFu_yba5d9k8GW3mGmJRilenyNNoA9DEG2TiiFfyMI,42704
237
237
  meerschaum/utils/daemon/FileDescriptorInterceptor.py,sha256=MJKMO0Syf3d8yWUs6xXcQzg8Ptsuvh2aCRRoglOjusA,5257
238
238
  meerschaum/utils/daemon/RotatingFile.py,sha256=ePm_svjwyFDWh6V1k-bp1RHXCSWlyxDtlFu4SU4XvPU,24369
239
- meerschaum/utils/daemon/StdinFile.py,sha256=J6tyUReM8NEp3bBQAxMfe8mjJG5mWi6CzHN4x86VQBI,3237
239
+ meerschaum/utils/daemon/StdinFile.py,sha256=qdZ8E_RSOkURypwnS50mWeyWyRig1bAY9tKWMTVKajc,3307
240
240
  meerschaum/utils/daemon/__init__.py,sha256=o9jWb4lRTIyny4EPt7fPXFgV_vIf1mUofsTwoE1ZecA,8751
241
241
  meerschaum/utils/daemon/_names.py,sha256=d2ZwTxBoTAqXZkCfZ5LuX2XrkQmLNUq1OTlUqfoH5dA,4515
242
242
  meerschaum/utils/dtypes/__init__.py,sha256=c6DoYyCbWvMdRapBRKP5UJYLRUWtkTIlC_8HRzXFh2s,12166
@@ -250,12 +250,12 @@ meerschaum/utils/packages/__init__.py,sha256=Op93VJkAX3OL4H-js_p3dAaa_PT82jvjCna
250
250
  meerschaum/utils/packages/_packages.py,sha256=ykannoLv2Fm4iwZwiIlNAGZvt654cMJhjXr1VJPoEDo,8867
251
251
  meerschaum/utils/packages/lazy_loader.py,sha256=VHnph3VozH29R4JnSSBfwtA5WKZYZQFT_GeQSShCnuc,2540
252
252
  meerschaum/utils/venv/_Venv.py,sha256=QsnDGEE_YBqXIq53NTWi2TANA1FbkqJBl_xQi9jQP_U,3537
253
- meerschaum/utils/venv/__init__.py,sha256=BZQ-c8aJi3xu3kdx0Ey0bnOa5n6XEVbpWZGgQRN6nwg,26208
254
- meerschaum-2.7.3.dist-info/LICENSE,sha256=jG2zQEdRNt88EgHUWPpXVWmOrOduUQRx7MnYV9YIPaw,11359
255
- meerschaum-2.7.3.dist-info/METADATA,sha256=hvljI_CruYI5E630gkA_zwnUf53OTK_PCeJup-c9BIs,24224
256
- meerschaum-2.7.3.dist-info/NOTICE,sha256=OTA9Fcthjf5BRvWDDIcBC_xfLpeDV-RPZh3M-HQBRtQ,114
257
- meerschaum-2.7.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
258
- meerschaum-2.7.3.dist-info/entry_points.txt,sha256=5YBVzibw-0rNA_1VjB16z5GABsOGf-CDhW4yqH8C7Gc,88
259
- meerschaum-2.7.3.dist-info/top_level.txt,sha256=bNoSiDj0El6buocix-FRoAtJOeq1qOF5rRm2u9i7Q6A,11
260
- meerschaum-2.7.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
261
- meerschaum-2.7.3.dist-info/RECORD,,
253
+ meerschaum/utils/venv/__init__.py,sha256=m8tgZvk2VxYd6OHfiJlE1tpHo9b7hH69y1UmHeY6ncM,26679
254
+ meerschaum-2.7.4.dist-info/LICENSE,sha256=jG2zQEdRNt88EgHUWPpXVWmOrOduUQRx7MnYV9YIPaw,11359
255
+ meerschaum-2.7.4.dist-info/METADATA,sha256=tHOCaQB1p7j8P6denDGdRHY4fhxNcTkqkzqBBo_r9SU,24224
256
+ meerschaum-2.7.4.dist-info/NOTICE,sha256=OTA9Fcthjf5BRvWDDIcBC_xfLpeDV-RPZh3M-HQBRtQ,114
257
+ meerschaum-2.7.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
258
+ meerschaum-2.7.4.dist-info/entry_points.txt,sha256=5YBVzibw-0rNA_1VjB16z5GABsOGf-CDhW4yqH8C7Gc,88
259
+ meerschaum-2.7.4.dist-info/top_level.txt,sha256=bNoSiDj0El6buocix-FRoAtJOeq1qOF5rRm2u9i7Q6A,11
260
+ meerschaum-2.7.4.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
261
+ meerschaum-2.7.4.dist-info/RECORD,,