From dcc48e37df4800d3d5f27755d86cda75b0eecf99 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 11 Aug 2017 20:34:47 +0200 Subject: [PATCH] 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. --- instaloader.py | 2 +- setup.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/instaloader.py b/instaloader.py index c401661..9318243 100755 --- a/instaloader.py +++ b/instaloader.py @@ -27,7 +27,7 @@ import requests.utils import urllib3 -__version__ = '3.0-rc0' +__version__ = '3.0rc0' try: diff --git a/setup.py b/setup.py index 657c334..58dc2ce 100755 --- a/setup.py +++ b/setup.py @@ -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']},