Skip to content

Commit

Permalink
use new long_description_content_type to finally resolve problem of l…
Browse files Browse the repository at this point in the history
…og description markup translation
  • Loading branch information
Michał Jaworski committed Apr 18, 2018
1 parent d3b6230 commit d4678cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
23 changes: 7 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ def get_version(version_tuple):
return '.'.join(map(str, version_tuple))


def read(filename):
with open(filename, 'r') as file:
return file.read()


init = os.path.join(
os.path.dirname(__file__),
'src', 'graceful', '__init__.py'
Expand All @@ -21,21 +26,6 @@ def get_version(version_tuple):
'singledispatch',
]

try:
from pypandoc import convert

def read_md(f):
return convert(f, 'rst')

except ImportError:
convert = None
print(
"warning: pypandoc module not found, could not convert Markdown to RST"
)

def read_md(f):
return open(f, 'r').read() # noqa

README = os.path.join(os.path.dirname(__file__), 'README.md')
PACKAGES = find_packages('src')
PACKAGE_DIR = {'': 'src'}
Expand All @@ -46,7 +36,8 @@ def read_md(f):
author='Michał Jaworski',
author_email='swistakm@gmail.com',
description='Elegant Python REST toolkit built on top of falcon',
long_description=read_md(README),
long_description=read(README),
long_description_content_type="text/markdown",
packages=PACKAGES,
package_dir=PACKAGE_DIR,

Expand Down
2 changes: 1 addition & 1 deletion src/graceful/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
It is inspired by Django REST Framework package. Mostly by how object
serialization is done but more emphasis is put on API to be self-descriptive.
"""
VERSION = (0, 6, 1) # PEP 386 # noqa
VERSION = (0, 6, 3) # PEP 386 # noqa
__version__ = ".".join([str(x) for x in VERSION]) # noqa

0 comments on commit d4678cb

Please sign in to comment.