From a6b105f6f4363cc8f53932a9cf7d2da98b3da44b Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Thu, 20 Mar 2014 18:25:51 +0100
Subject: [PATCH] Rename externals -> version to reflect global prototype
 changes

---
 setup.py                               | 4 ++--
 xbob/io/__init__.py                    | 5 +++--
 xbob/io/{externals.cpp => version.cpp} | 6 +++---
 3 files changed, 8 insertions(+), 7 deletions(-)
 rename xbob/io/{externals.cpp => version.cpp} (99%)

diff --git a/setup.py b/setup.py
index 0e4947d..eafe072 100644
--- a/setup.py
+++ b/setup.py
@@ -41,9 +41,9 @@ setup(
       ],
 
     ext_modules = [
-      Extension("xbob.io._externals",
+      Extension("xbob.io.version",
         [
-          "xbob/io/externals.cpp",
+          "xbob/io/version.cpp",
           ],
         packages = packages,
         include_dirs = include_dirs,
diff --git a/xbob/io/__init__.py b/xbob/io/__init__.py
index 5f700b1..24a3ecd 100644
--- a/xbob/io/__init__.py
+++ b/xbob/io/__init__.py
@@ -1,6 +1,7 @@
 from ._library import File, VideoReader, VideoWriter, HDF5File
-from ._library import __version__, __api_version__
-from . import _externals
+from . import version
+from .version import module as __version__
+from .version import api as __api_version__
 
 import os
 
diff --git a/xbob/io/externals.cpp b/xbob/io/version.cpp
similarity index 99%
rename from xbob/io/externals.cpp
rename to xbob/io/version.cpp
index f47294a..4a014f3 100644
--- a/xbob/io/externals.cpp
+++ b/xbob/io/version.cpp
@@ -867,11 +867,11 @@ static PyObject* create_module (void) {
   auto m_ = make_safe(m); ///< protects against early returns
 
   /* register version numbers and constants */
-  if (PyModule_AddIntConstant(m, "__api_version__", XBOB_IO_API_VERSION) < 0)
+  if (PyModule_AddIntConstant(m, "api", XBOB_IO_API_VERSION) < 0)
     return 0;
-  if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0)
+  if (PyModule_AddStringConstant(m, "module", XBOB_EXT_MODULE_VERSION) < 0)
     return 0;
-  if (PyModule_AddObject(m, "versions", build_version_dictionary()) < 0) return 0;
+  if (PyModule_AddObject(m, "externals", build_version_dictionary()) < 0) return 0;
 
   /* imports xbob.blitz C-API + dependencies */
   if (import_xbob_blitz() < 0) return 0;
-- 
GitLab