toxygen/setup.py

70 lines
2 KiB
Python
Raw Normal View History

2016-07-05 21:43:51 +03:00
from setuptools import setup
from setuptools.command.install import install
from platform import system
2016-07-06 16:25:04 +03:00
from subprocess import call
from toxygen.util import program_version
2016-07-27 15:45:34 +03:00
import sys
2016-07-05 21:43:51 +03:00
2016-07-06 16:25:04 +03:00
version = program_version + '.0'
2017-06-24 15:44:55 +03:00
MODULES = ['PyQt5', 'PyAudio']
2017-06-13 00:36:45 +03:00
DEP_LINKS = []
2016-08-08 12:10:18 +03:00
2017-06-24 15:44:55 +03:00
if system() != 'Windows':
MODULES.append('numpy')
else:
DEP_LINKS = [] # TODO: add opencv wheel and numpy wheel
2016-07-06 16:25:04 +03:00
class InstallScript(install):
2016-07-11 17:24:39 +03:00
"""This class configures Toxygen after installation"""
2016-07-06 16:25:04 +03:00
2016-07-05 21:43:51 +03:00
def run(self):
install.run(self)
2016-07-26 19:09:57 +03:00
try:
if system() == 'Windows':
call(["toxygen", "--configure"])
else:
call(["toxygen", "--clean"])
except:
2016-07-27 15:45:34 +03:00
try:
params = list(filter(lambda x: x.startswith('--prefix='), sys.argv))
if params:
path = params[0][len('--prefix='):]
if path[-1] not in ('/', '\\'):
path += '/'
path += 'bin/toxygen'
if system() == 'Windows':
call([path, "--configure"])
else:
call([path, "--clean"])
except:
pass
2016-07-05 21:43:51 +03:00
setup(name='Toxygen',
2016-07-06 16:25:04 +03:00
version=version,
2016-07-05 21:43:51 +03:00
description='Toxygen - Tox client',
long_description='Toxygen is powerful Tox client written in Python3',
2016-10-28 00:55:34 +03:00
url='https://github.com/toxygen-project/toxygen/',
2016-07-11 17:24:39 +03:00
keywords='toxygen tox messenger',
2016-07-05 21:43:51 +03:00
author='Ingvar',
2016-07-11 17:24:39 +03:00
maintainer='Ingvar',
2016-07-05 21:43:51 +03:00
license='GPL3',
2016-07-06 16:25:04 +03:00
packages=['toxygen', 'toxygen.plugins', 'toxygen.styles'],
install_requires=MODULES,
2016-08-08 12:10:18 +03:00
dependency_links=DEP_LINKS,
2016-07-05 21:43:51 +03:00
include_package_data=True,
classifiers=[
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
2016-07-05 21:43:51 +03:00
],
entry_points={
2016-07-06 16:25:04 +03:00
'console_scripts': ['toxygen=toxygen.main:main'],
2016-07-05 21:43:51 +03:00
},
cmdclass={
2016-07-06 16:25:04 +03:00
'install': InstallScript,
2016-07-05 21:43:51 +03:00
},
)