From 18f89cd43ef2d0483c6398960d441da8435b2cfc Mon Sep 17 00:00:00 2001 From: kkaris Date: Fri, 15 Dec 2023 20:27:24 -0800 Subject: [PATCH] Move import to function to avoid global dependency --- indra/literature/pubmed_client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/indra/literature/pubmed_client.py b/indra/literature/pubmed_client.py index bc84f8e9e7..57202b059e 100644 --- a/indra/literature/pubmed_client.py +++ b/indra/literature/pubmed_client.py @@ -18,9 +18,6 @@ from typing import List from functools import lru_cache import xml.etree.ElementTree as ET - -from bs4 import BeautifulSoup - from indra.resources import RESOURCES_PATH from indra.util import UnicodeXMLTreeBuilder as UTB from indra.util import batch_iter, pretty_save_xml @@ -1061,6 +1058,8 @@ def ensure_xml_files(xml_path: str, retries: int = 3): def _get_urls(url: str): """Get the paths to all XML files on the PubMed FTP server.""" + from bs4 import BeautifulSoup + logger.info("Getting URL paths from %s" % url) # Get page