-
Notifications
You must be signed in to change notification settings - Fork 49
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 flux version in python module #5281
Conversation
@@ -0,0 +1,16 @@ | |||
############################################################### | |||
# Copyright 2014 Lawrence Livermore National Security, LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2023 :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol! @chu11 maybe I am living in the past... or maybe I just copy pasted from handle.py 😆
One random idea based on the slack conversation. If we can figure out why FLUX_CORE_VERSION_STRING is not being put into Granted |
Problem: Python tools that use Flux want custom logic based on the version, and we currently do not easily expose it. Solution: create a flux.__version__ "attribute" that calls into a module to call flux_core_version_string(). Signed-off-by: vsoch <vsoch@users.noreply.github.com>
638b1d4
to
beb3979
Compare
We could definitely look into that, but I've done refactors of the Python bindings so many times, looking at the older version gives me the shivers. If someone has a hint / direction for where to look I can help, but I think my instinct right now is to run away! For context, we now have:
We can do changes in the older one, but just need to be careful to pass them forward to the more hardened one. Also, the separate bindings can easily ship with |
Weird error:
|
I think the problem is that enumerated constants are the only thing put into That is I presume why we have this in
|
We may be filtering them out. CFFI does actually support defines, but
only simple ones, and I may have just gone with avoiding the problem
entirely rather than trying to pull in the ones that work.
…On 20 Jun 2023, at 14:53, Mark Grondona wrote:
> If we can figure out why FLUX_CORE_VERSION_STRING is not being put
> into flux.constants,
I think the problem is that enumerated constants are the only thing
put into `flux.constants`, all the `#define` constants are dropped. I
know nothing about cffi, so I'm not sure if this is because cffi just
can't handle defined constants or... @trws would probably know.
That is I presume why we have this in `_core_preproc.py`:
https://urldefense.us/v3/__https://github.com/flux-framework/flux-core/blob/e915f2c492be9e16e7346c42176f256c7dc37480/src/bindings/python/_flux/_core_build.py*L32__;Iw!!G2kpM7uM-TzIFchu!w8Xes5bzPJvKYAkuE0LPcTn335L4eKkye6OfiJ3J_dDp00ViTQSZJgObyN4v5i-2nO3MVlsUiJ9fuNxvtMdrKJS1D3c$
--
Reply to this email directly or view it on GitHub:
https://urldefense.us/v3/__https://github.com/flux-framework/flux-core/pull/5281*issuecomment-1599614024__;Iw!!G2kpM7uM-TzIFchu!w8Xes5bzPJvKYAkuE0LPcTn335L4eKkye6OfiJ3J_dDp00ViTQSZJgObyN4v5i-2nO3MVlsUiJ9fuNxvtMdrbA4vWC8$
You are receiving this because you were mentioned.
Message ID:
***@***.***>
|
I initially thought this might have been a dumb thing, like we weren't including |
That sounds great, thanks @chu11 ! I directed the maestro developer how to get the version via an attribute, which should work for now. I also think they might just be calling |
Since we opened #5285 to follow this up and the user has a workaround, it looks like the PR can be closed. |
Problem: Python tools that use Flux want custom logic based on the version, and we currently do not easily expose it.
Solution: create a flux.version "attribute" that calls into a module to call flux_core_version_string().