Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose MMCore_version variables in MMCore.h #533

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tlambert03
Copy link
Contributor

The MMCore version info is only declared in MMCore.cpp, making it a bit harder to access in bindings like pymmcore. (you have to resort to manually declaring it which is error prone. this exposes those variables in the public header

@marktsuchida
Copy link
Member

Is the goal to make it easier to access the version at run time from Python? If so we might consider a variant of CMMCore::getVersionInfo() that returns 3 numbers instead of a string. That can be a static member function (or even a free function) so that CMMCore need not be instantiated. I think this is better than exposing integer constants; something like

static void CMMCore::getVersion(int& major, int& minor, int& patch);

(As you know the pymmcore version number has a manually incremented "packaging" version (5th element) that is specific to pymmcore; also the manually updated version is tested for match with getVersionInfo().)

@tlambert03
Copy link
Contributor Author

it's about compile time, rather than runtime. this would enable:

https://github.com/pymmcore-plus/pymmcore-nano/blob/46fa1769ec4bdedb251d62c042135ca3adc61205/src/_pymmcore_nano.cc#L244-L245

...which removes the need to manually increment packaging info and avoids any possibility of the two going out of sync (i.e. it doesn't depend on pytest to catch it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants