Repository: fedora-infra/bodhi

Issue:
Reorganize locations of client and server code
Since the client and server code typically gets split into two different RPMs during packaging, it would be easier to separate them if they were more cleanly separated in our git repository. Something simple like moving them into bodhi/client/ and bodhi/server/ would make it a little easier to keep them separate in the spec file. Alternatively, we could create two separate Python packages for the client at server at the top level in this repository, or even start a new git repository for the bodhi client.



Discussion:
I've been working on updating the bodhi package in Rawhide, and I've hit a problem where the bodhi-client package depended on the bodhi-server package. I attempted to resolve this by creating a new python2-bodhi package to own the `bodhi/__init__.py` file, but unfortunately I then discovered that the init file contains server code. Due to this, I have decided to formally split the server and client code now so we have a clear separation between them.

Thus, this task is needed for #142.

This is needed to resolve https://bugzilla.redhat.com/show_bug.cgi?id=1372461


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -11,12 +11,15 @@
 import sys
 
 from setuptools import setup, find_packages
+import setuptools.command.egg_info
+
 
 here = os.path.abspath(os.path.dirname(__file__))
 README = open(os.path.join(here, 'README.rst')).read()
 CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+VERSION = '2.1.9'
 
-requires = [
+server_requires = [
     'pyramid',
     'pyramid_mako',
     'pyramid_debugtoolbar',
@@ -63,36 +66,34 @@
 
     'Sphinx',
 
-    # For the bodhi-client
-    'click',
-
     'WebOb>=1.4.1',
     ]
 
 if sys.version_info[:3] < (2,7,0):
-    requires.append('importlib')
+    server_requires.append('importlib')
 
 if sys.version_info[:3] < (2,5,0):
-    requires.append('pysqlite')
+    server_requires.append('pysqlite')
+
+
+setuptools.command.egg_info.manifest_maker.template = 'BODHI_MANIFEST.in'
+
 
 setup(name='bodhi',
-      version='2.1.9',
-      description='bodhi',
+      version=VERSION,
+      description='bodhi common package',
       long_description=README + '\n\n' +  CHANGES,
       classifiers=[
         "Programming Language :: Python",
-        "Framework :: Pyramid",
-        "Topic :: Internet :: WWW/HTTP",
-        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
         ],
       author='',
       author_email='',
       url='',
-      keywords='web fedora pyramid',
-      packages=find_packages(),
+      keywords='fedora',
+      packages=['bodhi'],
       include_package_data=True,
       zip_safe=False,
-      install_requires = requires,
+      install_requires = [],
       tests_require = [
           'nose',
           'nose-cov',
@@ -100,6 +101,57 @@
           'mock'
       ],
       test_suite="nose.collector",
+      )
+
+
+setuptools.command.egg_info.manifest_maker.template = 'CLIENT_MANIFEST.in'
+
+
+setup(name='bodhi-client',
+      version=VERSION,
+      description='bodhi client',
+      long_description=README + '\n\n' +  CHANGES,
+      classifiers=[
+        "Programming Language :: Python",
+        ],
+      author='',
+      author_email='',
+      url='',
+      keywords='fedora',
+      packages=['bodhi.client'],
+      include_package_data=False,
+      zip_safe=False,
+      install_requires = ['click'],
+      entry_points = """\
+      [console_scripts]
+      bodhi = bodhi.client:cli
+      """,
+      )
+
+
+setuptools.command.egg_info.manifest_maker.template = 'SERVER_MANIFEST.in'
+
+
+setup(name='bodhi-server',
+      version=VERSION,
+      description='bodhi server',
+      long_description=README + '\n\n' +  CHANGES,
+      classifiers=[
+        "Programming Language :: Python",
+        "Framework :: Pyramid",
+        "Topic :: Internet :: WWW/HTTP",
+        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
+        ],
+      author='',
+      author_email='',
+      url='',
+      keywords='web fedora pyramid',
+      packages=find_packages(
+          exclude=['bodhi', 'bodhi.client', 'bodhi.client.*', 'bodhi.tests', 'bodhi.tests.*']),
+      include_package_data=True,
+#      script_args=sys.argv.extend(['--template', 'TEST']),
+      zip_safe=False,
+      install_requires = server_requires,
       message_extractors = { '.': [
           #('**.py', 'lingua_python', None),
           #('**.mak', 'lingua_xml', None),
@@ -109,7 +161,6 @@
       main = bodhi.server:main
       [console_scripts]
       initialize_bodhi_db = bodhi.server.scripts.initializedb:main
-      bodhi = bodhi.client:cli
       bodhi-push = bodhi.server.push:push
       bodhi-expire-overrides = bodhi.server.scripts.expire_overrides:main
       bodhi-untag-branched = bodhi.server.scripts.untag_branched:main
@@ -121,4 +172,3 @@
       """,
       paster_plugins=['pyramid'],
       )
-


Test patch: