-
Notifications
You must be signed in to change notification settings - Fork 6
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
Avoid creating a new internal interpreter if DLite is called from Python #907
Conversation
From discussion with @francescalb: This is a fundamental change in DLite that we should be carefully thought and tested before merged in. At the same time, we believe that this PR provides a better solution for running plugins that will create less confusion in the long run. To avoid having to maintain two development branches, we suggest the following:
This way of handling possible breaking changes could be formalised and standardised. We are For example already using deprecation warnings, but not very formalised. We should add a plan for when removing deprecated features. Can the new environment variable be use for other behaviour changes as well? Or is it simpler to make a series of related environment variables, one for each feature to change (and test for)? If we go for the latter, would |
@@ -52,14 +52,18 @@ DLite-specific environment variables | |||
- **DLITE_ATEXIT_FREE**: Free memory at exit. This might be useful to avoid | |||
getting false positive when tracking down memory leaks with tools like valgrind. | |||
|
|||
- **DLITE_BEHAVIOR_<name>**: Enables/disables the behavior `<name>`. | |||
- **DLITE_BEHAVIOR**: Enables/disables the all behaviors by default. |
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.
No, not al behaviours. Must be rewritten. This is only for behaviour changes, right?
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.
This option actually turns on/off all behaviors by default. It used for testing (assuming that the behavior changes are independent).
Where in the code is this warning included? I think it is way to long. It should be one line and point to the documentation. |
It is defined here: https://github.com/SINTEF/dlite/pull/907/files#diff-dd7c9a4ea160143771ecce3a127eb8157401075c16cd8524b91d00caae1fbb36L125 |
Description
If DLite is called from Python, run the Python storage plugins from the calling interpreter.
Edit (new since first review): The suggestion in the comment below is now implemented. By default is the old behavior kept for now. The new behavior will be the default from v0.7.0.
When importing DLite from Python, the user will now get follow warning message printed to stderr:
You can get rid of this warning by defining the environment variable
DLITE_BEHAVIOR_singleInterpreter
(orDLITE_BEHAVIOR
).Edit2: Shortened the warning message to:
Added new page about how to configure behavior changes to the user guide.
The motivation for this PR was to investigate the following benefits:
Both of these benefits should be investigated further. Possible drawbacks should also be checked.
Type of change
Checklist for the reviewer
This checklist should be used as a help for the reviewer.