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
auto-checkout = *
develop = src/xbob.extension
src/xbob.blitz
src/xbob.io
src/xbob.io.base
.
; options for xbob.buildout extension
debug = 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/
[sources]
xbob.extension = git https://github.com/bioidiap/xbob.extension branch=prototype
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]
recipe = xbob.buildout:scripts
......@@ -27,14 +27,24 @@ the import function:
if (!m) return;
// imports the NumPy C-API
import_array();
// imports dependencies
if (import_xbob_blitz() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
// imports blitz.array C-API
import_xbob_blitz();
if (import_xbob_io_base() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
// imports xbob.io C-API
import_xbob_io();
if (import_xbob_learn_activation() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "cannot import module");
return 0;
}
// imports xbob.learn.activation C-API
import_xbob_learn_activation();
......
......@@ -4,14 +4,14 @@
# Mon 16 Apr 08:18:08 2012 CEST
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
import xbob.io
import xbob.io.base
import os
package_dir = os.path.dirname(os.path.realpath(__file__))
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']
version = '2.0.0a0'
......@@ -34,7 +34,7 @@ setup(
install_requires=[
'setuptools',
'xbob.blitz',
'xbob.io',
'xbob.io.base',
],
namespace_packages=[
......
......@@ -9,7 +9,7 @@
#define XBOB_LEARN_ACTIVATION_MODULE
#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/cleanup.h>
#include <bob/machine/Activation.h>
......
......@@ -13,7 +13,7 @@
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h>
#include <xbob.io.base/api.h>
static PyMethodDef module_methods[] = {
{0} /* Sentinel */
......@@ -66,7 +66,7 @@ static PyObject* create_module (void) {
auto m_ = make_safe(m);
/* 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;
/* register the types to python */
......@@ -153,9 +153,18 @@ static PyObject* create_module (void) {
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* imports xbob.io C-API + dependencies */
if (import_xbob_blitz() < 0) return 0;
if (import_xbob_io() < 0) return 0;
/* imports dependencies */
if (import_xbob_blitz() < 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);
return m;
......
......@@ -21,7 +21,7 @@
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/config.h>
#include <xbob.io.base/config.h>
#include <xbob.learn.activation/config.h>
static int dict_set(PyObject* d, const char* key, const char* value) {
......@@ -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() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_API_VERSION));
static PyObject* xbob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_BASE_API_VERSION));
}
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, "NumPy", numpy_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;
Py_INCREF(retval);
......@@ -169,8 +169,12 @@ static PyObject* create_module (void) {
if (!externals) return 0;
if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
/* imports xbob.io C-API + dependencies */
if (import_xbob_blitz() < 0) return 0;
/* imports dependencies */
if (import_xbob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
return 0;
}
Py_INCREF(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