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

Deprecated CLI plugins #124

Merged
merged 5 commits into from Nov 27, 2019
Merged

Deprecated CLI plugins #124

merged 5 commits into from Nov 27, 2019

Conversation

sbesson
Copy link
Member

@sbesson sbesson commented Nov 19, 2019

Fixes #22 - see #23 for the previous attempt and #123 for a similar issue.

c81c3e6 ensures the plugins under omero/plugins are sorted before being loaded and registered as controls. 9160a88 renames the upload and metadata plugins as _upload_deprecated.py and _metadata_deprecated.py. This renaming should ensure the plugins are always loaded and registered first so that they can be overriden by another register_only call if the decoupled omero-metadata and omero-upload libraries are also installed.

This PR should be tested in a virtualenvironment in two steps

  1. omero-py alone with no plugins installed
python3 -m venv venv
venv/bin/pip install git+git://github.com/snoopycrimecop/omero-py@py3_ci#egg=omero-py
venv/bin/omero upload foo # should display a deprecation warning
venv/bin/omero metadata -h  # should fail
OMERO_DEV_PLUGINS=true venv/bin/omero metadata -h # should display the help
  1. omero-py with plugins installed
venv/bin/pip install git+git://github.com/snoopycrimecop/omero-metadata@py3_ci#egg=omero-metadata
venv/bin/pip install git+git://github.com/snoopycrimecop/omero-upload@py3_ci#egg=omero-upload
venv/bin/omero upload foo # should work without warnings
venv/bin/omero metadata -h  # should display the help message

@sbesson
Copy link
Member Author

sbesson commented Nov 21, 2019

As suggested by ome/openmicroscopy#6183, the main breaking change associated with this proposal (or the alternate class removal) is that from omero.plugins.metadata would now unambiguously fail in an environment where only omero-py is installed but not omero-metadata.

@dominikl
Copy link
Member

With omero-py alone, should OMERO_DEV_PLUGINS=true ./omero metadata ... not display the deprecation warning too?
After installing the plugins I get ModuleNotFoundError: No module named 'path'. For some reason that sounds familiar...

@dominikl
Copy link
Member

I also still get the deprecation warning. Maybe I'm missing something...

(venv) ➜  bin pip freeze
future==0.18.2
omero-metadata==0.5.dev2
omero-py==5.6.dev6
omero-upload==0.3.dev2
Pillow==6.2.1
pkg-resources==0.0.0
PyYAML==5.1.2
zeroc-ice==3.6.5
(venv) ➜  bin ./omero upload test.txt
Error loading: /home/dominik/tmp/venv/lib/python3.6/site-packages/omero/plugins/upload.py
Traceback (most recent call last):
  File "/home/dominik/tmp/venv/lib/python3.6/site-packages/omero/cli.py", line 1657, in loadpath
    execfile(str(pathobj), loc)
  File "/home/dominik/tmp/venv/lib/python3.6/site-packages/past/builtins/misc.py", line 87, in execfile
    exec_(code, myglobals, mylocals)
  File "/home/dominik/tmp/venv/lib/python3.6/site-packages/omero/plugins/upload.py", line 17, in <module>
    from omero_upload.cli import UploadControl, HELP
  File "/home/dominik/tmp/venv/lib/python3.6/site-packages/omero_upload/cli.py", line 23, in <module>
    import path
ModuleNotFoundError: No module named 'path'
This module is deprecated as of OMERO 5.5.0. Use the module available from https://pypi.org/project/omero-upload/ instead.
Previously logged in to merge-ci-devspace.openmicroscopy.org:4064 as user-3
...

@sbesson
Copy link
Member Author

sbesson commented Nov 26, 2019

With omero-py alone, should OMERO_DEV_PLUGINS=true ./omero metadata ... not display the deprecation warning too?

You are correct, both deprecated plugins should display the same message to end users, I will look into adding some message.

After installing the plugins I get ModuleNotFoundError: No module named 'path'. For some reason that sounds familiar...

That's related to #123. The same exception handling as in ome/omero-dropbox#8 will need to be opened against omero_upload.
I suspect the last error you are seeing is because the omero_upload import fails due to path/omero_ext.path and thus bin ./omero upload test.txt falls back to the deprecated upload plugin.

@will-moore
Copy link
Member

All working exactly as described in the description. 👍

@joshmoore
Copy link
Member

Thanks, all.

@joshmoore joshmoore added this to In progress in OMERO.server 5.6.0 (Python 3) via automation Nov 27, 2019
@joshmoore joshmoore merged commit 201b37f into ome:master Nov 27, 2019
OMERO.server 5.6.0 (Python 3) automation moved this from In progress to Done Nov 27, 2019
@sbesson sbesson deleted the deprecated_plugins branch November 27, 2019 15:35
@joshmoore joshmoore added this to the 5.6.0 milestone Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

omero-metadata installation issue
4 participants