Commit c3ac1ea2 authored by Manuel Günther's avatar Manuel Günther

Based get_config on bob.extension

parent 47ac051e
......@@ -5,21 +5,8 @@ from .version import module as __version__
def get_config():
"""Returns a string containing the configuration information.
"""
import pkg_resources
from .version import externals
packages = pkg_resources.require(__name__)
this = packages[0]
deps = packages[1:]
retval = "%s: %s (%s)\n" % (this.key, this.version, 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()
import bob.extension
return bob.extension.get_config(__name__, version.externals)
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
......@@ -245,15 +245,10 @@ static PyObject* create_module (void) {
if (!m) return 0;
auto m_ = make_safe(m); ///< protects against early returns
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0)
return 0;
/* imports bob.blitz C-API + dependencies */
if (import_bob_blitz() < 0) return 0;
Py_INCREF(m);
return m;
return Py_BuildValue("O", m);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
......@@ -138,8 +138,7 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m); ///< protects against early returns
/* register version numbers and constants */
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_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;
......@@ -147,9 +146,7 @@ static PyObject* create_module (void) {
if (import_bob_blitz() < 0) return 0;
Py_INCREF(m);
return m;
return Py_BuildValue("O", m);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment