From 64f14eee8af55ecba32f884710d0e52ebbeb258b Mon Sep 17 00:00:00 2001 From: kotopesutility <47449182+kotopesutility@users.noreply.github.com> Date: Sun, 30 Jul 2023 16:31:06 +0300 Subject: [PATCH] FIX: removed dependence from top-level packages on the subpackage with tests (#103) Authored-by: Daniel Zagaynov --- bimdp/__init__.py | 1 - bimdp/test/__init__.py | 7 ++++--- mdp/__init__.py | 1 - setup.py | 8 ++++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bimdp/__init__.py b/bimdp/__init__.py index 1ff8dee1..def3e71c 100644 --- a/bimdp/__init__.py +++ b/bimdp/__init__.py @@ -85,7 +85,6 @@ # the inspection stuff is considered a core functionality from .inspection import * -from .test import test from . import nodes from . import hinet diff --git a/bimdp/test/__init__.py b/bimdp/test/__init__.py index ef327417..a00be18e 100644 --- a/bimdp/test/__init__.py +++ b/bimdp/test/__init__.py @@ -1,11 +1,12 @@ import os import mdp +from mdp.test import test as mdp_test -# wrap the mdp.test function and set the module path to bimdp path -infodict = mdp.NodeMetaclass._function_infodict(mdp.test) +# wrap the mdp.test.test function and set the module path to bimdp path +infodict = mdp.NodeMetaclass._function_infodict(mdp_test) idx = infodict["argnames"].index('mod_loc') defaults = list(infodict['defaults']) defaults[idx] = os.path.dirname(__file__) infodict['defaults'] = tuple(defaults) -test = mdp.NodeMetaclass._wrap_function(mdp.test, infodict) +test = mdp.NodeMetaclass._wrap_function(mdp_test, infodict) diff --git a/mdp/__init__.py b/mdp/__init__.py index d630017f..f492fc4e 100644 --- a/mdp/__init__.py +++ b/mdp/__init__.py @@ -171,7 +171,6 @@ class MDPDeprecationWarning(DeprecationWarning, MDPWarning): from . import nodes from . import hinet from . import parallel -from .test import test # explicitly set __all__, mainly needed for epydoc diff --git a/setup.py b/setup.py index 4f6552f5..41a7446f 100644 --- a/setup.py +++ b/setup.py @@ -57,15 +57,15 @@ def get_long_description(): class MDPTest(_test): def run_tests(self): - import mdp - import bimdp + from mdp.test import test as mtest + from bimdp.test import test as btest # Fix random seed here, as we want reproducible failures in # automatic builds using "python setup.py test" # If the tests are run manually with pytest or # using the mdp.test and bimdp.test functions, the seed # is not set - errno = mdp.test(seed=725021957) - errno += bimdp.test(seed=725021957) + errno = mtest(seed=725021957) + errno += btest(seed=725021957) sys.exit(errno) def setup_package():