Browse files

ENH: Delay import of requests

Packages that load duecredit pull in 326 modules, 312 of which are loaded with requests.

This change delays import of requests to the single function that requests is called from.
  • Loading branch information...
effigies committed Nov 28, 2018
1 parent 571fae5 commit 8f67c98f92c83468e0fac6ebafe6263eee07707d
Showing with 1 addition and 1 deletion.
  1. +1 −1 duecredit/
@@ -19,7 +19,6 @@
import copy
from os.path import dirname, exists
import pickle
import requests
import tempfile
from six import PY2, itervalues, iteritems
import warnings
@@ -43,6 +42,7 @@ def get_doi_cache_file(doi):
def import_doi(doi, sleep=0.5, retries=10):
import requests
cached = get_doi_cache_file(doi)
if exists(cached):

0 comments on commit 8f67c98

Please sign in to comment.