mirror of
https://github.com/vale981/rmview
synced 2025-03-05 09:11:39 -05:00
Codegen resources.py
This commit is contained in:
parent
6ccc6575d4
commit
94de29192a
1 changed files with 36 additions and 1 deletions
35
setup.py
35
setup.py
|
@ -1,5 +1,35 @@
|
|||
from setuptools.command.install import install
|
||||
from setuptools.command.develop import develop
|
||||
from setuptools.command.egg_info import egg_info
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
import sys
|
||||
|
||||
def genResources():
|
||||
from PyQt5.pyrcc_main import main as pyrcc_main
|
||||
saved_argv = sys.argv
|
||||
# Use current environment to find pyrcc but use the public interface
|
||||
sys.argv = ['pyrcc5', '-o', 'src/resources.py', 'resources.qrc']
|
||||
pyrcc_main()
|
||||
sys.argv = saved_argv
|
||||
|
||||
# https://stackoverflow.com/questions/19569557/pip-not-picking-up-a-custom-install-cmdclass
|
||||
class genResourcesInstall(install):
|
||||
def run(self):
|
||||
genResources()
|
||||
install.run(self)
|
||||
|
||||
class genResourcesDevelop(develop):
|
||||
def run(self):
|
||||
genResources()
|
||||
develop.run(self)
|
||||
|
||||
class genResourcesEggInfo(egg_info):
|
||||
def run(self):
|
||||
genResources()
|
||||
egg_info.run(self)
|
||||
|
||||
setup(
|
||||
name='rmview',
|
||||
version='0.1',
|
||||
|
@ -14,5 +44,10 @@ setup(
|
|||
install_requires=['pyqt5', 'paramiko', 'twisted'],
|
||||
entry_points={
|
||||
'console_scripts':['rmview = rmview.rmview:rmViewMain']
|
||||
},
|
||||
cmdclass={
|
||||
'install': genResourcesInstall,
|
||||
'develop': genResourcesDevelop,
|
||||
'egg_info': genResourcesEggInfo,
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue