Skip to content

Commit 7b8cf43

Browse files
authored
Reduce core requirements (#426)
Test what happens when taking out some of the requirements that are only used in sources
1 parent 5b9e69d commit 7b8cf43

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ dependencies = [
6363
"pyyaml",
6464
"pandas",
6565
"requests",
66-
"protmapper",
6766
"more_itertools",
6867
"more_click>=0.0.2",
6968
"humanize",
@@ -76,7 +75,6 @@ dependencies = [
7675
"ssslm>=0.0.13",
7776
"zenodo-client>=0.3.6",
7877
"class_resolver>=0.6.0",
79-
"psycopg2-binary",
8078
"pydantic>=2.0",
8179
"curies>=0.10.17",
8280
"curies-processing>=0.1.2",
@@ -158,6 +156,15 @@ gilda = [
158156
gilda-slim = [
159157
"ssslm[gilda-slim]",
160158
]
159+
sources = [
160+
"pyobo[drugcentral,pid]",
161+
]
162+
drugcentral =[
163+
"psycopg2-binary",
164+
]
165+
pid = [
166+
"protmapper",
167+
]
161168

162169
# See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#urls
163170
# and also https://packaging.python.org/en/latest/specifications/well-known-project-urls/

src/pyobo/sources/drugcentral.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from contextlib import closing
77

88
import bioregistry
9-
import psycopg2
109
from pydantic import ValidationError
1110
from tqdm.auto import tqdm
1211

@@ -42,6 +41,8 @@ def iter_terms(self, force: bool = False) -> Iterable[Term]:
4241

4342
def iter_terms() -> Iterable[Term]:
4443
"""Iterate over DrugCentral terms."""
44+
import psycopg2
45+
4546
with closing(psycopg2.connect(**PARAMS)) as conn:
4647
with closing(conn.cursor()) as cur:
4748
cur.execute(

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ description = Run the pyroma tool to check the package friendliness of the proje
120120

121121
[testenv:mypy]
122122
description = Run the mypy tool to check static typing on the project. Installs the package to make sure all type stubs get recognized.
123+
extras =
124+
sources
123125
dependency_groups =
124126
typing
125127
commands =

0 commit comments

Comments
 (0)