Files
nixpkgs/pkgs/development/python-modules/orange-widget-base/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

63 lines
1.4 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
pyqt5,
pyqtwebengine,
matplotlib,
orange-canvas-core,
pyqtgraph,
typing-extensions,
qt5,
pytestCheckHook,
pytest-qt,
appnope,
}:
buildPythonPackage rec {
pname = "orange-widget-base";
version = "4.24.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-2cBg7s4+qMrb2G4sMk5yednOzJCNheHIQ3lty4KAg18=";
};
propagatedBuildInputs = [
matplotlib
orange-canvas-core
pyqt5
pyqtgraph
pyqtwebengine
typing-extensions
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ appnope ];
pythonImportsCheck = [ "orangewidget" ];
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
'';
nativeCheckInputs = [
pytest-qt
pytestCheckHook
];
disabledTestPaths = [
"orangewidget/report/tests/test_report.py"
"orangewidget/tests/test_widget.py"
];
meta = {
description = "Implementation of the base OWBaseWidget class and utilities for use in Orange Canvas workflows";
homepage = "https://github.com/biolab/orange-widget-base";
license = [ lib.licenses.gpl3Plus ];
maintainers = [ lib.maintainers.lucasew ];
};
}