mirror of
https://github.com/vale981/rmview
synced 2025-03-05 17:21:39 -05:00
Codegen resources.py
This commit is contained in:
parent
6ccc6575d4
commit
94de29192a
1 changed files with 36 additions and 1 deletions
37
setup.py
37
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
|
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(
|
setup(
|
||||||
name='rmview',
|
name='rmview',
|
||||||
version='0.1',
|
version='0.1',
|
||||||
|
@ -13,6 +43,11 @@ setup(
|
||||||
packages=['rmview'],
|
packages=['rmview'],
|
||||||
install_requires=['pyqt5', 'paramiko', 'twisted'],
|
install_requires=['pyqt5', 'paramiko', 'twisted'],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts':['rmview = rmview.rmview:rmViewMain']
|
'console_scripts':['rmview = rmview.rmview:rmViewMain']
|
||||||
|
},
|
||||||
|
cmdclass={
|
||||||
|
'install': genResourcesInstall,
|
||||||
|
'develop': genResourcesDevelop,
|
||||||
|
'egg_info': genResourcesEggInfo,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue