https://github.com/xmikos/setup_qt
Compile Qt resource files, UI files and translations in setup.py
https://github.com/xmikos/setup_qt
Last synced: 4 months ago
JSON representation
Compile Qt resource files, UI files and translations in setup.py
- Host: GitHub
- URL: https://github.com/xmikos/setup_qt
- Owner: xmikos
- License: mit
- Created: 2017-03-23T16:40:54.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T22:41:50.000Z (about 4 years ago)
- Last Synced: 2025-02-02T02:22:42.701Z (5 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 8
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
setup_qt
========Compile Qt resource files, UI files and translations in setup.py
Can be used with PyQt4, PyQt5, PySide and PySide2. Usage of Qt bindings
wrappers like `Qt.py `_ or
`QtPy `_ is also supported.Requirements
------------- Python >= 3.4
- Setuptools (https://github.com/pypa/setuptools)
- PyQt4 / PyQt5 / PySide / PySide2Example
-------**setup.py:**
.. code-block:: python
from setuptools import setup
from setup_qt import build_qt
setup(
name='example',
version='1.0.0',
description='setup_qt example',
author='Monty Python',
author_email='[email protected]',
url='https://www.example.com',
license='MIT',
packages=['example'],
package_data={
'example': [
'*.ui',
'*.qrc',
'languages/*.ts',
'languages/*.qm',
],
},
entry_points={
'gui_scripts': [
'example=example.__main__:main',
],
},
install_requires=[
'PyQt5',
'Qt.py',
],
options=[
'build_qt': {
'packages': ['example'],
'languages': ['cs'], # optional
'languages_dir': 'languages', # optional ('languages' is default)
'bindings': 'PyQt5', # optional ('PyQt5' is default)
'replacement_bindings': 'Qt', # optional (for Qt.py wrapper usage)
},
],
cmdclass={
'build_qt': build_qt,
},
)**Usage:**
::[user@host ~]$ python setup.py build_qt
running build_qt
compiling example Qt resource files...
compiling example Qt UI files...
updating example Qt translation files...
compiling example Qt translation files...Help
----
::Options for 'build_qt' command:
--packages List of comma separated packages in which to
recursively find .qrc, .ui and .ts files
--languages List of comma separated translation languages (could
be empty)
--languages-dir Directory with translation files (could be empty,
default is "languages")
--bindings Qt binding from which to use pyrcc, pyuic and
pylupdate commands (default is PyQt5)
--replacement-bindings Qt bindings replacement (e.g. if using wrapper like
Qt.py or QtPy)
--pyrcc pyrcc command executable
--pyuic pyuic command executable
--pylupdate pylupdate command executable
--lrelease lrelease command executable
--filename-qrc name template for .py files compiled from .qrc files
--filename-ui name template for .py files compiled from .ui files
--filename-ts name template for newly created .ts files