From 77271fa1f985248ba3493b7e0b24be1b698beab8 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Sat, 5 Aug 2023 08:39:45 -0400 Subject: [PATCH] Remove Bioregistry from testing (#65) This is to prepare for making pydantic 1/2 cross-compatible, since Bioregistry is currently pinned to pydantic<2.0 --- setup.cfg | 2 -- src/curies/sources.py | 3 ++- tests/test_api.py | 11 ----------- tox.ini | 1 - 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/setup.cfg b/setup.cfg index d377aa7..2e4a5cb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -75,8 +75,6 @@ tests = coverage pandas = pandas -bioregistry = - bioregistry>=0.5.136 flask = flask defusedxml diff --git a/src/curies/sources.py b/src/curies/sources.py index 66e9cb4..1319536 100644 --- a/src/curies/sources.py +++ b/src/curies/sources.py @@ -60,6 +60,7 @@ def get_bioregistry_converter(web: bool = False, **kwargs: Any) -> Converter: except ImportError: # pragma: no cover pass else: - return Converter.from_extended_prefix_map(bioregistry.manager.get_curies_records()) + epm = bioregistry.manager.get_curies_records() # pragma: no cover + return Converter.from_extended_prefix_map(epm) # pragma: no cover url = f"{BIOREGISTRY_CONTEXTS}/bioregistry.epm.json" return Converter.from_extended_prefix_map(url, **kwargs) diff --git a/tests/test_api.py b/tests/test_api.py index ee80bda..291e999 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -10,7 +10,6 @@ import pandas as pd import rdflib -from bioregistry.export.prefix_maps import EXTENDED_PREFIX_MAP_PATH from curies.api import ( CompressionError, @@ -209,16 +208,6 @@ def assert_bioregistry_converter(self, converter: Converter) -> None: self.assertIn(chebi_uri, converter.reverse_prefix_map) self.assertEqual("chebi", converter.reverse_prefix_map[chebi_uri]) - @unittest.skipUnless( - EXTENDED_PREFIX_MAP_PATH.is_file(), - reason="missing local, editable installation of the Bioregistry", - ) - def test_bioregistry_editable(self): - """Test loading the bioregistry extended prefix map locally.""" - records = json.loads(EXTENDED_PREFIX_MAP_PATH.read_text()) - converter = Converter.from_extended_prefix_map(records) - self.assert_bioregistry_converter(converter) - def test_load_path(self): """Test loading from paths.""" with tempfile.TemporaryDirectory() as directory: diff --git a/tox.ini b/tox.ini index f55741e..dc729f3 100644 --- a/tox.ini +++ b/tox.ini @@ -38,7 +38,6 @@ commands = extras = tests pandas - bioregistry flask fastapi rdflib