Skip to content

Commit

Permalink
dist: change the way how long description is handled in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Jaworski committed May 3, 2018
1 parent ee1795b commit 44ee6d9
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,16 @@ def get_version(version_tuple):
return '.'.join(map(str, version_tuple))


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


init = os.path.join(os.path.dirname(__file__), 'src', 'ianitor', '__init__.py')
version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0]
VERSION = get_version(eval(version_line.split('=')[-1]))

INSTALL_REQUIRES = reqs('requirements.txt')

try:
from pypandoc import convert

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

except ImportError:
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 @@ -66,7 +56,8 @@ def read_md(f):
author='Clearcode - The A Room',
author_email='[email protected]',
description='Doorkeeper for consul discovered services.',
long_description=read_md(README),
long_description=read(README),
long_description_content_type="text/markdown",

packages=PACKAGES,
package_dir=PACKAGE_DIR,
Expand Down

0 comments on commit 44ee6d9

Please sign in to comment.