diff --git a/sklearn_porter/__init__.py b/sklearn_porter/__init__.py index ff773321..98950039 100644 --- a/sklearn_porter/__init__.py +++ b/sklearn_porter/__init__.py @@ -5,8 +5,6 @@ from os.path import join from json import load -from sklearn_porter.Porter import Porter - def _load_meta(path): """ @@ -19,6 +17,8 @@ def _load_meta(path): meta = {k: v.decode('utf-8') if isinstance(v, bytes) else v for k, v in meta.items()} + src_dir = abspath(dirname(path)) + if 'requirements' in meta and \ str(meta['requirements']).startswith('file://'): req_path = str(meta['requirements'])[7:] @@ -37,8 +37,7 @@ def _load_meta(path): return meta -src_dir = abspath(dirname(__file__)) -package = join(src_dir, 'package.json') +package = join(abspath(dirname(__file__)), 'package.json') meta = _load_meta(package) __author__ = meta.get('author')