mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
setup.py: add 'gui' extra. potentially build Qt icons files (#4647)
This commit is contained in:
parent
1b19cdd0f4
commit
c99007bda7
1 changed files with 27 additions and 3 deletions
30
setup.py
30
setup.py
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
# python setup.py sdist --format=zip,gztar
|
# python setup.py sdist --format=zip,gztar
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
import imp
|
import imp
|
||||||
import argparse
|
import argparse
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from setuptools import setup, find_packages
|
||||||
|
from setuptools.command.install import install
|
||||||
|
|
||||||
with open('contrib/requirements/requirements.txt') as f:
|
with open('contrib/requirements/requirements.txt') as f:
|
||||||
requirements = f.read().splitlines()
|
requirements = f.read().splitlines()
|
||||||
|
@ -43,8 +46,26 @@ if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
|
||||||
extras_require = {
|
extras_require = {
|
||||||
'hardware': requirements_hw,
|
'hardware': requirements_hw,
|
||||||
'fast': ['pycryptodomex'],
|
'fast': ['pycryptodomex'],
|
||||||
|
'gui': ['pyqt5'],
|
||||||
}
|
}
|
||||||
extras_require['full'] = extras_require['hardware'] + extras_require['fast']
|
extras_require['full'] = [pkg for sublist in list(extras_require.values()) for pkg in sublist]
|
||||||
|
|
||||||
|
|
||||||
|
class CustomInstallCommand(install):
|
||||||
|
def run(self):
|
||||||
|
install.run(self)
|
||||||
|
# potentially build Qt icons file
|
||||||
|
try:
|
||||||
|
import PyQt5
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
path = os.path.join(self.install_lib, "electrum/gui/qt/icons_rc.py")
|
||||||
|
if not os.path.exists(path):
|
||||||
|
subprocess.call(["pyrcc5", "icons.qrc", "-o", path])
|
||||||
|
except Exception as e:
|
||||||
|
print('Warning: building icons file failed with {}'.format(e))
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
@ -75,5 +96,8 @@ setup(
|
||||||
author_email="thomasv@electrum.org",
|
author_email="thomasv@electrum.org",
|
||||||
license="MIT Licence",
|
license="MIT Licence",
|
||||||
url="https://electrum.org",
|
url="https://electrum.org",
|
||||||
long_description="""Lightweight Bitcoin Wallet"""
|
long_description="""Lightweight Bitcoin Wallet""",
|
||||||
|
cmdclass={
|
||||||
|
'install': CustomInstallCommand,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue