Files
nixpkgs/pkgs/development/python-modules/ipyniivue/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.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchNpmDeps,
pythonOlder,
nodejs,
npmHooks,
hatchling,
hatch-vcs,
anywidget,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "ipyniivue";
version = "2.1.0";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "niivue";
repo = "ipyniivue";
rev = "v${version}";
hash = "sha256-rgScBBJ0Jqr5REZ+YFJcKwWcV33RzJ/sn6RqTL/limo=";
};
npmDeps = fetchNpmDeps {
name = "${pname}-${version}-npm-deps";
inherit src;
hash = "sha256-3IR2d4/i/e1dRlvKN21XnadUfx2lP5SuToQJ9tMhzp4=";
};
# We do not need the build hooks, because we do not need to
# build any JS components; these are present already in the PyPI artifact.
env.HATCH_BUILD_NO_HOOKS = true;
nativeBuildInputs = [
nodejs
npmHooks.npmConfigHook
];
preBuild = ''
npm run build
'';
build-system = [
hatchling
hatch-vcs
];
dependencies = [ anywidget ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "ipyniivue" ];
meta = with lib; {
description = "Show a nifti image in a webgl 2.0 canvas within a jupyter notebook cell";
homepage = "https://github.com/niivue/ipyniivue";
changelog = "https://github.com/niivue/ipyniivue/releases/tag/${version}";
license = licenses.bsd3;
maintainers = with maintainers; [ bcdarwin ];
};
}