Minor fix regarding setup.py

Now, setup.py does not assume to be called from the path where the
source tree resides. This fixes getting the long_description and the
version if setup.py is called from outside.
This commit is contained in:
Alexander Graf 2017-08-11 20:34:47 +02:00
parent 117124d1dd
commit dcc48e37df
2 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@ import requests.utils
import urllib3
__version__ = '3.0-rc0'
__version__ = '3.0rc0'
try:

View File

@ -2,11 +2,15 @@
import re
import sys
import os
from setuptools import setup
SRC = os.path.abspath(os.path.dirname(__file__))
def get_version():
with open('instaloader.py') as f:
with open(os.path.join(SRC, 'instaloader.py')) as f:
for line in f:
m = re.match("__version__ = '(.*)'", line)
if m:
@ -27,7 +31,7 @@ setup(
author_email='mail@agraf.me, koch-kramer@web.de',
description='Download pictures (or videos) along with their captions and other metadata '
'from Instagram.',
long_description=open('README.rst').read(),
long_description=open(os.path.join(SRC, 'README.rst')).read(),
install_requires=['requests>=2.4'],
python_requires='>=3.5',
entry_points={'console_scripts': ['instaloader=instaloader:main']},