Skip to content

Commit d8010a0

Browse files
authored
build: update to DIV 75 (#76)
* update to div75 * bump version in CI * disable docs * change macos * support up to 3.14 * parallelize * change asterisk * try suggestion * go back to ilammy * bring back pins * ignore * go back to non-parallel nix * bump timeout * faster extract * remove invalid skip selector
1 parent ea4a35c commit d8010a0

12 files changed

Lines changed: 82 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
python-version: ["3.9", "3.13"]
24+
python-version: ["3.9", "3.14"]
2525
platform: [windows-latest, ubuntu-latest, macos-latest]
2626

2727
steps:
@@ -35,7 +35,7 @@ jobs:
3535
- uses: ilammy/msvc-dev-cmd@v1
3636
if: matrix.platform == 'windows-latest'
3737
with:
38-
toolset: "14.29"
38+
vsversion: "2022"
3939

4040
- name: install
4141
# install with coverage=true
@@ -75,11 +75,11 @@ jobs:
7575
- uses: ilammy/msvc-dev-cmd@v1
7676
if: matrix.os == 'windows-latest'
7777
with:
78-
toolset: "14.29"
78+
vsversion: "2022"
7979
- name: Setup MM test adapters
8080
uses: pymmcore-plus/setup-mm-test-adapters@main
8181
with:
82-
version: 74
82+
version: 75
8383
- name: Install dependencies
8484
run: |
8585
uv sync --no-dev --group test

.github/workflows/deploy.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,45 @@ concurrency:
1313

1414
jobs:
1515
build_wheels:
16-
name: Build wheels on ${{ matrix.os }} ${{ matrix.macos_arch }}
16+
name: Build wheels on ${{ matrix.os }} ${{ matrix.macos_arch }} ${{ matrix.python }}
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
os: [ubuntu-latest, windows-latest]
2221
include:
23-
- os: macos-13
22+
- os: ubuntu-latest
23+
- os: macos-15-intel
2424
macos_arch: "x86_64"
2525
- os: macos-latest
2626
macos_arch: "arm64"
27+
# Parallelize Windows by Python version (slow serial builds)
28+
- os: windows-latest
29+
python: cp39
30+
- os: windows-latest
31+
python: cp310
32+
- os: windows-latest
33+
python: cp311
34+
- os: windows-latest
35+
python: cp312
36+
- os: windows-latest
37+
python: cp313
38+
- os: windows-latest
39+
python: cp314
2740

2841
steps:
2942
- uses: actions/checkout@v6
3043
with:
3144
fetch-depth: 0
3245
- uses: ilammy/msvc-dev-cmd@v1
3346
with:
34-
toolset: "14.29"
47+
vsversion: "2022"
3548
- uses: astral-sh/setup-uv@v7
36-
- run: uv run --no-dev --group build scripts/extract_version.py --update
49+
- run: uv run scripts/extract_version.py --update
3750

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

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

5569
build_sdist:
@@ -62,7 +76,7 @@ jobs:
6276
- uses: astral-sh/setup-uv@v7
6377
- name: Build sdist
6478
run: |
65-
uv run --no-dev --group build scripts/extract_version.py --update
79+
uv run scripts/extract_version.py --update
6680
uv build --sdist
6781
6882
- uses: actions/upload-artifact@v6

meson.build

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# replace the version by running:
22
# meson rewrite kwargs set project / version $(python scripts/extract_version.py)
33
project(
4-
'pymmcore-nano',
5-
'cpp',
6-
version: '11.10.0.74.0',
7-
meson_version: '>=1.4.0',
8-
default_options: ['cpp_std=c++17'],
4+
'pymmcore-nano',
5+
'cpp',
6+
version : '11.14.0.75.0',
7+
meson_version : '>=1.4.0',
8+
default_options : ['cpp_std=c++17']
99
)
1010

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

2424
mmcore_proj = subproject(
2525
'mmcore',
26-
default_options: {'default_library': 'static', 'tests': 'disabled'},
26+
default_options: {'default_library': 'static', 'tests': 'disabled', 'docs': 'disabled'},
2727
)
28-
mmcore_dep = mmcore_proj.get_variable('mmcore')
28+
mmcore_dep = mmcore_proj.get_variable('mmcore_dep')
2929

3030
# --------------------------
3131

@@ -98,4 +98,4 @@ test(
9898
py,
9999
args: ['-m', 'pytest', '--color=yes', '-v'],
100100
workdir: meson.current_source_dir(),
101-
)
101+
)

meson_options.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
option(
2+
'tests',
3+
type: 'feature',
4+
value: 'disabled',
5+
description: 'Build unit tests for subprojects',
6+
)
17
option(
28
'hold_gil',
39
type: 'boolean',

pyproject.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ classifiers = [
3333
dependencies = ["numpy>=1.25"]
3434

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

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

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

99104
# https://docs.astral.sh/ruff/rules/
100105
[tool.ruff]
@@ -135,4 +140,4 @@ ignore = [
135140
[tool.check-wheel-contents]
136141
toplevel = "pymmcore_nano"
137142
package = "src/pymmcore_nano"
138-
ignore = ["W102"]
143+
ignore = ["W102", "W002"]

scripts/build_stubs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _windows_dll_dirs(module_path: Path):
4747
abs_dirs.append(d)
4848

4949
for d in abs_dirs:
50-
stack.enter_context(os.add_dll_directory(str(d)))
50+
stack.enter_context(os.add_dll_directory(str(d)))
5151
yield
5252
finally:
5353
stack.close()

scripts/extract_version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["meson"]
3+
# ///
4+
15
import re
26
import subprocess
37
import sys

src/_pymmcore_nano.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <nanobind/stl/vector.h>
77
#include <nanobind/trampoline.h>
88

9+
#include "ImageMetadata.h"
910
#include "MMCore.h"
1011
#include "MMEventCallback.h"
1112
#include "ModuleInterface.h"
@@ -1121,6 +1122,19 @@ MMCore will send notifications on internal events using this interface
11211122
"dExp"_a RGIL)
11221123
.def("getExposure", nb::overload_cast<>(&CMMCore::getExposure) RGIL)
11231124
.def("getExposure", nb::overload_cast<const char *>(&CMMCore::getExposure), "label"_a RGIL)
1125+
1126+
.def("getBinning", nb::overload_cast<>(&CMMCore::getBinning) RGIL)
1127+
.def("getBinning", nb::overload_cast<const char *>(&CMMCore::getBinning), "label"_a RGIL)
1128+
.def("getAllowedBinningValues", nb::overload_cast<>(&CMMCore::getAllowedBinningValues) RGIL)
1129+
.def("getAllowedBinningValues",
1130+
nb::overload_cast<const char *>(&CMMCore::getAllowedBinningValues),
1131+
"label"_a RGIL)
1132+
.def("setBinning", nb::overload_cast<long>(&CMMCore::setBinning), "binning"_a RGIL)
1133+
.def("setBinning",
1134+
nb::overload_cast<const char *, long>(&CMMCore::setBinning),
1135+
"label"_a,
1136+
"binning"_a RGIL)
1137+
11241138
.def("snapImage", &CMMCore::snapImage RGIL)
11251139
.def(
11261140
"getImage",
@@ -1373,6 +1387,8 @@ MMCore will send notifications on internal events using this interface
13731387
.def("setFocusDirection", &CMMCore::setFocusDirection, "stageLabel"_a, "sign"_a RGIL)
13741388
.def("getFocusDirection", &CMMCore::getFocusDirection, "stageLabel"_a RGIL)
13751389

1390+
.def("isStageUsingCallbacks", &CMMCore::isStageUsingCallbacks, "stageLabel"_a RGIL)
1391+
13761392
// Stage Sequence Methods
13771393
.def("isStageSequenceable", &CMMCore::isStageSequenceable, "stageLabel"_a RGIL)
13781394
.def("isStageLinearSequenceable", &CMMCore::isStageLinearSequenceable, "stageLabel"_a RGIL)
@@ -1455,6 +1471,8 @@ MMCore will send notifications on internal events using this interface
14551471
"newXUm"_a,
14561472
"newYUm"_a RGIL)
14571473

1474+
.def("isXYStageUsingCallbacks", &CMMCore::isXYStageUsingCallbacks, "xyStageLabel"_a RGIL)
1475+
14581476
// XY Stage Sequence Methods
14591477
.def("isXYStageSequenceable", &CMMCore::isXYStageSequenceable, "xyStageLabel"_a RGIL)
14601478
.def("startXYStageSequence", &CMMCore::startXYStageSequence, "xyStageLabel"_a RGIL)

subprojects/mmcore.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[wrap-git]
22
url = https://github.com/micro-manager/mmcore.git
3-
revision = 6036384efdd2da0f878ea022d26577012b126535
3+
revision = 0c04153d5832cf9bc1f1f5852018ddeafa524b50
44
depth = 1
55

66
[provide]

subprojects/mmdevice.wrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[wrap-git]
22
url = https://github.com/micro-manager/mmdevice.git
3-
revision = 6a5b88a4c84d97c2a5ce0f2b2f68631864b03d8f
3+
revision = 7437993c27fcc14ea9237db2cc71718850002b34
44
depth = 1
55

66
[provide]

0 commit comments

Comments
 (0)