Commits

Yu-Jie Lin  committed 2f17095

improve packaging and add long_description for PyPI

  • Participants
  • Parent commits e35ec6b

Comments (0)

Files changed (6)

+include README-PyPI.rst
+BUILD_CMD=./setup.py sdist --formats gztar,zip bdist_wininst --plat-name win32
+
+build:
+	$(BUILD_CMD)
+
+upload:
+	$(BUILD_CMD) upload
+
+.PHONY: build upload

File README-PyPI.rst

+b.py
+====
+
+Enabling bloggers to publish posts in their favorite markup language to Blogger or WordPress.
+
+Examples
+--------
+
+.. code:: sh
+
+  b.py -s blogger post foobar.rst
+  b.py -s wordpress post foobar.md
+
+More information
+----------------
+
+Please visit b.py_ on Bitbucket.
+
+.. _b.py: http://bitbucket.org/livibetter/b.py
 __program__ = 'b.py'
 __description__ = 'Post to Blogger or WordPress in markup language seamlessly'
 __copyright__ = 'Copyright 2013, Yu Jie Lin'
-__license__ = 'MIT'
+__license__ = 'MIT License'
 __version__ = '0.6.0'
 __website__ = 'http://bitbucket.org/livibetter/b.py'
 
 __author__ = 'Yu-Jie Lin'
-__email__ = 'livibetter@gmail.com'
+__author_email__ = 'livibetter@gmail.com'
 
 
 # b.py stuff
                'author_email']
   meta = dict([m for m in meta.items() if m[0] in meta_keys])
 
+with open('README-PyPI.rst') as f:
+  long_description = f.read()
+
 classifiers = [
   'Development Status :: 3 - Alpha',
   'Environment :: Console',
 ]
 
 setup_d = dict(
+  long_description=long_description,
   cmdclass={
     'pep8': cmd_pep8,
     'pyflakes': cmd_pyflakes,

File tests/test_setup.py

+# Copyright (C) 2013 by Yu-Jie Lin
+#
+# 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.
+
+from docutils.core import publish_string
+import unittest
+
+
+class SetupTestCase(unittest.TestCase):
+
+    def test_long_description(self):
+        """Ensure long description can be generated"""
+        with open('README-PyPI.rst') as f:
+            long_description = f.read()
+
+        overrides = {
+            # raises exception at warning level (2)
+            'halt_level': 2,
+            'raw_enabled': False,
+        }
+        html = publish_string(long_description, writer_name='html',
+                              settings_overrides=overrides)
+        self.assertTrue(html)