From 7fa85af61615757f7ef07e08dff3fc426371a7e2 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 2 Feb 2018 16:05:59 +0100 Subject: [PATCH] Fix setup.py by not importing __version__ --- setup.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a603573..c7e5b14 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,28 @@ +import re +import ast from setuptools import setup -from spotdl import __version__ # Created from README.md using pandoc with open('README.rst', 'r') as f: long_description = f.read() + +# This does not work as the dependencies imported are most +# likely just about to be installed :/ +# from spotdl import __version__ + +_version_re = re.compile(r'__version__\s+=\s+(.*)') + +with open('spotdl.py', 'r') as f: + version = str(ast.literal_eval(_version_re.search(f.read()).group(1))) + setup( name='spotify-downloader', py_modules=['spotdl'], # Tests are included automatically: # https://docs.python.org/3.6/distutils/sourcedist.html#specifying-the-files-to-distribute packages=['core'], - version=__version__, + version=version, install_requires=[ 'pathlib >= 1.0.1', 'youtube_dl >= 2017.5.1', @@ -27,6 +38,7 @@ setup( description='Download songs from YouTube using Spotify song URLs or playlists with albumart and meta-tags.', long_description=long_description, author='Ritiek Malhotra and the spotify-downloader contributors', + author_email='ritiekmalhotra123@gmail.com', license='MIT', url='https://github.com/ritiek/spotify-downloader', download_url='https://pypi.org/project/spotify-downloader/',