mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 15:37:32 +08:00
Revert some requests import changes
introduced in https://github.com/galaxyproject/galaxy/pull/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`
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import argparse
|
||||
import json
|
||||
|
||||
import requests
|
||||
import yaml
|
||||
|
||||
from galaxy.util import requests
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Upload a directory into a data library")
|
||||
|
||||
@@ -5,7 +5,7 @@ Sample script for Galaxy Search API
|
||||
import json
|
||||
import sys
|
||||
|
||||
from galaxy.util import requests
|
||||
import requests
|
||||
|
||||
|
||||
class RemoteGalaxy:
|
||||
|
||||
@@ -7,14 +7,7 @@ import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
from galaxy.util import requests
|
||||
except ImportError:
|
||||
print(
|
||||
"Could not import the requests module. See http://docs.python-requests.org/en/latest/"
|
||||
" or install with 'pip install requests'"
|
||||
)
|
||||
raise
|
||||
import requests
|
||||
|
||||
|
||||
def upload_file(base_url, api_key, history_id, filepath, **kwargs):
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
import os
|
||||
|
||||
import click
|
||||
import requests
|
||||
from tusclient import client
|
||||
from tusclient.storage import filestorage
|
||||
|
||||
from galaxy.util import requests
|
||||
|
||||
UPLOAD_ENDPOINT = "/api/upload/resumable_upload"
|
||||
SUBMISSION_ENDPOINT = "/api/tools/fetch"
|
||||
CHUNK_SIZE = 10**7
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from galaxy.util import requests
|
||||
import requests
|
||||
|
||||
|
||||
def delete(api_key, url, data, return_formatted=True):
|
||||
|
||||
Reference in New Issue
Block a user