Skip to content
Snippets Groups Projects
Commit d217a76e authored by Manuel Günther's avatar Manuel Günther
Browse files

Based get_config on bob.extension

parent a3ffeed9
Branches
Tags
No related merge requests found
......@@ -5,6 +5,11 @@ import bob.io.base
import bob.extension
bob.extension.load_bob_library('bob.learn.boosting', __file__)
# versioning
from . import version
from .version import module as __version__
from .version import api as __api_version__
# include loss functions
from . import LossFunction # Just to get the documentation for it
from .ExponentialLoss import ExponentialLoss
......@@ -26,23 +31,8 @@ from ._library import weighted_histogram
def get_config():
"""Returns a string containing the configuration information.
"""
return bob.extension.get_config(__name__, version.externals, version.api)
import pkg_resources
from .version import externals
packages = pkg_resources.require(__name__)
this = packages[0]
deps = packages[1:]
retval = "%s: %s [api=0x%04x] (%s)\n" % (this.key, this.version,
version.api, this.location)
retval += " - c/c++ dependencies:\n"
for k in sorted(externals): retval += " - %s: %s\n" % (k, externals[k])
retval += " - python dependencies:\n"
for d in deps: retval += " - %s: %s (%s)\n" % (d.key, d.version, d.location)
return retval.strip()
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
......@@ -160,10 +160,8 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m); ///< protects against early returns
/* register version numbers and constants */
if (PyModule_AddIntConstant(m, "api", BOB_LEARN_BOOSTING_API_VERSION) < 0)
return 0;
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0)
return 0;
if (PyModule_AddIntConstant(m, "api", BOB_LEARN_BOOSTING_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0) return 0;
PyObject* externals = build_version_dictionary();
if (!externals) return 0;
......@@ -176,9 +174,7 @@ static PyObject* create_module (void) {
return 0;
}
Py_INCREF(m);
return m;
return Py_BuildValue("O", m);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment