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