Populate metadata deprecation#5831
Conversation
For both the populate_metadata module and the MetadataControl class, add a DeprecationWarning suggesting to use https://github.com/ome/omero-metadata instead.
manics
left a comment
There was a problem hiding this comment.
The deprecation warning is printed twice since the warning is in two places, but that's not a big deal.
👍
| "This module is deprecated as of OMERO 5.4.8. Use the module" | ||
| " in the omero-metadata project available from" | ||
| " https://pypi.org/project/omero-metadata/ instead.", | ||
| DeprecationWarning) |
There was a problem hiding this comment.
While testing an import, I just realized that this warning is displayed on every import of omero.util.populate_metadata. Concretely that implies it will show up every invocation of the CLI since the first step is to load the plugins even if they are not registered.
Although harmless, my feeling is that this is fairly annoying in terms of user experience. I will look at moving the deprecation warning under the main classes like ParsingContext instead so that the warning happens at run-time and does not create unnecessary noise.
There was a problem hiding this comment.
Ponderating the comment above, as per https://docs.python.org/2/library/warnings.html#warning-categories, DeprecationWarning is ignored by default on Python 2.7. If we still wanted to reduce the CLI noise on Python 2.6, https://docs.python.org/2/library/warnings.html#available-context-managers would certainly be a way to silence these warnings.
There was a problem hiding this comment.
I doubt that Python 2.6 is worth any avoidable effort at all.
There was a problem hiding this comment.
Perhaps add this:
$ grep warnings bin/omero
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
This deprecates the metadata modules distributed as part of OMERO.py. The content of these classes has been migrated to https://github.com/ome/omero-metadata available from PyPI and future updates/fixes/improvements will be carried out there.
Upstream tests should remain functional and passing but any usage of the modules e.g. when using the CLI plugin via
should display the deprecation warning.
See also discussion at ome/omero-parade#47 (comment)