You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Import order causes warnings when working with epicscorelibs and softioc #23
As epicscorelibs maintains its own libca, it provides the option to set the 'CATOOLS_LIBCA_PATH' before using cothread. This can be found here. This mechanism does not appear to be ideal.
For example, softioc uses this mechanism here. The problem comes when another program attempts to use both softioc and cothread itself. A simple program such as the following:
will result in the following error (and potentially problematic behaviour):
$ ./test_imports.py
/path/to/pipenv/environment/lib/python3.7/site-packages/epicscorelibs/path/cothread.py:18: UserWarning: epicscorelibs.path.cothread must be imported before cothread.catools to have effect
warnings.warn("epicscorelibs.path.cothread must be imported before cothread.catools to have effect")
There are two problems:
It is not immediately clear what is causing the error
If using standard tools such as isort, you need to manually force a particular order of imports to avoid this error. You need to isort:skip multiple lines of code
I am not sure why cothread does not use epicscorelibs by default. Would it be possible to implement this?
Alternatively, some kind of conditional import of epicscorelibs could be useful.
The message quoted above is a warning, not an error message. Does some misbehavior result? Or is this only a case of wanting to clear up a nuisance warning? (imo. a valid request, just not an "error")
I believe there is no technical issue caused by the warning for us. There is potential for an issue in strict tests that check for no warnings being emitted, but I don't offhand know of any of these. I believe this is mostly just getting rid of the nuisance (and, as stated in the linked epicscorelibs issue, an incorrect) warning
changed the title [-]Import order causes errors when working with epicscorelibs and softioc[/-][+]Import order causes warnings when working with epicscorelibs and softioc[/+]on Sep 4, 2023
Think you're right, have edited the title accordingly. I think this was flagged because it was causing concerns about the possibility of something having gone wrong elsewhere.
Activity
AlexanderWells-diamond commentedon Aug 31, 2023
After discussion with @Araneidae , we believe this is actually an issue in epicscorelibs. I've raised an issue there and will update this one based on the outcome of that: https://github.com/mdavidsaver/epicscorelibs/issues/22
mdavidsaver commentedon Sep 4, 2023
The message quoted above is a warning, not an error message. Does some misbehavior result? Or is this only a case of wanting to clear up a nuisance warning? (imo. a valid request, just not an "error")
AlexanderWells-diamond commentedon Sep 4, 2023
I believe there is no technical issue caused by the warning for us. There is potential for an issue in strict tests that check for no warnings being emitted, but I don't offhand know of any of these. I believe this is mostly just getting rid of the nuisance (and, as stated in the linked epicscorelibs issue, an incorrect) warning
[-]Import order causes errors when working with epicscorelibs and softioc[/-][+]Import order causes warnings when working with epicscorelibs and softioc[/+]Araneidae commentedon Sep 4, 2023
Think you're right, have edited the title accordingly. I think this was flagged because it was causing concerns about the possibility of something having gone wrong elsewhere.
mdavidsaver commentedon Sep 4, 2023
Ok, that is clear. I see this as a "bootstrapping" issue between cothread and epicscorelibs, which needs to be straightened out somehow.