Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
SolveBio Python Client
======================

# This package is deprecated. Please install and use quartzbio instead:

```bash
pip install quartzbio
```

**This package will no longer be maintained after March 31, 2026.**

**Migration guide: [https://github.com/quartzbio/quartzbio-python](https://github.com/quartzbio/quartzbio-python)**

This is the SolveBio Python package and command-line interface (CLI).
This module is tested against Python 2.7, 3.6, 3.7, 3.8, 3.10, PyPy and PyPy3.

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
setup(
name='solvebio',
version=VERSION,
description='The SolveBio Python client',
description='The SolveBio Python client (DEPRECATED)',
long_description=long_description,
long_description_content_type='text/markdown',
python_requires='>=3.8',
Expand All @@ -74,6 +74,7 @@
'solvebio-recipes = recipes.sync_recipes:sync_recipes']
},
classifiers=[
'Development Status :: 7 - Inactive',
'Intended Audience :: Science/Research',
'Operating System :: OS Independent',
'Programming Language :: Python',
Expand Down
42 changes: 42 additions & 0 deletions solvebio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import os as _os
import logging as _logging
import warnings
from typing import Literal
from .help import open_help as _open_help

Expand Down Expand Up @@ -99,6 +100,45 @@ def _set_cached_api_host(host):

from .version import VERSION # noqa
from .errors import SolveError


_deprecation_warning_shown = False


def print_deprecation_notice():
"""
Shows the deprecation warning for the SolveBio Python client.
Only shows once per session to avoid repetition.
"""
global _deprecation_warning_shown

if _deprecation_warning_shown:
return

_deprecation_warning_shown = True

message = """
!!! Deprecation Notice

The SolveBio Python client is deprecated and will no longer be maintained after March 31, 2026.

We recommend migrating to the QuartzBio python client:
https://github.com/quartzbio/quartzbio-python

"""

if api_host is not None:
message += f"\nOr using the QuartzBio REST API: {api_host.replace('.api', '')}/swagger"

# Show warning and also print to ensure visibility
warnings.warn(
message,
DeprecationWarning,
stacklevel=2,
)
print(f"{message}")


from .query import Query, BatchQuery, Filter, GenomicFilter
from .global_search import GlobalSearch
from .annotate import Annotator, Expression
Expand Down Expand Up @@ -176,6 +216,8 @@ def login(
client.set_credentials(
api_host, token, token_type=token_type, raise_on_missing=not debug, debug=debug
)
# Show deprecation notice after credentials are set
print_deprecation_notice()

client.set_user_agent(name=name, version=version)

Expand Down
18 changes: 11 additions & 7 deletions solvebio/cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def login_and_save_credentials(*args):
# Print information about the current user
if not client.is_logged_in():
print("login: client is not logged in!")
solvebio.print_deprecation_notice()

# Verify if user has provided the wrong credentials file
if client._host:
Expand Down Expand Up @@ -56,9 +57,10 @@ def logout(*args):
"""
if get_credentials():
delete_credentials()
print('You have been logged out.')
print("You have been logged out.")
else:
print('You are not logged-in.')
print("You are not logged-in.")
solvebio.print_deprecation_notice()


def whoami(*args, **kwargs):
Expand All @@ -69,7 +71,7 @@ def whoami(*args, **kwargs):
try:
user = client.whoami()
except Exception as e:
print(u'{} (code: {})'.format(e.message, e.status_code))
print("{} (code: {})".format(e.message, e.status_code))
else:
print_user(user)

Expand All @@ -78,7 +80,9 @@ def print_user(user):
"""
Prints information about the current 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()}).')
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()})."
)
3 changes: 3 additions & 0 deletions solvebio/cli/ipython_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
from solvebio import DatasetSnapshotTask # noqa
from solvebio import GlobalSearch # noqa
from solvebio import Group # noqa
from solvebio import print_deprecation_notice # noqa
from solvebio.utils.printing import pager # noqa

# Add some convenience functions to the interactive shell
from solvebio.cli.auth import logout # noqa
from solvebio.cli.auth import whoami # noqa
from solvebio.cli.auth import get_credentials # noqa

# Show deprecation notice when starting IPython shell
print_deprecation_notice()
whoami()