qtermwidget icon indicating copy to clipboard operation
qtermwidget copied to clipboard

Upload to PyPI

Open JakobDev opened this issue 5 years ago • 7 comments

It would be nice, if this can be publicised on PyPI. The installation is currently hard for Pytjhon developers who haven't worked with C/C++. And it can be added to the requirements, if it's on PyPI.

JakobDev avatar Oct 29 '20 13:10 JakobDev

A PyPi package would certainly be useful as it is the most reliable way to share PyQt apps across Linux distributions. Would also love to see this happen.

willbelr avatar Dec 19 '20 20:12 willbelr

That sounds a good idea but I have no experience on creating Python packages with C/C++ codes. Do you have an example setup.py?

yan12125 avatar Dec 24 '20 04:12 yan12125

My experience is limited to python packages, so I'm not sure how it could be done for a package containing CPP source which require build steps and non-python packages such as lxqt-build-tools. Perhaps it should be compiled before hand?

#!/usr/bin/python3
import setuptools
import setuptools.command.build_py

# Useful resources;
# https://pypi.org/classifiers/
# https://docs.python.org/3.8/distutils/setupscript.html (about package_data and data_files)

VERSION = "0.16.1-2"
CLASSIFIERS = [
    "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
    "License :: OSI Approved :: BSD License",
    "License :: Public Domain",
    "Operating System :: POSIX :: Linux",
    "Operating System :: POSIX :: BSD",
    "Operating System :: MacOS :: MacOS X",
    "Programming Language :: Python :: 3.6",
]


class Example(setuptools.command.build_py.build_py):
    def run(self):
        """ Add custom build steps during install """
        pass
        setuptools.command.build_py.build_py.run(self)


def setup():
    setuptools.setup(
        name="QTermWidget",
        description="A terminal widget for Qt, used by QTerminal",
        keywords="Terminal, Qt, PyQt",
        url="https://github.com/lxqt/qtermwidget",
        author="LXQt",
        version=VERSION,
        classifiers=CLASSIFIERS,
        install_requires=["pyqt5", "lxqt-build-tools"],  # lxqt-build-tools is not valid PyPi pkg, is it required though?
        cmdclass={"build_py": Example},  # Optionally add custom build steps
        packages=setuptools.find_packages(),
        data_files=[],
        # package_data={"": ["ui/icons/*.svg"]},
        # entry_points={"gui_scripts": [f"{ID}={ID}:main"]},  # No entry point needed as this is not a standalone program
    )


if __name__ == "__main__":
    setup()

willbelr avatar Dec 24 '20 13:12 willbelr

I believe the good approach would be to create a python wheel, like PyQt5 uses for PyPi.

https://github.com/pypa/wheel

willbelr avatar Dec 24 '20 14:12 willbelr

Any workarounds for distributing PyQt applications with QTermWidget?

irgolic avatar Feb 01 '21 01:02 irgolic

I created a pull request to use SIP 5.x for PyQt bindings at https://github.com/lxqt/qtermwidget/pull/465. As a bonus, the build script now creates a Python wheel. Although it's not suitable for PyPI yet (it requires libqtermwidget5.so.1 installed beforehand), it's a big step towards it. I hope everyone using PyQt can test the wheel and share the results - either good or bad.

yan12125 avatar Mar 06 '22 16:03 yan12125

Iam new to pyQT and Iam trying to build python bindings for QtermWidget. I could compile and install qtermwidget library but when i try to create a python wheel using sip-wheel --verbose, i get the below error. What iam I missing here. My library is installed in /usr/local/

cd QTermWidget/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /tmp/tmp0cyt8_wt/QTermWidget/QTermWidget.pro ) && make -f Makefile make[1]: Entering directory '/tmp/tmp0cyt8_wt/QTermWidget' g++ -c -pipe -O2 -fno-exceptions -Wall -Wextra -D_REENTRANT -fPIC -DPy_LIMITED_API=0x03080000 -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I.. -I/usr/include/python3.10 -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o sipQTermWidgetcmodule.o sipQTermWidgetcmodule.cpp /home/ndokuri/Qualcomm/QT5/qtermwidget/pyqt/sip/qtermwidget.sip:14:10: fatal error: qtermwidget.h: No such file or directory 14 | #include <qtermwidget.h> | ^~~~~~~~~~~~~~~ compilation terminated.

nado218 avatar Aug 22 '24 20:08 nado218