pymmcore-plus 0.13.6__py3-none-any.whl → 0.13.7__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.
pymmcore_plus/_cli.py CHANGED
@@ -1,4 +1,5 @@
1
1
  # do NOT use __future__.annotations here. It breaks typer.
2
+ import contextlib
2
3
  import os
3
4
  import shutil
4
5
  import subprocess
@@ -143,12 +144,13 @@ def mmstudio() -> None: # pragma: no cover
143
144
  if mm
144
145
  else None
145
146
  )
146
- if not app: # pragma: no cover
147
+ if not mm or not app: # pragma: no cover
147
148
  print(f":x: [bold red]No MMStudio application found in {mm!r}")
148
149
  print("[magenta]run `mmcore install` to install a version of Micro-Manager")
149
150
  raise typer.Exit(1)
150
151
  cmd = ["open", "-a", str(app)] if PLATFORM == "Darwin" else [str(app)]
151
- raise typer.Exit(subprocess.run(cmd).returncode)
152
+ with contextlib.chdir(mm):
153
+ raise typer.Exit(subprocess.run(cmd).returncode)
152
154
 
153
155
 
154
156
  @app.command()
pymmcore_plus/_util.py CHANGED
@@ -181,14 +181,17 @@ def find_micromanager(return_first: bool = True) -> str | None | list[str]:
181
181
  app_path = applications[sys.platform]
182
182
  pth = next(app_path.glob("[m,M]icro-[m,M]anager*"), None)
183
183
  if return_first:
184
- if pth is None:
185
- logger.error(
186
- "could not find micromanager directory. Please run 'mmcore install'"
187
- )
188
- return None
189
- if _mm_path_has_compatible_div(pth): # pragma: no cover
184
+ if pth and _mm_path_has_compatible_div(pth): # pragma: no cover
190
185
  logger.debug("using MM path found in applications: %s", pth)
191
186
  return str(pth)
187
+ from . import _pymmcore
188
+
189
+ div = _pymmcore.version_info.device_interface
190
+ logger.error(
191
+ f"could not find micromanager directory for device interface {div}. "
192
+ "Please run 'mmcore install'"
193
+ )
194
+ return None
192
195
  if pth is not None:
193
196
  full_list[str(pth)] = None
194
197
  return list(full_list)
@@ -659,9 +662,9 @@ def get_device_interface_version(lib_path: str | Path) -> int:
659
662
  import ctypes
660
663
 
661
664
  if sys.platform.startswith("win"):
662
- lib = ctypes.WinDLL(lib_path)
665
+ lib = ctypes.WinDLL(str(lib_path))
663
666
  else:
664
- lib = ctypes.CDLL(lib_path)
667
+ lib = ctypes.CDLL(str(lib_path))
665
668
 
666
669
  try:
667
670
  func = lib.GetDeviceInterfaceVersion
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymmcore-plus
3
- Version: 0.13.6
3
+ Version: 0.13.7
4
4
  Summary: pymmcore superset providing improved APIs, event handling, and a pure python acquisition engine
5
5
  Project-URL: Source, https://github.com/pymmcore-plus/pymmcore-plus
6
6
  Project-URL: Tracker, https://github.com/pymmcore-plus/pymmcore-plus/issues
@@ -63,8 +63,6 @@ Requires-Dist: pyside2>=5.15; extra == 'pyside2'
63
63
  Provides-Extra: pyside6
64
64
  Requires-Dist: pyside6<6.8,>=6.4.0; extra == 'pyside6'
65
65
  Provides-Extra: test
66
- Requires-Dist: mm-device-adapters; (sys_platform == 'darwin' and platform_machine == 'x86_64') and extra == 'test'
67
- Requires-Dist: mm-device-adapters; (sys_platform == 'win32') and extra == 'test'
68
66
  Requires-Dist: msgpack; extra == 'test'
69
67
  Requires-Dist: msgspec; extra == 'test'
70
68
  Requires-Dist: pytest-cov>=4; extra == 'test'
@@ -1,10 +1,10 @@
1
1
  pymmcore_plus/__init__.py,sha256=9-vK2P2jkJJ2REhCjFDBbJu0wrZM0jvDcf-d2GsjTk0,1415
2
2
  pymmcore_plus/_benchmark.py,sha256=YJICxXleFQVbOluJdq4OujnIcTkkuMVzeB8GJ8nUv5I,6011
3
3
  pymmcore_plus/_build.py,sha256=RPTAuwCZWGL5IDJj4JZo1DIIouUsIqS3vnbPbG2_bRE,10993
4
- pymmcore_plus/_cli.py,sha256=ofh7Yac4VqVuWrEYZ9ZpY4jR8FYzzxfjihvs1_gOqpM,16768
4
+ pymmcore_plus/_cli.py,sha256=wmqlG8UGBNiTefRppSnRHwnD3w-5DAhN168lIBujbRA,16831
5
5
  pymmcore_plus/_logger.py,sha256=d7ldqxY0rGWORKdIzNUiFc9BW6cFBx57kHWtXyY1HE0,5416
6
6
  pymmcore_plus/_pymmcore.py,sha256=tcWtTRte9AFQznLGn6CmwLW0W3Rsse8N8NQ5L7JwKCc,630
7
- pymmcore_plus/_util.py,sha256=oeJiDgt5_EoC8srmGz-QH_yNCgsxJ4k0C43qrAspL2A,22706
7
+ pymmcore_plus/_util.py,sha256=VGcb_nQu6BBWZsQihed0TrCHdTRADKlBo_qSnIbeF0Q,22814
8
8
  pymmcore_plus/install.py,sha256=U4TbQXbUc12aMtGRF_SkinNOTDCuuzIhME5Oup_4ds0,10768
9
9
  pymmcore_plus/mocks.py,sha256=jNUfmffD1OArtIvEmqWsy7GCrtTpssVF03flH8cEYx8,1867
10
10
  pymmcore_plus/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -64,8 +64,8 @@ pymmcore_plus/model/_device.py,sha256=AX3rO2gbY7AXJyMN3FfI_n2jl2V0IAPuBh7MiDA5Sq
64
64
  pymmcore_plus/model/_microscope.py,sha256=69VV6cuevinOK_LhYEkQygHGesvCZefdn9YNt3mV618,11353
65
65
  pymmcore_plus/model/_pixel_size_config.py,sha256=RXk8AAwARe8clsXue0GZfOTb1bxyXIsO0ibcDLHM4_s,3889
66
66
  pymmcore_plus/model/_property.py,sha256=NQzNtnEzSCR9ogwx1cfi8X-qbJ_cBSJKdSBAaoKoPQ0,3720
67
- pymmcore_plus-0.13.6.dist-info/METADATA,sha256=LPZrzi2nVttLeRhGn-UlURw4NUoOVOG34fUn59_S3Yc,9961
68
- pymmcore_plus-0.13.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
69
- pymmcore_plus-0.13.6.dist-info/entry_points.txt,sha256=NtFyndrQzBpUNJyil-8e5hMGke2utAf7mkGavTLcLOY,51
70
- pymmcore_plus-0.13.6.dist-info/licenses/LICENSE,sha256=OHJjRpOPKKRc7FEnpehNWdR5LRBdBhUtIFG-ZI0dCEA,1522
71
- pymmcore_plus-0.13.6.dist-info/RECORD,,
67
+ pymmcore_plus-0.13.7.dist-info/METADATA,sha256=Xf0FN1PVDxE4QgDL3JaKGuGutrKAnTOm1nfb0OUdFDU,9765
68
+ pymmcore_plus-0.13.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
69
+ pymmcore_plus-0.13.7.dist-info/entry_points.txt,sha256=NtFyndrQzBpUNJyil-8e5hMGke2utAf7mkGavTLcLOY,51
70
+ pymmcore_plus-0.13.7.dist-info/licenses/LICENSE,sha256=OHJjRpOPKKRc7FEnpehNWdR5LRBdBhUtIFG-ZI0dCEA,1522
71
+ pymmcore_plus-0.13.7.dist-info/RECORD,,