-
-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyside6: ensure PySide6 can be imported and used
The PySide6/__init__.py script is at runtime trying to find the dependent Qt libraries in subdirectories of its path in the installed site-packages directory. This fails because the dependent pyside6-essentials and pyside6-addons packages aren't installed into the same site-packages directory. As a work-around this commit symlinks those files into the site-packages directory of the `pyside6` package. This commit also adds a small application that imports and verifies that PySide6 can be used after building.
- Loading branch information
Viktor Kronvall
committed
Sep 16, 2024
1 parent
f684558
commit f98eb8d
Showing
5 changed files
with
64 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
{ lib, poetry2nix, python310 }: | ||
|
||
poetry2nix.mkPoetryApplication { | ||
python = python310; | ||
pyproject = ./pyproject.toml; | ||
poetrylock = ./poetry.lock; | ||
src = lib.cleanSource ./.; | ||
{ lib, poetry2nix, python310, runCommand, gnugrep }: | ||
let | ||
app = poetry2nix.mkPoetryApplication { | ||
python = python310; | ||
pyproject = ./pyproject.toml; | ||
poetrylock = ./poetry.lock; | ||
src = lib.cleanSource ./.; | ||
pythonImportsCheck = [ | ||
"test_pyside6" | ||
]; | ||
}; | ||
in | ||
(runCommand "test-pyside6" | ||
{ | ||
nativeBuildInputs = [ gnugrep ]; | ||
} '' | ||
set -euo pipefail | ||
${app}/bin/test_pyside6 > $out | ||
grep QPoint < $out | ||
grep Success < $out | ||
'') // { | ||
inherit (app.python.pkgs) pyside6-addons pyside6-essentials; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name = "test_pyside6" | |
version = "0.1.0" | ||
description = "" | ||
authors = ["considerate <[email protected]>"] | ||
packages = [{include = "test_pyside6", from = "."}] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10,<3.12" | ||
|
@@ -11,6 +12,9 @@ pyside6 = "<6.5.3" | |
|
||
[tool.poetry.dev-dependencies] | ||
|
||
[tool.poetry.scripts] | ||
test_pyside6 = "test_pyside6:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1"] | ||
build-backend = "poetry.core.masonry.api" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from PySide6.QtCore import QPoint | ||
import sys | ||
|
||
|
||
def main(): | ||
print(QPoint(2.5,6.0)) | ||
|
||
print("Success") | ||
|
||
if __name__ == '__main__': | ||
main() |