1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry-core
5, numpy
6}:
7
8buildPythonPackage rec {
9 pname = "nbtlib";
10 version = "2.0.4";
11 format = "pyproject";
12
13 src = fetchFromGitHub {
14 owner = "vberlier";
15 repo = "nbtlib";
16 rev = "v${version}";
17 hash = "sha256-L8eX6/0qiQ4UxbmDicLedzj+oBjYmlK96NpljE/A3eI=";
18 };
19
20 prePatch = ''
21 substituteInPlace pyproject.toml \
22 --replace "poetry>=0.12" "poetry-core" \
23 --replace "poetry.masonry" "poetry.core.masonry"
24 '';
25
26 nativeBuildInputs = [
27 poetry-core
28 ];
29
30 propagatedBuildInputs = [
31 numpy
32 ];
33
34 pythonImportsCheck = [ "nbtlib" ];
35
36 meta = with lib; {
37 description = "A python library to read and edit nbt data";
38 homepage = "https://github.com/vberlier/nbtlib";
39 changelog = "https://github.com/vberlier/nbtlib/blob/${src.rev}/CHANGELOG.md";
40 license = licenses.mit;
41 maintainers = with maintainers; [ gdd ];
42 };
43}