From bc8b12e9cf1dccebb94ef1d4f63963cbe9dfd8ab Mon Sep 17 00:00:00 2001 From: Darius Morawiec Date: Sun, 20 Jan 2019 12:07:16 +0100 Subject: [PATCH] release/0.7.1: Remove package import with further dependencies --- sklearn_porter/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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')