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
Python 3 support. #1715
Comments
wchartype is just one file with 200 lines it seems, we should probably just bring that into util and update from Python 3 |
This comment has been minimized.
This comment has been minimized.
sanitizie_html.py is mostly copied from feedparser and uses sgmllib that is not part of python 3 anymore. |
This comment has been minimized.
This comment has been minimized.
Mercurial is used in Galaxy for tool installations and non-installable-revision updates. |
@natefoo Feel free to update the issue description for anything missing/wrong!
Do you think we can get rid of it or use python-hglib? |
Or hgapi, possibly. Some parts will be easier than others. There is some pretty low level stuff going on for example here, that would need to be reimplemented. |
Given that the hg ts api was deprecated in 15.10, can we please get rid of it instead of re-implementing it? |
|
That said, I am in favor of removing any Galaxy-side hg installation stuff and not opposed to changing the TS repos to another format (but that would be a lot of work). |
@natefoo sorry for nitpicking, but
sounds like there should be zero access to the TS HG api, whether push or pull.
yeah, we aren't going to change the backend format any time soon for TS1. If there's any way we can look at fixing the clone + on-disk update method with tarballs or similar as an interim fix... |
Perhaps a poorly worded notification, unless I'm wrong and that was really the intent. But if it was, there's no replacement for installs at this time. @martenson ? |
@natefoo I'm sure you're right, I'm just reading it too |
There is a small problem when When you create a .tar.gz archive of a file with chmod 444 and you upload it in the tool shed, galaxy can not overwrite the read only file anymore (in an upcoming revision). The only way to overwrite or remove such file is by using mercurial. |
@yhoogstrate That's a bug. =) |
Indeed, @yhoogstrate can you open a separate issue with all the details to reproduce? |
`logging.exception()` already adds the the exception information after the supplied message. Also: the `message` attribute of `Exception` class has been dropped in Python 3, always use `str(e)`. xref. galaxyproject#1715
Follow-up on galaxyproject#5787 . xref. galaxyproject#1715
Follow-up on galaxyproject#5787 . xref. galaxyproject#1715
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I've seen it, thanks a lot! Got my first Python3.7-powered Galaxy up and running just seconds ago 👍 🥇 |
Think I'll raise an issue over at pysam though that it would be great if they could provide a whl for 0.15.1 so that you don't have to have devel libs installed to build it yourself. |
Should we open individual issues for Python 3 bugs? I got this when attempting to install a tool from the TS: Traceback (most recent call last):
File "lib/galaxy/web/framework/middleware/error.py", line 154, in __call__
app_iter = self.application(environ, sr_checker)
File "/home/nate/work/galaxy2/.venv/lib/python3.5/site-packages/paste/recursive.py", line 85, in __call__
return self.application(environ, start_response)
File "/home/nate/work/galaxy2/.venv/lib/python3.5/site-packages/paste/httpexceptions.py", line 640, in __call__
return self.application(environ, start_response)
File "lib/galaxy/web/framework/base.py", line 143, in __call__
return self.handle_request(environ, start_response)
File "lib/galaxy/web/framework/base.py", line 222, in handle_request
body = method(trans, **kwargs)
File "lib/galaxy/web/framework/decorators.py", line 101, in decorator
return func(self, trans, *args, **kwargs)
File "lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py", line 892, in prepare_for_install
repo_information_dict = json.loads(raw_text)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes' |
I think so, maybe even with own github label.
…On Wed, Apr 17, 2019, 16:18 Nate Coraor ***@***.***> wrote:
Should we open individual issues for Python 3 bugs? I got this when
attempting to install a tool from the TS:
Traceback (most recent call last):
File "lib/galaxy/web/framework/middleware/error.py", line 154, in __call__
app_iter = self.application(environ, sr_checker)
File "/home/nate/work/galaxy2/.venv/lib/python3.5/site-packages/paste/recursive.py", line 85, in __call__
return self.application(environ, start_response)
File "/home/nate/work/galaxy2/.venv/lib/python3.5/site-packages/paste/httpexceptions.py", line 640, in __call__
return self.application(environ, start_response)
File "lib/galaxy/web/framework/base.py", line 143, in __call__
return self.handle_request(environ, start_response)
File "lib/galaxy/web/framework/base.py", line 222, in handle_request
body = method(trans, **kwargs)
File "lib/galaxy/web/framework/decorators.py", line 101, in decorator
return func(self, trans, *args, **kwargs)
File "lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py", line 892, in prepare_for_install
repo_information_dict = json.loads(raw_text)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))TypeError: the JSON object must be str, not 'bytes'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1715 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN3DKVPNJ4FPFMTFWJMH3DPQ6A2RANCNFSM4B3A7SKA>
.
|
This comment has been minimized.
This comment has been minimized.
We are now using the area/python3 label to tag Python3-related issues/PRs instead of cross-referencing this issue. |
This comment has been minimized.
This comment has been minimized.
If I am making a new library for potential future use by Galaxy (say for exporting workspace as RO-Crate) - am I OK to do this in Python 3 or do I need to make it backwards compatible to Python 2? From the progress in here it sound like I can dare to be modern..! :) |
IMO go for python 3. We will have a deprecation notice in the upcoming release and 19.09 should be the last release that officially supports python 2. |
Congrats @nsoranzo, this is an accomplishment spearheaded by you that many people will benefit from. Thank you! |
Indeed, what a huge effort. I remember when this was started at GCC in Norwich and then later at ISMB in Dublin. Thanks a lot, @nsoranzo and everyone involved! |
Python 2.7 will not be maintained past 2020.
Moreover, some Galaxy dependencies dropped Python2 support: cachetools, cmd2, cwltool, numpy, schema-salad
Add support for Python >= 3.5 while maintaining support for Python 2.7.
xref.: https://trello.com/c/dZcCVf9I/2702-migrate-to-python-3
Useful tools and documentation
https://docs.python.org/3/howto/pyporting.html
https://docs.python.org/2/library/2to3.html
http://python-future.org/
https://six.readthedocs.io/
http://python3porting.com/
Dependencies which need to be ported, dropped or updated
subprocess
instead of using the Mercurial API Update Mercurial to Py3-compatible v5.2, and all other deps #9065scripts/bootstrap_history.py
, should be replaced with PyGithubTips
to port a file to Python3, then revert unnecessary changes and use
six
for anything that breaks Python2.7keys()
,values()
oritems()
methods of adict
insidelist( )
, it may be unnecessary, e.g. if thedict
is just iterated over a loop. But if items are added or deleted from thedict
(changing its size) inside the loop, then making a copy of it withlist( )
is necessary.at the top of a file when changing
print
toprint()
in it.UserDict.DictMixin
withcollections.(Mutable)Mapping
and add missing methods to the class inheriting from itstring.letters
,string.lowercase
andstring.uppercase
withstring.ascii_letters
,string.ascii_lowercase
andstring.ascii_uppercase
respectivelystring.maketrans
to:pipes.quote()
tosix.moves.shlex_quote()
filter()
andmap(lambda ...)
to list comprehensions or generator expressionsd
is adict
, change:to:
__nonzero__()
method, this should be renamed to__bool__()
and after its definition, the following alias should be added:long
type is needed, add the following line after the imports:async
andawait
are keywords, variables with these names need to be renamed.subprocess.check_output()
is a bytestring. If this value is going to be processed as a string, it needs to be decoded.The text was updated successfully, but these errors were encountered: