Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setup.py #448

Closed
wants to merge 2 commits into from
Closed

Add setup.py #448

wants to merge 2 commits into from

Conversation

JakobDev
Copy link

This PR tries to create a Whell for Python. It should close #364. The code was copied from StackOverflow.

What does work?
I created a small demo program to test:

from PyQt5.QtWidgets import QApplication
from QTermWidget import QTermWidget
import sys


if __name__ == "__main__":
    app = QApplication(sys.argv)
    term = QTermWidget()
    term.show()
    sys.exit(app.exec())

I used the follwing enviroment:
A VM wwith Arch Linux. All needed packages to build are installed. PyQt5 is installed with Pacman. QTermWidget is not installed.

How to build:

python setup.py bdist_wheel
pip install ./dist/*.whl

The demo program above worked.

What does not work?
The package dosen't contain data files such as the color-schemes. I needed to figure out how to copy them from the lib folder into the package and QTermWidget needs to recognize they on this place.

Building from a source package does also not work.

python setup.py bdist_wheel
pip install ./dist/QTermWidget-0.1.tar.gz

The build and instalation have no problems. But when I try to run I get the following error:

ImportError: libqtermwidget5.so.0: cannot open shared object file: No such file or directory

libqtermwidget5.so.0 is in the same folder as the rest. It has the same files like the wheel, so I don't know what's the problem here.

What was not tested?
I don't know if the Binaries are working on other systems than mine. We may have to take a look at manylinux.

@JakobDev
Copy link
Author

JakobDev commented Nov 2, 2021

The data files are now included. QTermWidget need now to be patched to find them, but that is out of my scope.

I noticed that I can fix ImportError from the source build by adding the directory with the package to LD_LIBRARY_PATH. I don't know why this is only needed when using a source package. Maybe someone who knows more about C++ and building can take a look at that.

@yan12125
Copy link
Member

yan12125 commented Nov 6, 2021

FWIW, I'm working on moving the PyQt builder from SIP 4.x to the latest SIP (6.x) on branch https://github.com/lxqt/qtermwidget/tree/sip5. One of major changes in newer SIP is that it builds wheels out-of-box.

@yan12125
Copy link
Member

I believe this is not necessary anymore after the SIP 5.x support (#465) is merged. Feel free to propose improvements for newly-added files ;)

@yan12125 yan12125 closed this Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload to PyPI
2 participants