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

make code python3 compatible #119

Closed
wants to merge 13 commits into from
Closed

Conversation

atarkowska
Copy link
Member

@atarkowska atarkowska commented Dec 12, 2018

This PR make code py3 compatible. Related to ome/omero-marshal#55

@manics
Copy link
Member

manics commented Dec 14, 2018

The print and exception changes look fine. To get this working under Python 3 will require a lopt more changes, such as replacing removed modules such as from HTMLParser import HTMLParser in artifacts.py.

from datetime import datetime
import os
import logging
import re
import ssl
import urllib2
try:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont like this but otherwise we have to refactor all the imports

@atarkowska
Copy link
Member Author

atarkowska commented Dec 14, 2018

So far I have download working

(py36_omero) Olas-MacBook-Pro:omego.git ola$ omego download --ice 3.6 --release 5.4 py
2018-12-14 19:07:39,198 [omego.artifa] INFO  Checking https://downloads.openmicroscopy.org/omero/5.4.9/artifacts/OMERO.py-5.4.9-ice36-b101.zip
2018-12-14 19:07:39,198 [omego.fileut] INFO  Downloading https://downloads.openmicroscopy.org/omero/5.4.9/artifacts/OMERO.py-5.4.9-ice36-b101.zip
2018-12-14 19:07:40,814 [omego.artifa] INFO  Unzipping OMERO.py-5.4.9-ice36-b101.zip

and

(py36_omero) Olas-MacBook-Pro:omego.git ola$ omego install --initdb --dbhost localhost --dbname omero --prestartfile $HOME/config.omero -v --release 5.3.5 --ice 3.6 --no-web
...
2018-12-14 19:11:01,777 [omego.fileut] DEBUG Extracting OMERO.server-5.3.5-ice36-b73/bin/omero to .
2018-12-14 19:11:01,779 [omego.upgrad] DEBUG Server directory: ./OMERO.server-5.3.5-ice36-b73
2018-12-14 19:11:01,779 [omego.upgrad] INFO  Installing ./OMERO.server-5.3.5-ice36-b73 (OMERO.server)...
2018-12-14 19:11:01,779 [omego.extern] DEBUG Setting up omero CLI
Traceback (most recent call last):
  File "/Users/ola/venv/py36_omero/bin/omego", line 11, in <module>
    load_entry_point('omego', 'console_scripts', 'omego')()
  File "/Users/ola/OMERO/omego.git/omego/main.py", line 54, in entry_point
    (Version.NAME, Version)])
  File "/Users/ola/venv/py36_omero/lib/python3.6/site-packages/yaclifw/framework.py", line 188, in main
    ns.func(ns)
  File "/Users/ola/OMERO/omego.git/omego/upgrade.py", line 531, in __call__
    UnixInstall(self.NAME, args)
  File "/Users/ola/OMERO/omego.git/omego/upgrade.py", line 58, in __init__
    self.external.setup_omero_cli()
  File "/Users/ola/OMERO/omego.git/omego/external.py", line 126, in setup_omero_cli
    import omero.cli
  File "/Users/ola/OMERO/omego.git/OMERO.server-5.3.5-ice36-b73/lib/python/omero/cli.py", line 72
    print "Deprecated warning: use the 'bin/omero --debug=x [args]' to debug"
                                                                            ^
SyntaxError: Missing parentheses in call to 'print'

which is OMERO related
see travis build for more details

@atarkowska
Copy link
Member Author

atarkowska commented Dec 18, 2018

@manics I believe majority is fixed now, but the problem is system_site_pakackes flag that was removed as it only works in py2.7 see https://travis-ci.org/ome/omego/builds/469281124

Travis is failing due to permission issues, not sure how to solve it, ideas?

@joshmoore
Copy link
Member

Travis is failing due to permission issues, not sure how to solve it, ideas?

It's due to the removal of virtualenv. python setup.py sdist install now fails. You'll have to either re-add virtualenv or install to a different location with --prefix.

@manics
Copy link
Member

manics commented Dec 18, 2018

travis-ci/travis-ci#4260 (comment) claims system-site-packages only works with the default versions of Python, could try 3.5 instead of 3.4?

$ docker run -it --rm ubuntu:16.04
root@557623f2bc17:/# apt-get update
root@557623f2bc17:/# apt-get install python python3

root@557623f2bc17:/# python --version
Python 2.7.12
root@557623f2bc17:/# python3 --version
Python 3.5.2

@atarkowska
Copy link
Member Author

atarkowska commented Dec 18, 2018

I tried 3.4 and 3.6, will try 3.5 then ;-)

@@ -170,7 +178,7 @@ def __init__(self, name, perms):
self.mox.StubOutWithMock(os, 'chmod')

files = ['test/', 'test/a', 'test/b/', 'test/b/c']
perms = [0755, 0644, 0755, 0550]
perms = [755, 644, 755, 550]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are octal, so the 0 prefix should be kept:

>>> 0755
493
>>> 755
755

@atarkowska atarkowska force-pushed the python3 branch 2 times, most recently from 1a87d0f to 75f4a50 Compare January 7, 2019 11:55
@manics
Copy link
Member

manics commented Oct 10, 2019

#122 enables full support for Python 3.6

@sbesson
Copy link
Member

sbesson commented Nov 8, 2019

Closing as per #122 (now available as a pre-release)

@sbesson sbesson closed this Nov 8, 2019
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.

4 participants