diff --git a/setup.py b/setup.py index 52c8723a..9d5e588f 100644 --- a/setup.py +++ b/setup.py @@ -9,23 +9,10 @@ import subprocess import sys -import github2pypi - version = '3.7.3' -if not hasattr(github2pypi, '__file__'): - print('Please update submodule:\n\n\tgit submodule update --init') - sys.exit(1) - - -with open('README.md') as f: - long_description = github2pypi.replace_url( - slug='wkentaro/gdown', content=f.read() - ) - - if sys.argv[1] == 'release': if not distutils.spawn.find_executable('twine'): print( @@ -46,13 +33,27 @@ sys.exit(0) +def get_long_description(): + with open('README.md') as f: + long_description = f.read() + + try: + import github2pypi + except ImportError: + return long_description + + return github2pypi.replace_url( + slug='wkentaro/gdown', content=long_description + ) + + setup( name='gdown', version=version, packages=find_packages(), install_requires=['filelock', 'requests', 'six', 'tqdm'], description='Google Drive direct download of big files.', - long_description=long_description, + long_description=get_long_description(), long_description_content_type='text/markdown', author='Kentaro Wada', author_email='www.kentaro.wada@gmail.com',