diff --git a/setup.py b/setup.py index e304e9f7..1664905b 100644 --- a/setup.py +++ b/setup.py @@ -58,6 +58,7 @@ description='The SolveBio Python client', long_description=long_description, long_description_content_type='text/markdown', + python_requires='>=3.8', author='Solve, Inc.', author_email='contact@solvebio.com', url='https://github.com/solvebio/solvebio-python', diff --git a/solvebio/__init__.py b/solvebio/__init__.py index 8f5cd14b..460b3848 100644 --- a/solvebio/__init__.py +++ b/solvebio/__init__.py @@ -103,7 +103,6 @@ def _set_cached_api_host(host): from .global_search import GlobalSearch from .annotate import Annotator, Expression from .client import client, SolveClient -from .auth import authenticate from .resource import ( Application, Beacon, diff --git a/solvebio/__main__.py b/solvebio/__main__.py index 9070a092..4e063336 100644 --- a/solvebio/__main__.py +++ b/solvebio/__main__.py @@ -1,6 +1,3 @@ - -import sys - from .cli.main import main if __name__ == "__main__": diff --git a/solvebio/auth.py b/solvebio/auth.py index ac39e284..47e78e56 100644 --- a/solvebio/auth.py +++ b/solvebio/auth.py @@ -58,22 +58,22 @@ def authenticate( # Find credentials from environment variables if not host: host = ( - os.environ.get("QUARTZBIO_API_HOST", None) - or os.environ.get("EDP_API_HOST", None) - or os.environ.get("SOLVEBIO_API_HOST", None) + os.environ.get("QUARTZBIO_API_HOST", None) or + os.environ.get("EDP_API_HOST", None) or + os.environ.get("SOLVEBIO_API_HOST", None) ) if not token: api_key = ( - os.environ.get("QUARTZBIO_API_KEY", None) - or os.environ.get("EDP_API_KEY", None) - or os.environ.get("SOLVEBIO_API_KEY", None) + os.environ.get("QUARTZBIO_API_KEY", None) or + os.environ.get("EDP_API_KEY", None) or + os.environ.get("SOLVEBIO_API_KEY", None) ) access_token = ( - os.environ.get("QUARTZ_ACCESS_TOKEN", None) - or os.environ.get("EDP_ACCESS_TOKEN", None) - or os.environ.get("SOLVEBIO_ACCESS_TOKEN", None) + os.environ.get("QUARTZ_ACCESS_TOKEN", None) or + os.environ.get("EDP_ACCESS_TOKEN", None) or + os.environ.get("SOLVEBIO_ACCESS_TOKEN", None) ) if access_token: @@ -184,4 +184,4 @@ def validate_api_host_url(url): elif not parsed.netloc: raise SolveError("Invalid API host: %s." % url) - return parsed.geturl() \ No newline at end of file + return parsed.geturl() diff --git a/solvebio/cli/auth.py b/solvebio/cli/auth.py index c215bf84..ba147243 100644 --- a/solvebio/cli/auth.py +++ b/solvebio/cli/auth.py @@ -81,4 +81,4 @@ def print_user(user): email = user['email'] domain = user['account']['domain'] print(f'You are logged-in to the "{domain}" domain as {email}' - f' (server: {solvebio.get_api_host()}).') + f' (server: {solvebio.get_api_host()}).') diff --git a/solvebio/cli/credentials.py b/solvebio/cli/credentials.py index a28c9051..0e2d155d 100644 --- a/solvebio/cli/credentials.py +++ b/solvebio/cli/credentials.py @@ -109,7 +109,7 @@ def get_credentials(api_host: str = None) -> ApiCredentials: # available option that ends with '.api.quartzbio.com', netrc_host = next( filter(lambda h: h.endswith(".api.quartzbio.com"), netrc_obj.hosts), None - ) + ) # Otherwise use the first available. if netrc_host is None: diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index 6ca60392..9917ab1b 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -1044,10 +1044,6 @@ def _ls(full_path, recursive=False, follow_shortcuts=False): return files -def _is_single_file(objects): - return len(objects) == 1 and objects[0].get("object_type") == "file" - - def should_tag_by_object_type(args, object_): """Returns True if object matches object type requirements""" valid = True