Skip to content

Commit d984ece

Browse files
authored
Merge pull request #33 from scverse/Ori-updates2
fix: remove deps of ContextualVersionConflict
2 parents d637998 + 5b36428 commit d984ece

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ["3.10", "3.11", "3.12"]
19+
python-version: ["3.11", "3.12", "3.13"]
2020

2121
steps:
2222
- uses: actions/checkout@v2

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ classifiers = [
1010
"Development Status :: 4 - Beta",
1111
"Intended Audience :: Science/Research",
1212
"Natural Language :: English",
13-
"Programming Language :: Python :: 3.10",
1413
"Programming Language :: Python :: 3.11",
1514
"Programming Language :: Python :: 3.12",
15+
"Programming Language :: Python :: 3.13",
1616
"Operating System :: POSIX :: Linux",
1717
"Topic :: Scientific/Engineering :: Bio-Informatics",
1818
]

scvi_colab/_core.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ def install(
4040
fixes that are pinned in this function.
4141
"""
4242

43-
from pkg_resources import ContextualVersionConflict
44-
4543
if not run_outside_colab:
4644
IN_COLAB = "google.colab" in sys.modules
4745
if not IN_COLAB:
@@ -98,10 +96,16 @@ def install(
9896

9997
try:
10098
import scvi # noqa: F401
101-
except ContextualVersionConflict:
102-
logger.warning(
103-
"Import unsuccessful. Try restarting (not resetting) the session and running again."
104-
)
99+
except Exception as exc:
100+
if any(
101+
base.__name__ == "ContextualVersionConflict"
102+
for base in exc.__class__.__mro__
103+
):
104+
logger.warning(
105+
"Import unsuccessful. Try restarting (not resetting) the session and running again."
106+
)
107+
else:
108+
raise
105109

106110

107111
def _run_command(command: str):

0 commit comments

Comments
 (0)