2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
setuptools,
|
|
|
|
matplotlib,
|
|
|
|
numpy,
|
|
|
|
networkx,
|
|
|
|
pypng,
|
|
|
|
scipy,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "matplotx";
|
|
|
|
version = "0.3.10";
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nschloe";
|
|
|
|
repo = "matplotx";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-EWEiEY23uFwd/vgWVLCH/buUmgRqz1rqqlJEdXINYMg=";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
optional-dependencies = {
|
2023-07-15 17:15:38 +00:00
|
|
|
all = [
|
|
|
|
networkx
|
|
|
|
pypng
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
contour = [ networkx ];
|
|
|
|
spy = [
|
|
|
|
pypng
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# This variable is needed to suppress the "Trace/BPT trap: 5" error in Darwin's checkPhase.
|
|
|
|
# Not sure of the details, but we can avoid it by changing the matplotlib backend during testing.
|
2024-09-26 11:04:55 +00:00
|
|
|
env.MPLBACKEND = lib.optionalString stdenv.hostPlatform.isDarwin "Agg";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.all;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_spy.py" # Requires meshzoo (non-free) and pytest-codeblocks (not packaged)
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "matplotx" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/nschloe/matplotx";
|
|
|
|
description = "More styles and useful extensions for Matplotlib";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "matplotx";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/nschloe/matplotx/releases/tag/v${version}";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ swflint ];
|
|
|
|
};
|
|
|
|
}
|