Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.ap
Commits
bce6f76f
Commit
bce6f76f
authored
Mar 22, 2014
by
André Anjos
💬
Browse files
Add function to print comprehensive dependence list
parent
74bc3f00
Changes
2
Hide whitespace changes
Inline
Side-by-side
xbob/ap/__init__.py
View file @
bce6f76f
...
...
@@ -2,5 +2,24 @@ from ._library import *
from
.
import
version
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
()
# gets sphinx autodoc done right - don't remove it
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
'_'
)]
xbob/ap/version.cpp
View file @
bce6f76f
...
...
@@ -50,13 +50,13 @@ static PyObject* compiler_version() {
f
%
BOOST_PP_STRINGIZE
(
__GNUC__
);
f
%
BOOST_PP_STRINGIZE
(
__GNUC_MINOR__
);
f
%
BOOST_PP_STRINGIZE
(
__GNUC_PATCHLEVEL__
);
return
Py_BuildValue
(
"ss
"
,
"gcc
"
,
f
.
str
().
c_str
());
return
Py_BuildValue
(
"
{
ss
ss}"
,
"name"
,
"gcc"
,
"version
"
,
f
.
str
().
c_str
());
# elif defined(__llvm__) && !defined(__clang__)
return
Py_BuildValue
(
"ss"
,
"llvm-gcc"
,
__VERSION__
);
return
Py_BuildValue
(
"
{
ss
ss}"
,
"name
"
,
"llvm-gcc"
,
"version"
,
__VERSION__
);
# elif defined(__clang__)
return
Py_BuildValue
(
"ss
"
,
"clang
"
,
__clang_version__
);
return
Py_BuildValue
(
"
{
ss
ss}"
,
"name"
,
"clang"
,
"version
"
,
__clang_version__
);
# else
return
Py_BuildValue
(
"
s
"
,
"unsupported"
);
return
Py_BuildValue
(
"
{ssss}"
,
"name
"
,
"unsupported"
,
"version"
,
"unknown"
);
# endif
}
...
...
@@ -78,6 +78,14 @@ static PyObject* bob_version() {
return
Py_BuildValue
(
"sis"
,
BOB_VERSION
,
BOB_API_VERSION
,
BOB_PLATFORM
);
}
/**
* Numpy version
*/
static
PyObject
*
numpy_version
()
{
return
Py_BuildValue
(
"{ssss}"
,
"abi"
,
BOOST_PP_STRINGIZE
(
NPY_VERSION
),
"api"
,
BOOST_PP_STRINGIZE
(
NPY_API_VERSION
));
}
static
PyObject
*
build_version_dictionary
()
{
PyObject
*
retval
=
PyDict_New
();
...
...
@@ -103,6 +111,11 @@ static PyObject* build_version_dictionary() {
return
0
;
}
if
(
!
dict_steal
(
retval
,
"NumPy"
,
numpy_version
()))
{
Py_DECREF
(
retval
);
return
0
;
}
return
retval
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment