Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.io.base
Commits
3f168e1f
Commit
3f168e1f
authored
11 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Add function to print comprehensive dependence list
parent
73ebb688
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xbob/io/__init__.py
+20
-0
20 additions, 0 deletions
xbob/io/__init__.py
xbob/io/version.cpp
+58
-0
58 additions, 0 deletions
xbob/io/version.cpp
with
78 additions
and
0 deletions
xbob/io/__init__.py
+
20
−
0
View file @
3f168e1f
...
@@ -180,5 +180,25 @@ def get_include():
...
@@ -180,5 +180,25 @@ def get_include():
return
__import__
(
'
pkg_resources
'
).
resource_filename
(
__name__
,
'
include
'
)
return
__import__
(
'
pkg_resources
'
).
resource_filename
(
__name__
,
'
include
'
)
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 [api=0x%04x] (%s)
\n
"
%
(
this
.
key
,
this
.
version
,
__api_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
# gets sphinx autodoc done right - don't remove it
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
'
_
'
)]
__all__
=
[
_
for
_
in
dir
()
if
not
_
.
startswith
(
'
_
'
)]
This diff is collapsed.
Click to expand it.
xbob/io/version.cpp
+
58
−
0
View file @
3f168e1f
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include
<string>
#include
<string>
#include
<cstdlib>
#include
<cstdlib>
#include
<boost/preprocessor/stringize.hpp>
#include
<boost/preprocessor/stringize.hpp>
#include
<boost/version.hpp>
#include
<boost/format.hpp>
#include
<boost/format.hpp>
#include
<bob/config.h>
#include
<bob/config.h>
...
@@ -283,6 +284,55 @@ static PyObject* bob_version() {
...
@@ -283,6 +284,55 @@ static PyObject* bob_version() {
return
Py_BuildValue
(
"sis"
,
BOB_VERSION
,
BOB_API_VERSION
,
BOB_PLATFORM
);
return
Py_BuildValue
(
"sis"
,
BOB_VERSION
,
BOB_API_VERSION
,
BOB_PLATFORM
);
}
}
/**
* Describes the version of Boost libraries installed
*/
static
PyObject
*
boost_version
()
{
boost
::
format
f
(
"%d.%d.%d"
);
f
%
(
BOOST_VERSION
/
100000
);
f
%
(
BOOST_VERSION
/
100
%
1000
);
f
%
(
BOOST_VERSION
%
100
);
return
Py_BuildValue
(
"s"
,
f
.
str
().
c_str
());
}
/**
* Describes the compiler version
*/
static
PyObject
*
compiler_version
()
{
# if defined(__GNUC__) && !defined(__llvm__)
boost
::
format
f
(
"%s.%s.%s"
);
f
%
BOOST_PP_STRINGIZE
(
__GNUC__
);
f
%
BOOST_PP_STRINGIZE
(
__GNUC_MINOR__
);
f
%
BOOST_PP_STRINGIZE
(
__GNUC_PATCHLEVEL__
);
return
Py_BuildValue
(
"{ssss}"
,
"name"
,
"gcc"
,
"version"
,
f
.
str
().
c_str
());
# elif defined(__llvm__) && !defined(__clang__)
return
Py_BuildValue
(
"{ssss}"
,
"name"
,
"llvm-gcc"
,
"version"
,
__VERSION__
);
# elif defined(__clang__)
return
Py_BuildValue
(
"{ssss}"
,
"name"
,
"clang"
,
"version"
,
__clang_version__
);
# else
return
Py_BuildValue
(
"{ssss}"
,
"name"
,
"unsupported"
,
"version"
,
"unknown"
);
# endif
}
/**
* Python version with which we compiled the extensions
*/
static
PyObject
*
python_version
()
{
boost
::
format
f
(
"%s.%s.%s"
);
f
%
BOOST_PP_STRINGIZE
(
PY_MAJOR_VERSION
);
f
%
BOOST_PP_STRINGIZE
(
PY_MINOR_VERSION
);
f
%
BOOST_PP_STRINGIZE
(
PY_MICRO_VERSION
);
return
Py_BuildValue
(
"s"
,
f
.
str
().
c_str
());
}
/**
* 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
()
{
static
PyObject
*
build_version_dictionary
()
{
PyObject
*
retval
=
PyDict_New
();
PyObject
*
retval
=
PyDict_New
();
...
@@ -307,6 +357,14 @@ static PyObject* build_version_dictionary() {
...
@@ -307,6 +357,14 @@ static PyObject* build_version_dictionary() {
if
(
!
dict_steal
(
retval
,
"MatIO"
,
matio_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"MatIO"
,
matio_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"Boost"
,
boost_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"Compiler"
,
compiler_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"Python"
,
python_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"NumPy"
,
numpy_version
()))
return
0
;
Py_INCREF
(
retval
);
Py_INCREF
(
retval
);
return
retval
;
return
retval
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment