mozreview: Add barebones extension and packaging (Bug 1091381) r=gps
authorSteven MacLeod <smacleod@mozilla.com>
Mon, 19 Jan 2015 14:07:39 -0500
changeset 360203 dd4bb87ceb1ecf52c9b9f113ed6ed915def3a89f
parent 360202 17b437d39d1bc5b7886c22a7f3726f537fed7d1a
child 360204 b92cd183053f4d04481e8eb37eef5c6ee807ff28
push id16998
push userrwood@mozilla.com
push dateMon, 02 May 2016 19:42:03 +0000
reviewersgps
bugs1091381
mozreview: Add barebones extension and packaging (Bug 1091381) r=gps The mozreview extension will deal with publishing messages to Mozilla Pulse. Eventually we'd like to merge rbbz and RBMozUI into this extension as well.
.hgignore
pylib/mozreview/LICENSE
pylib/mozreview/mozreview/__init__.py
pylib/mozreview/mozreview/extension.py
pylib/mozreview/setup.py
--- a/.hgignore
+++ b/.hgignore
@@ -1,11 +1,12 @@
 coverage/
 docs/_build/
 hghooks/Mozilla_Hg_Hooks.egg-info/
+pylib/mozreview/mozreview.egg-info/
 pylib/rbbz/rbbz.egg-info/
 pylib/rbmozui/rbmozui.egg-info/
 pylib/Bugsy/bugsy.egg-info/
 testing/bmoserver/.vagrant
 testing/puppet/files/Mozilla-Bugzilla-Public*
 testing/unifiedserver/.vagrant
 venv/
 \.pyc$
new file mode 100644
--- /dev/null
+++ b/pylib/mozreview/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 by The Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
new file mode 100644
--- /dev/null
+++ b/pylib/mozreview/mozreview/__init__.py
@@ -0,0 +1,45 @@
+# The version of mozreview
+#
+# This is in the format of:
+#
+#   (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
+#
+VERSION = (0, 1, 0, 'alpha', 0, False)
+
+
+def get_version_string():
+    version = '%s.%s' % (VERSION[0], VERSION[1])
+
+    if VERSION[2]:
+        version += ".%s" % VERSION[2]
+
+    if VERSION[3] != 'final':
+        if VERSION[3] == 'rc':
+            version += ' RC%s' % VERSION[4]
+        else:
+            version += ' %s %s' % (VERSION[3], VERSION[4])
+
+    if not is_release():
+        version += " (dev)"
+
+    return version
+
+
+def get_package_version():
+    version = '%d.%d' % (VERSION[0], VERSION[1])
+
+    if VERSION[2]:
+        version += ".%d" % VERSION[2]
+
+    if VERSION[3] != 'final':
+        version += '%s%d' % (VERSION[3], VERSION[4])
+
+    return version
+
+
+def is_release():
+    return VERSION[5]
+
+
+__version_info__ = VERSION[:-1]
+__version__ = get_package_version()
new file mode 100644
--- /dev/null
+++ b/pylib/mozreview/mozreview/extension.py
@@ -0,0 +1,11 @@
+from reviewboard.extensions.base import Extension
+
+
+class MozReviewExtension(Extension):
+    metadata = {
+        'Name': 'mozreview',
+        'Summary': 'MozReview extension to Review Board',
+    }
+
+    def initialize(self):
+        pass
new file mode 100755
--- /dev/null
+++ b/pylib/mozreview/setup.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+from reviewboard.extensions.packaging import setup
+from setuptools import find_packages
+
+from mozreview import get_package_version
+
+
+setup(
+    name='mozreview',
+    version=get_package_version(),
+    license='MIT',
+    description='MozReview extension to Review Board',
+    packages=find_packages(),
+    install_requires=[
+        'MozillaPulse'
+    ],
+    classifiers=[
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: MIT License',
+    ],
+    entry_points={
+        'reviewboard.extensions':
+            '%s = mozreview.extension:MozReviewExtension' % PACKAGE_NAME,
+    },
+    package_data={
+        'mozreview': [
+            'templates/mozreview/*.txt',
+            'templates/mozreview/*.html',
+            'static/css/*.css',
+            'static/css/*.less'
+        ],
+    }
+)