2016-12-10 23:40:43 +00:00
|
|
|
from setuptools import setup
|
2017-06-10 19:16:51 +00:00
|
|
|
from setuptools.command.develop import develop
|
|
|
|
from setuptools.command.install import install
|
|
|
|
|
|
|
|
|
|
|
|
class PostDevelopCommand(develop):
|
|
|
|
"""Post-installation for development mode."""
|
|
|
|
def run(self):
|
|
|
|
# PUT YOUR PRE-INSTALL SCRIPT HERE or CALL A FUNCTION
|
|
|
|
develop.run(self)
|
|
|
|
# PUT YOUR POST-INSTALL SCRIPT HERE or CALL A FUNCTION
|
|
|
|
|
|
|
|
|
|
|
|
class PostInstallCommand(install):
|
|
|
|
"""Post-installation for installation mode."""
|
|
|
|
def run(self):
|
|
|
|
install.run(self) # Actually install the module and dependencies
|
|
|
|
|
2017-06-10 19:31:15 +00:00
|
|
|
try:
|
|
|
|
import ydl_binaries
|
|
|
|
except ImportError:
|
|
|
|
import pip
|
|
|
|
pip.main(['install', "ydl-binaries"])
|
2017-06-10 19:21:17 +00:00
|
|
|
|
2017-06-10 19:16:51 +00:00
|
|
|
import ydl_binaries
|
|
|
|
from os import path
|
|
|
|
from shutil import copyfile
|
|
|
|
|
|
|
|
print("\n\nDownloading Dependencies:\n")
|
2017-06-11 01:11:00 +00:00
|
|
|
ydl_binaries.download_ffmpeg("~/.irs/bin")
|
|
|
|
ydl_binaries.update_ydl("~/.irs/bin")
|
2017-06-10 19:16:51 +00:00
|
|
|
|
|
|
|
config_file = path.expanduser("~/.irs/config_.py")
|
|
|
|
if not path.isfile(config_file):
|
|
|
|
copyfile("irs/config_preset", config_file)
|
|
|
|
|
2016-12-10 23:40:43 +00:00
|
|
|
|
|
|
|
setup(
|
2017-04-22 02:15:56 +00:00
|
|
|
name = 'irs',
|
2017-05-12 23:37:21 +00:00
|
|
|
version = '6.5.6',
|
2017-04-22 02:15:56 +00:00
|
|
|
description = 'A music downloader that just gets metadata.',
|
|
|
|
url = 'https://github.com/kepoorhampond/irs',
|
|
|
|
author = 'Kepoor Hampond',
|
|
|
|
author_email = 'kepoorh@gmail.com',
|
|
|
|
license = 'GPL',
|
|
|
|
packages = ['irs'],
|
2017-06-10 19:16:51 +00:00
|
|
|
install_requires = [
|
2017-04-22 02:15:56 +00:00
|
|
|
'bs4',
|
|
|
|
'mutagen',
|
|
|
|
'requests',
|
|
|
|
'spotipy',
|
2017-06-10 19:16:51 +00:00
|
|
|
'ydl-binaries'
|
2016-12-10 23:40:43 +00:00
|
|
|
],
|
2016-12-11 06:56:50 +00:00
|
|
|
entry_points = {
|
2017-04-22 02:15:56 +00:00
|
|
|
'console_scripts': ['irs = irs.cli:main'],
|
2016-12-10 23:40:43 +00:00
|
|
|
},
|
2017-06-10 19:16:51 +00:00
|
|
|
cmdclass = {
|
|
|
|
'develop': PostDevelopCommand,
|
|
|
|
'install': PostInstallCommand,
|
|
|
|
},
|
2016-12-10 23:40:43 +00:00
|
|
|
)
|