summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-04 13:25:05 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:48:07 -0300
commit4351b2e5133e89c02ff26ecbf0f7df6e902efc64 (patch)
treef2a4b538c09b11dd397e301c10de6c5ab043efc3
parentcc7d8dd1386138a5e88afe64664f51c33aad2f56 (diff)
New format for __version_info__.
The new format follow the same rules used by sys.version_info(). Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--CMakeLists.txt11
-rw-r--r--PySide/__init__.py.in4
-rw-r--r--doc/conf.py.in2
-rw-r--r--libpyside/pyside.pc.in2
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/versioninfo_test.py20
6 files changed, 35 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5209bab3..33eda537 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,7 +63,16 @@ set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "1")
set(BINDING_API_MINOR_VERSION "0")
set(BINDING_API_MICRO_VERSION "0")
+set(BINDING_API_RELEASE_LEVEL "beta") # alpha, beta, candidate, or final
+set(BINDING_API_SERIAL 3) # leave as 0 when release level is final
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
+if (BINDING_API_RELEASE_LEVEL STREQUAL "final")
+ set(BINDING_API_VERSION_FULL "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}"
+ CACHE STRING "PySide version [full]" FORCE)
+else()
+ set(BINDING_API_VERSION_FULL "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}~${BINDING_API_RELEASE_LEVEL}${BINDING_API_SERIAL}"
+ CACHE STRING "PySide version [full]" FORCE)
+endif()
set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE)
if(ENABLE_VERSION_SUFFIX)
set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
@@ -123,7 +132,7 @@ add_custom_target(uninstall "${CMAKE_COMMAND}"
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-set(ARCHIVE_NAME pyside-qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}+${BINDING_API_VERSION})
+set(ARCHIVE_NAME pyside-qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}+${BINDING_API_VERSION_FULL})
add_custom_target(dist
COMMAND mkdir -p "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}" &&
git log > "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}/ChangeLog" &&
diff --git a/PySide/__init__.py.in b/PySide/__init__.py.in
index f931fadc..40731a82 100644
--- a/PySide/__init__.py.in
+++ b/PySide/__init__.py.in
@@ -1,5 +1,5 @@
__all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript']
import private
-__version__ = "@BINDING_API_VERSION@"
-__version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@)
+__version__ = "@BINDING_API_VERSION_FULL@"
+__version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@, "@BINDING_API_RELEASE_LEVEL@", @BINDING_API_SERIAL@)
diff --git a/doc/conf.py.in b/doc/conf.py.in
index b9e7549e..d2d7408b 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -51,7 +51,7 @@ copyright = u'2009-2010, Nokia Corporation'
# The short X.Y version.
version = '@BINDING_API_VERSION@'
# The full version, including alpha/beta/rc tags.
-release = '@BINDING_API_VERSION@'
+release = '@BINDING_API_VERSION_FULL@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/libpyside/pyside.pc.in b/libpyside/pyside.pc.in
index f7458a9c..993e5a10 100644
--- a/libpyside/pyside.pc.in
+++ b/libpyside/pyside.pc.in
@@ -7,7 +7,7 @@ pythonpath=@SITE_PACKAGE@
Name: PySide@pyside_SUFFIX@
Description: Support library for Python bindings of Qt-based libraries.
-Version: @BINDING_API_VERSION@
+Version: @BINDING_API_VERSION_FULL@
Libs: -L${libdir} -lpyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@
Cflags: -I${includedir}
Requires: shiboken
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 68519154..7f8a773f 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -76,6 +76,7 @@ PYSIDE_TEST(tr_noop_test.py)
PYSIDE_TEST(translation_test.py)
PYSIDE_TEST(unaryoperator_test.py)
PYSIDE_TEST(unicode_test.py)
+PYSIDE_TEST(versioninfo_test.py)
if(X11)
PYSIDE_TEST(qhandle_test.py)
diff --git a/tests/QtCore/versioninfo_test.py b/tests/QtCore/versioninfo_test.py
new file mode 100644
index 00000000..094d637e
--- /dev/null
+++ b/tests/QtCore/versioninfo_test.py
@@ -0,0 +1,20 @@
+import unittest
+import PySide
+
+class TestVersionInfo(unittest.TestCase):
+ def testIt(self):
+
+ v = PySide.__version_info__
+ self.assertEqual(type(v), tuple)
+ self.assertEqual(len(v), 5)
+ self.assertEqual(type(v[0]), int)
+ self.assertEqual(type(v[1]), int)
+ self.assertEqual(type(v[2]), int)
+ self.assertEqual(type(v[3]), str)
+ self.assertEqual(type(v[4]), int)
+
+ self.assertEqual(type(PySide.__version__), str)
+
+
+if __name__ == '__main__':
+ unittest.main()