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

Decouple python #6100

Merged
merged 22 commits into from
Sep 6, 2019
Merged

Decouple python #6100

merged 22 commits into from
Sep 6, 2019

Conversation

joshmoore
Copy link
Member

@joshmoore joshmoore commented Aug 13, 2019

This PR removes the Python source code and unit tests from underneath tools/Omero{Py,Web,FS} in favor of downloading the decoupled code (and lib/scripts) either from PyPI or GitHub. The goal is to have the OMERO.server and OMERO.py zips and dockers function identically to before this PR. Additional work on the decoupled PRs should then allow ignoring the downloaded code that is in those zips in favor of a pip installed version.

The primary downside of this PR is that merge-ci will be pinned to version 5.5.1 of the decoupled software until changes are made to merge PRs on the new repositories and download that updated code.

The current intent is that the integration tests in the main repository will continue to run until a job can be created to run the separated tests.

  • remove scripts
  • download scripts
  • remove OmeroPy
  • download OmeroPy
  • remove OmeroWeb
  • download OmeroWeb
  • remove OmeroFS
  • download OmeroFS

cc: @ome/python

@will-moore
Copy link
Member

will-moore commented Aug 20, 2019

My notes on using this branch:

git checkout -f josh/decouple-python
ls dist/lib/python/      # still exists
rm -rf dist/lib/python/

# checked out omero-py and omero-web, then
cd omero-py
python setup.py build

cd omero-web
python setup.py build

# added .pth files to my site-packages
which python
  /Users/willadmin/Virtual/omero/bin/python
cat /Users/willadmin/Virtual/omero/lib/python2.7/site-packages/omero_py.pth
  /Users/willadmin/Desktop/PYTHON/omero-py/build/lib
cat /Users/willadmin/Virtual/omero/lib/python2.7/site-packages/omero_web.pth

# tried importing...
python
>>> import omero
>>> omero.__file__
'/Users/willadmin/Desktop/PYTHON/omero-py/build/lib/omero/__init__.pyc'
>>> import omeroweb
>>> omeroweb.__file__
'/Users/willadmin/Desktop/WEB/omero-web/build/lib/omeroweb/__init__.py'

# Try running omeroweb from source
cd omero-web
python omeroweb/manage.py runserver 4080
...
  File "/Users/willadmin/Desktop/MARSHAL/omero-marshal/omero_marshal/__init__.py", line 54, in get_schema_version
    raise Exception("Invalid OMERO version number: " + version)
Exception: Invalid OMERO version number: 5.5.dev1

# fixed with changes to omero_marshal.__init__.py
-VERSION_REGEXP = re.compile(r'^(\d+\.\d+\.\d+)')
+VERSION_REGEXP = re.compile(r'^(\d+\.\d+\.[a-z]*\d+)')
-    v = StrictVersion(m.group(1))
+    v = StrictVersion(m.group(1).replace('dev', ''))


python omeroweb/manage.py runserver 4080

gives me the login page, without any static files.
http://localhost:4080/webclient/login/ 

UPDATE:
omero.web.debug=True was being ignored (False) because OMERO_HOME wasn't set.
Fixed in joshmoore/omero-web#1

@joshmoore
Copy link
Member Author

Thanks for testing a omero-marshal fix, @will-moore. I went ahead and opened a PR using pip install ...joshmoore...archive...zip from merge-ci's OMERO-web job in order to get things running.

@will-moore
Copy link
Member

Maybe also delete https://github.com/joshmoore/openmicroscopy/tree/decouple-python/etc/templates/web and move these to omero-web.
They are needed for tests at test/unit/clitest/test_web.py.

@joshmoore
Copy link
Member Author

They do already exist at https://github.com/ome/omero-web/tree/master/templates but you're right they need deleting. I'll push a commit which copies them to the right location in ome/openmicroscopy.

@will-moore
Copy link
Member

Ah - I realise that the test/unit/clitest/test_web.py is in omero-py not omero-web.

@joshmoore
Copy link
Member Author

Good catch. Should definitely also be migrated.

@joshmoore
Copy link
Member Author

Waiting on a few minor reviews from @sbesson (e.g. ome/omero-gradle-plugins#11) then will merge this PR and apply the necessary devspace changes (ome/devspace#153) to latest-ci. 🤞 for a green build Monday AM.

@joshmoore
Copy link
Member Author

joshmoore commented Sep 6, 2019

Alright. Related PRs are all merged and changes from merge-ci have been applied to latest-ci. Merging this and re-running the latest-ci Trigger.

With the Python code removed, the excluded PRs can be updated to only contain the integration test changes. I'll update #6055 to match ome/omero-web#3 as an example.

Trigger runs:

@joshmoore joshmoore merged commit b483fcc into ome:develop Sep 6, 2019
@joshmoore joshmoore deleted the decouple-python branch September 6, 2019 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants