Commit c80bf467 authored by André Anjos's avatar André Anjos 💬
Browse files

Upgrade to discrete xbob.io packages

parent 007815cf
...@@ -10,19 +10,19 @@ extensions = xbob.buildout ...@@ -10,19 +10,19 @@ extensions = xbob.buildout
auto-checkout = * auto-checkout = *
develop = src/xbob.extension develop = src/xbob.extension
src/xbob.blitz src/xbob.blitz
src/xbob.io src/xbob.io.base
. .
; options for xbob.buildout extension ; options for xbob.buildout extension
debug = true debug = true
verbose = true verbose = true
prefixes = /idiap/group/torch5spro/nightlies/last/bob/linux-x86_64-release prefixes = /idiap/group/torch5spro/releases/preview/install/linux-x86_64-release
/Users/andre/work/bob/b/dbg/ /Users/andre/work/bob/b/dbg/
[sources] [sources]
xbob.extension = git https://github.com/bioidiap/xbob.extension branch=prototype xbob.extension = git https://github.com/bioidiap/xbob.extension branch=prototype
xbob.blitz = git https://github.com/bioidiap/xbob.blitz xbob.blitz = git https://github.com/bioidiap/xbob.blitz
xbob.io = git https://github.com/bioidiap/xbob.io xbob.io.base = git https://github.com/bioidiap/xbob.io.base
[scripts] [scripts]
recipe = xbob.buildout:scripts recipe = xbob.buildout:scripts
...@@ -27,14 +27,24 @@ the import function: ...@@ -27,14 +27,24 @@ the import function:
if (!m) return; if (!m) return;
// imports the NumPy C-API // imports dependencies
import_array(); if (import_xbob_blitz() < 0) {
PyErr_Print();
// imports blitz.array C-API PyErr_SetString(PyExc_ImportError, "cannot import module");
import_xbob_blitz(); return 0;
}
// imports xbob.io C-API
import_xbob_io(); if (import_xbob_io_base() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
if (import_xbob_learn_activation() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
// imports xbob.learn.activation C-API // imports xbob.learn.activation C-API
import_xbob_learn_activation(); import_xbob_learn_activation();
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
# Mon 16 Apr 08:18:08 2012 CEST # Mon 16 Apr 08:18:08 2012 CEST
from setuptools import setup, find_packages, dist from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['xbob.blitz', 'xbob.io'])) dist.Distribution(dict(setup_requires=['xbob.blitz', 'xbob.io.base']))
from xbob.blitz.extension import Extension from xbob.blitz.extension import Extension
import xbob.io import xbob.io.base
import os import os
package_dir = os.path.dirname(os.path.realpath(__file__)) package_dir = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(package_dir, 'xbob', 'learn', 'activation', 'include') package_dir = os.path.join(package_dir, 'xbob', 'learn', 'activation', 'include')
include_dirs = [package_dir, xbob.io.get_include()] include_dirs = [package_dir, xbob.io.base.get_include()]
packages = ['bob-machine >= 1.2.2'] packages = ['bob-machine >= 1.2.2']
version = '2.0.0a0' version = '2.0.0a0'
...@@ -34,7 +34,7 @@ setup( ...@@ -34,7 +34,7 @@ setup(
install_requires=[ install_requires=[
'setuptools', 'setuptools',
'xbob.blitz', 'xbob.blitz',
'xbob.io', 'xbob.io.base',
], ],
namespace_packages=[ namespace_packages=[
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define XBOB_LEARN_ACTIVATION_MODULE #define XBOB_LEARN_ACTIVATION_MODULE
#include <xbob.learn.activation/api.h> #include <xbob.learn.activation/api.h>
#include <xbob.io/api.h> #include <xbob.io.base/api.h>
#include <xbob.blitz/cppapi.h> #include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h> #include <xbob.blitz/cleanup.h>
#include <bob/machine/Activation.h> #include <bob/machine/Activation.h>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#endif #endif
#include <xbob.blitz/capi.h> #include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h> #include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h> #include <xbob.io.base/api.h>
static PyMethodDef module_methods[] = { static PyMethodDef module_methods[] = {
{0} /* Sentinel */ {0} /* Sentinel */
...@@ -27,7 +27,7 @@ static PyModuleDef module_definition = { ...@@ -27,7 +27,7 @@ static PyModuleDef module_definition = {
XBOB_EXT_MODULE_NAME, XBOB_EXT_MODULE_NAME,
module_docstr, module_docstr,
-1, -1,
module_methods, module_methods,
0, 0, 0, 0 0, 0, 0, 0
}; };
#endif #endif
...@@ -66,7 +66,7 @@ static PyObject* create_module (void) { ...@@ -66,7 +66,7 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m); auto m_ = make_safe(m);
/* register some constants */ /* register some constants */
if (PyModule_AddIntConstant(m, "__api_version__", XBOB_IO_API_VERSION) < 0) return 0; if (PyModule_AddIntConstant(m, "__api_version__", XBOB_LEARN_ACTIVATION_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0; if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0;
/* register the types to python */ /* register the types to python */
...@@ -153,9 +153,18 @@ static PyObject* create_module (void) { ...@@ -153,9 +153,18 @@ static PyObject* create_module (void) {
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object); if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* imports xbob.io C-API + dependencies */ /* imports dependencies */
if (import_xbob_blitz() < 0) return 0; if (import_xbob_blitz() < 0) {
if (import_xbob_io() < 0) return 0; PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
return 0;
}
if (import_xbob_io_base() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
return 0;
}
Py_INCREF(m); Py_INCREF(m);
return m; return m;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#endif #endif
#include <xbob.blitz/capi.h> #include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h> #include <xbob.blitz/cleanup.h>
#include <xbob.io/config.h> #include <xbob.io.base/config.h>
#include <xbob.learn.activation/config.h> #include <xbob.learn.activation/config.h>
static int dict_set(PyObject* d, const char* key, const char* value) { static int dict_set(PyObject* d, const char* key, const char* value) {
...@@ -105,10 +105,10 @@ static PyObject* xbob_blitz_version() { ...@@ -105,10 +105,10 @@ static PyObject* xbob_blitz_version() {
} }
/** /**
* xbob.io c/c++ api version * xbob.io.base c/c++ api version
*/ */
static PyObject* xbob_io_version() { static PyObject* xbob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_API_VERSION)); return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_BASE_API_VERSION));
} }
static PyObject* build_version_dictionary() { static PyObject* build_version_dictionary() {
...@@ -123,7 +123,7 @@ static PyObject* build_version_dictionary() { ...@@ -123,7 +123,7 @@ static PyObject* build_version_dictionary() {
if (!dict_steal(retval, "Python", python_version())) return 0; if (!dict_steal(retval, "Python", python_version())) return 0;
if (!dict_steal(retval, "NumPy", numpy_version())) return 0; if (!dict_steal(retval, "NumPy", numpy_version())) return 0;
if (!dict_steal(retval, "xbob.blitz", xbob_blitz_version())) return 0; if (!dict_steal(retval, "xbob.blitz", xbob_blitz_version())) return 0;
if (!dict_steal(retval, "xbob.io", xbob_io_version())) return 0; if (!dict_steal(retval, "xbob.io.base", xbob_io_base_version())) return 0;
if (!dict_steal(retval, "Bob", bob_version())) return 0; if (!dict_steal(retval, "Bob", bob_version())) return 0;
Py_INCREF(retval); Py_INCREF(retval);
...@@ -169,8 +169,12 @@ static PyObject* create_module (void) { ...@@ -169,8 +169,12 @@ static PyObject* create_module (void) {
if (!externals) return 0; if (!externals) return 0;
if (PyModule_AddObject(m, "externals", externals) < 0) return 0; if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
/* imports xbob.io C-API + dependencies */ /* imports dependencies */
if (import_xbob_blitz() < 0) return 0; if (import_xbob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
return 0;
}
Py_INCREF(m); Py_INCREF(m);
return m; return m;
......
Supports Markdown
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