Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.13"]
python-version: ["3.9", "3.14"]
platform: [windows-latest, ubuntu-latest, macos-latest]

steps:
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.platform == 'windows-latest'
with:
toolset: "14.29"
vsversion: "2022"

- name: install
# install with coverage=true
Expand Down Expand Up @@ -75,11 +75,11 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest'
with:
toolset: "14.29"
vsversion: "2022"
- name: Setup MM test adapters
uses: pymmcore-plus/setup-mm-test-adapters@main
with:
version: 74
version: 75
- name: Install dependencies
run: |
uv sync --no-dev --group test
Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,45 @@ concurrency:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.macos_arch }}
name: Build wheels on ${{ matrix.os }} ${{ matrix.macos_arch }} ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: macos-13
- os: ubuntu-latest
- os: macos-15-intel
macos_arch: "x86_64"
- os: macos-latest
macos_arch: "arm64"
# Parallelize Windows by Python version (slow serial builds)
- os: windows-latest
python: cp39
- os: windows-latest
python: cp310
- os: windows-latest
python: cp311
- os: windows-latest
python: cp312
- os: windows-latest
python: cp313
- os: windows-latest
python: cp314

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: "14.29"
vsversion: "2022"
- uses: astral-sh/setup-uv@v7
- run: uv run --no-dev --group build scripts/extract_version.py --update
- run: uv run scripts/extract_version.py --update

- name: Build wheels
uses: pypa/cibuildwheel@v3.3
uses: pypa/cibuildwheel@v3.2
env:
CIBW_BUILD: ${{ matrix.python && format('{0}-*', matrix.python) }}
CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
# Python on Linux is usually configured to add debug information,
# which increases binary size by ~11-fold. Remove for the builds we
Expand All @@ -49,7 +63,7 @@ jobs:

- uses: actions/upload-artifact@v6
with:
name: artifact-wheels-${{ matrix.os }}${{ matrix.macos_arch }}
name: artifact-wheels-${{ matrix.os }}${{ matrix.macos_arch && format('-{0}', matrix.macos_arch) }}${{ matrix.python && format('-{0}', matrix.python) }}
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -62,7 +76,7 @@ jobs:
- uses: astral-sh/setup-uv@v7
- name: Build sdist
run: |
uv run --no-dev --group build scripts/extract_version.py --update
uv run scripts/extract_version.py --update
uv build --sdist

- uses: actions/upload-artifact@v6
Expand Down
16 changes: 8 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# replace the version by running:
# meson rewrite kwargs set project / version $(python scripts/extract_version.py)
project(
'pymmcore-nano',
'cpp',
version: '11.10.0.74.0',
meson_version: '>=1.4.0',
default_options: ['cpp_std=c++17'],
'pymmcore-nano',
'cpp',
version : '11.14.0.75.0',
meson_version : '>=1.4.0',
default_options : ['cpp_std=c++17']
)

if host_machine.system() == 'darwin'
Expand All @@ -23,9 +23,9 @@ python_include_path = run_command(

mmcore_proj = subproject(
'mmcore',
default_options: {'default_library': 'static', 'tests': 'disabled'},
default_options: {'default_library': 'static', 'tests': 'disabled', 'docs': 'disabled'},
)
mmcore_dep = mmcore_proj.get_variable('mmcore')
mmcore_dep = mmcore_proj.get_variable('mmcore_dep')

# --------------------------

Expand Down Expand Up @@ -98,4 +98,4 @@ test(
py,
args: ['-m', 'pytest', '--color=yes', '-v'],
workdir: meson.current_source_dir(),
)
)
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
option(
'tests',
type: 'feature',
value: 'disabled',
description: 'Build unit tests for subprojects',
)
option(
'hold_gil',
type: 'boolean',
Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [
dependencies = ["numpy>=1.25"]

[project.optional-dependencies]
test-devices = ["mm-test-adapters~=74.0"]
test-devices = ["mm-test-adapters~=75.0"]

[dependency-groups]
build = ["meson-python", "nanobind", "ninja", "ruff", "typing_extensions"]
Expand Down Expand Up @@ -81,8 +81,8 @@ build-verbosity = 1
# Skip 32-bit builds, musllinux, and PyPy wheels on all platforms
# Note: use of PTHREAD_MUTEX_RECURSIVE_NP in DeviceThreads.h
# is specific to glibc and not available in musl-libc
skip = ["*-manylinux_i686", "*-musllinux*", "*-win32", "pp*"]
build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
skip = ["*-manylinux_i686", "*-musllinux*", "*-win32"]
build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
test-requires = ["check-wheel-contents"]
test-groups = ["test"]
test-command = [
Expand All @@ -95,6 +95,11 @@ test-command = [
archs = ["x86_64", "arm64"]
environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" }

[tool.cibuildwheel.windows]
# Let meson find MSVC itself, rather than relying on PATH from ilammy/msvc-dev-cmd.
# Workaround for https://github.com/pypa/cibuildwheel/issues/2663
config-settings = { "setup-args" = "--vsenv" }


# https://docs.astral.sh/ruff/rules/
[tool.ruff]
Expand Down Expand Up @@ -135,4 +140,4 @@ ignore = [
[tool.check-wheel-contents]
toplevel = "pymmcore_nano"
package = "src/pymmcore_nano"
ignore = ["W102"]
ignore = ["W102", "W002"]
2 changes: 1 addition & 1 deletion scripts/build_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _windows_dll_dirs(module_path: Path):
abs_dirs.append(d)

for d in abs_dirs:
stack.enter_context(os.add_dll_directory(str(d)))
stack.enter_context(os.add_dll_directory(str(d)))
yield
finally:
stack.close()
Expand Down
4 changes: 4 additions & 0 deletions scripts/extract_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# /// script
# dependencies = ["meson"]
# ///

import re
import subprocess
import sys
Expand Down
18 changes: 18 additions & 0 deletions src/_pymmcore_nano.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <nanobind/stl/vector.h>
#include <nanobind/trampoline.h>

#include "ImageMetadata.h"
#include "MMCore.h"
#include "MMEventCallback.h"
#include "ModuleInterface.h"
Expand Down Expand Up @@ -1121,6 +1122,19 @@ MMCore will send notifications on internal events using this interface
"dExp"_a RGIL)
.def("getExposure", nb::overload_cast<>(&CMMCore::getExposure) RGIL)
.def("getExposure", nb::overload_cast<const char *>(&CMMCore::getExposure), "label"_a RGIL)

.def("getBinning", nb::overload_cast<>(&CMMCore::getBinning) RGIL)
.def("getBinning", nb::overload_cast<const char *>(&CMMCore::getBinning), "label"_a RGIL)
.def("getAllowedBinningValues", nb::overload_cast<>(&CMMCore::getAllowedBinningValues) RGIL)
.def("getAllowedBinningValues",
nb::overload_cast<const char *>(&CMMCore::getAllowedBinningValues),
"label"_a RGIL)
.def("setBinning", nb::overload_cast<long>(&CMMCore::setBinning), "binning"_a RGIL)
.def("setBinning",
nb::overload_cast<const char *, long>(&CMMCore::setBinning),
"label"_a,
"binning"_a RGIL)

.def("snapImage", &CMMCore::snapImage RGIL)
.def(
"getImage",
Expand Down Expand Up @@ -1373,6 +1387,8 @@ MMCore will send notifications on internal events using this interface
.def("setFocusDirection", &CMMCore::setFocusDirection, "stageLabel"_a, "sign"_a RGIL)
.def("getFocusDirection", &CMMCore::getFocusDirection, "stageLabel"_a RGIL)

.def("isStageUsingCallbacks", &CMMCore::isStageUsingCallbacks, "stageLabel"_a RGIL)

// Stage Sequence Methods
.def("isStageSequenceable", &CMMCore::isStageSequenceable, "stageLabel"_a RGIL)
.def("isStageLinearSequenceable", &CMMCore::isStageLinearSequenceable, "stageLabel"_a RGIL)
Expand Down Expand Up @@ -1455,6 +1471,8 @@ MMCore will send notifications on internal events using this interface
"newXUm"_a,
"newYUm"_a RGIL)

.def("isXYStageUsingCallbacks", &CMMCore::isXYStageUsingCallbacks, "xyStageLabel"_a RGIL)

// XY Stage Sequence Methods
.def("isXYStageSequenceable", &CMMCore::isXYStageSequenceable, "xyStageLabel"_a RGIL)
.def("startXYStageSequence", &CMMCore::startXYStageSequence, "xyStageLabel"_a RGIL)
Expand Down
2 changes: 1 addition & 1 deletion subprojects/mmcore.wrap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[wrap-git]
url = https://github.com/micro-manager/mmcore.git
revision = 6036384efdd2da0f878ea022d26577012b126535
revision = 0c04153d5832cf9bc1f1f5852018ddeafa524b50
depth = 1

[provide]
Expand Down
2 changes: 1 addition & 1 deletion subprojects/mmdevice.wrap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[wrap-git]
url = https://github.com/micro-manager/mmdevice.git
revision = 6a5b88a4c84d97c2a5ce0f2b2f68631864b03d8f
revision = 7437993c27fcc14ea9237db2cc71718850002b34
depth = 1

[provide]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pathlib import Path


def _wait_until(predicate: Callable[[], bool], timeout: float = 1.0, interval=0.05):
def _wait_until(predicate: Callable[[], bool], timeout: float = 2.0, interval=0.05):
start_time = time.perf_counter()
while time.perf_counter() - start_time < timeout:
if predicate():
Expand Down
14 changes: 7 additions & 7 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.