Browse Source

Sphinx docs: Now show if the release is stable or unstable.

Ask Solem 15 years ago
parent
commit
bf4e1df007
2 changed files with 12 additions and 1 deletions
  1. 11 0
      celery/__init__.py
  2. 1 1
      docs/conf.py

+ 11 - 0
celery/__init__.py

@@ -5,3 +5,14 @@ __author__ = "Ask Solem"
 __contact__ = "askh@opera.com"
 __homepage__ = "http://github.com/ask/celery/"
 __docformat__ = "restructuredtext"
+
+
+def is_stable_release():
+    return bool(not VERSION[1] % 2)
+
+
+def version_with_meta():
+    meta = "unstable"
+    if is_stable_release():
+        meta = "stable"
+    return "%s (%s)" % (__version__, meta)

+ 1 - 1
docs/conf.py

@@ -55,7 +55,7 @@ copyright = u'2009, Ask Solem'
 # The short X.Y version.
 version = ".".join(map(str, celery.VERSION[0:2]))
 # The full version, including alpha/beta/rc tags.
-release = celery.__version__
+release = celery.version_with_meta()
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.