Merge pull request #257435 from paveloom/pyqtdarktheme

python3Packages.pyqtdarktheme: init at 2.1.0
This commit is contained in:
Peder Bergebakken Sundt 2024-04-21 18:33:57 +02:00 committed by GitHub
commit 152632627e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From 816afb6a3a6a340ae2a2a06dc054dd8e65ff9d8f Mon Sep 17 00:00:00 2001
From: Pavel Sobolev <paveloom@riseup.net>
Date: Mon, 30 Oct 2023 20:42:31 +0300
Subject: [PATCH] Add missing argument to the `proxy_style` initializer.
---
qdarktheme/_proxy_style.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qdarktheme/_proxy_style.py b/qdarktheme/_proxy_style.py
index b1fb358..f04f01e 100644
--- a/qdarktheme/_proxy_style.py
+++ b/qdarktheme/_proxy_style.py
@@ -14,7 +14,7 @@ class QDarkThemeStyle(QProxyStyle):
def __init__(self):
"""Initialize style proxy."""
- super().__init__()
+ super().__init__(None)
def standardIcon( # noqa: N802
self, standard_icon: QStyle.StandardPixmap, option: QStyleOption | None, widget
--
2.42.0

View File

@ -0,0 +1,70 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, darkdetect
, poetry-core
, pyqt5
, pytest-mock
, pytest-qt
, pytestCheckHook
, qt5
}:
buildPythonPackage rec {
pname = "pyqtdarktheme";
version = "2.1.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "5yutan5";
repo = "PyQtDarkTheme";
rev = "v${version}";
hash = "sha256-jK+wnIyPE8Bav0pzbvVisYYCzdRshYw1S2t0H3Pro5M=";
};
patches = [
./add-missing-argument-to-the-proxy-style-initializer.patch
];
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
darkdetect
];
nativeCheckInputs = [
pyqt5
pytest-mock
pytest-qt
pytestCheckHook
];
pythonImportsCheck = [
"qdarktheme"
];
prePatch = ''
sed -i 's#darkdetect = ".*"#darkdetect = "*"#' pyproject.toml
'';
preCheck = ''
export HOME=$(mktemp -d)
export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
export QT_QPA_PLATFORM=offscreen
'';
meta = with lib; {
description = "A flat dark theme for PySide and PyQt";
homepage = "https://pyqtdarktheme.readthedocs.io/en/stable";
license = licenses.mit;
maintainers = with maintainers; [ paveloom ];
};
}

View File

@ -11549,6 +11549,8 @@ self: super: with self; {
setuptools sip;
};
pyqtdarktheme = callPackage ../development/python-modules/pyqtdarktheme { };
pyqtdatavisualization = pkgs.libsForQt5.callPackage ../development/python-modules/pyqtdatavisualization {
inherit (self) buildPythonPackage pyqt5 pyqt-builder python pythonOlder
setuptools sip;