Skip to content

Commit

Permalink
Add get_long_description
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Mar 1, 2019
1 parent 4c2d63b commit a4c7a16
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import subprocess
import sys

import github2pypi


PY3 = sys.version_info[0] == 3
PY2 = sys.version_info[0] == 2
Expand Down Expand Up @@ -95,14 +93,17 @@
sys.exit(0)


if not hasattr(github2pypi, '__file__'):
print('Please update submodule:\n\n\tgit submodule update --init')
sys.exit(1)
def get_long_description():
with open('README.md') as f:
long_description = f.read()

try:
import github2pypi
except ImportError:
return long_description

with open('README.md') as f:
long_description = github2pypi.replace_url(
slug='wkentaro/labelme', content=f.read()
return github2pypi.replace_url(
slug='wkentaro/labelme', content=long_description
)


Expand All @@ -111,7 +112,7 @@
version=version,
packages=find_packages(),
description='Image Polygonal Annotation with Python',
long_description=long_description,
long_description=get_long_description(),
long_description_content_type='text/markdown',
author='Kentaro Wada',
author_email='[email protected]',
Expand Down

0 comments on commit a4c7a16

Please sign in to comment.