-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add galaxy to user agent #18003
Add galaxy to user agent #18003
Conversation
Very cool typing stuff in there! I'll have to revisit that and dig in more - looks great. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for belated review, if you agree these comments make sense, I can open a PR to fix them.
@@ -26,6 +26,7 @@ | |||
stream_to_file, | |||
stream_url_to_file, | |||
) | |||
from galaxy.util import user_agent # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed any more as well, I think?
@@ -133,6 +133,7 @@ | |||
build_tours_registry, | |||
ToursRegistry, | |||
) | |||
from galaxy.util import user_agent # noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed any more, right?
@@ -4,7 +4,7 @@ | |||
import os | |||
import urllib.parse | |||
|
|||
import requests | |||
from galaxy.util import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be moved after the gitlab import try/except.
import yaml | ||
|
||
from galaxy.util import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make much sense for this and the other scripts in scripts/api/
as they are meant to be example for how to connect to a Galaxy instance (not from a Galaxy server).
@@ -1,4 +1,4 @@ | |||
import requests | |||
from galaxy.util import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one was also not needed, I think.
@@ -68,6 +67,8 @@ | |||
Self, | |||
) | |||
|
|||
from galaxy.util import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be moved after the try/except imports (and can be rewritten as from . import requests
).
Yes, that'd be great, thank you @nsoranzo! |
introduced in galaxyproject#18003 . In particular, when using requests in the tests to connect to Galaxy or the ToolShed it's not needed to use the modified headers. Also: - Move some imports after conditional imports. - Fix type annotations in `lib/tool_shed/test/base/populators.py` - Fix typo bug in `test/unit/util/test_get_url.py`
introduced in galaxyproject#18003 . In particular, when using requests in the tests to connect to Galaxy or the ToolShed it's not needed to use the modified headers. Also: - Move some imports after conditional imports. - Fix type annotations in `lib/tool_shed/test/base/populators.py` - Fix typo bug in `test/unit/util/test_get_url.py`
introduced in galaxyproject#18003 . In particular, when using requests in the tests to connect to Galaxy or the ToolShed it's not needed to use the modified headers. Also: - Move some imports after conditional imports. - Fix type annotations in `lib/tool_shed/test/base/populators.py` - Fix typo bug in `test/unit/util/test_get_url.py`
Builds on #17578 but avoids global manipulation of requests. Should eventually also fix #17995
How to test the changes?
(Select all options that apply)
License