nixpkgs/pkgs/development/python-modules/matplotx/default.nix
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

66 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
setuptools,
matplotlib,
numpy,
networkx,
pypng,
scipy,
}:
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
];
optional-dependencies = {
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.
env.MPLBACKEND = lib.optionalString stdenv.hostPlatform.isDarwin "Agg";
nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.all;
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";
mainProgram = "matplotx";
changelog = "https://github.com/nschloe/matplotx/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ swflint ];
};
}