Commit 392e8843 authored by André Anjos's avatar André Anjos 💬

Implement discrete xbob.io packaging

parent adc1a89c
......@@ -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
......@@ -4,17 +4,17 @@
# Mon 16 Apr 08:18:08 2012 CEST
from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['xbob.extension', 'xbob.blitz', 'xbob.io']))
dist.Distribution(dict(setup_requires=['xbob.extension', 'xbob.blitz', 'xbob.io.base']))
from xbob.extension.utils import egrep, find_header, find_library
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', 'libsvm', 'include')
include_dirs = [
package_dir,
xbob.io.get_include(),
xbob.io.base.get_include(),
]
packages = ['bob-core >= 1.2.2', 'bob-io >= 1.2.2']
......@@ -173,7 +173,7 @@ setup(
install_requires=[
'setuptools',
'xbob.blitz',
'xbob.io',
'xbob.io.base',
],
namespace_packages=[
......
......@@ -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 */
......@@ -134,9 +134,18 @@ static PyObject* create_module (void) {
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* imports xbob.learn.activation 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;
......
......@@ -10,7 +10,7 @@
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.libsvm/api.h>
#include <structmember.h>
......
......@@ -10,7 +10,7 @@
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.libsvm/api.h>
#include <structmember.h>
......
......@@ -10,7 +10,7 @@
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.libsvm/api.h>
#include <structmember.h>
......
......@@ -13,7 +13,7 @@ import numpy
import tempfile
import pkg_resources
import nose.tools
import xbob.io
import xbob.io.base
from . import File, Machine
......@@ -102,11 +102,11 @@ def test_can_save_hdf5():
machine = Machine(HEART_MACHINE)
tmp = tempname('.hdf5')
machine.save(xbob.io.HDF5File(tmp, 'w'))
machine.save(xbob.io.base.HDF5File(tmp, 'w'))
del machine
# make sure that the save machine is the same as before
machine = Machine(xbob.io.HDF5File(tmp))
machine = Machine(xbob.io.base.HDF5File(tmp))
nose.tools.eq_(machine.shape, (13,1))
nose.tools.eq_(machine.kernel_type, 'RBF')
nose.tools.eq_(machine.machine_type, 'C_SVC')
......
......@@ -22,7 +22,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.libsvm/config.h>
static int dict_set(PyObject* d, const char* key, const char* value) {
......@@ -116,10 +116,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() {
......@@ -135,7 +135,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);
......@@ -181,8 +181,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;
......
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