Skip to content

Commit

Permalink
python312Packages.amulet-core: init at 1.9.27
Browse files Browse the repository at this point in the history
  • Loading branch information
pluiedev committed Dec 10, 2024
1 parent ebd3d47 commit 5bab530
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
105 changes: 105 additions & 0 deletions pkgs/development/python-modules/amulet-core/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,

# build-system
setuptools,
wheel,
cython,
versioneer,
numpy,

# dependencies
amulet-nbt,
pymctranslate,
portalocker,
amulet-leveldb,
platformdirs,
lz4,
black,
pre-commit,
sphinx,
sphinx-autodoc-typehints,
sphinx-rtd-theme,

pytestCheckHook,
nix-update-script,
}:
let
version = "1.9.27";
in
buildPythonPackage {
pname = "amulet-core";
inherit version;
pyproject = true;

src = fetchFromGitHub {
owner = "Amulet-Team";
repo = "Amulet-Core";
tag = version;
hash = "sha256-kyUEF9bOVs51yD1kGnjMnDaB1Fiz78Kuvjwji3Qq1PQ=";
};

disabled = pythonOlder "3.9";

postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'versioneer-518' 'versioneer'
substituteInPlace setup.py \
--replace-fail "versioneer.get_version()" "'${version}'"
'';

build-system = [
setuptools
wheel
cython
versioneer
numpy
];

dependencies = [
numpy
amulet-nbt
pymctranslate
portalocker
amulet-leveldb
platformdirs
lz4
];

optional-dependencies = {
dev = [
black
pre-commit
];
docs = [
sphinx
sphinx-autodoc-typehints
sphinx-rtd-theme
];
};

pythonRelaxDeps = [ "platformdirs" ];

pythonImportsCheck = [ "amulet" ];

nativeCheckInputs = [ pytestCheckHook ];

preCheck = ''
# Required for tests that want to write to the home directory
export HOME=$(mktemp -d)
'';

passthru.updateScript = nix-update-script { };

meta = {
description = "Python library for reading and writing the Minecraft save formats";
homepage = "https://github.com/Amulet-Team/Amulet-Core";
changelog = "https://github.com/Amulet-Team/Amulet-Core/releases/tag/${version}";
license = with lib.licenses; [ amulet ];
maintainers = with lib.maintainers; [ pluiedev ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,8 @@ self: super: with self; {

amqtt = callPackage ../development/python-modules/amqtt { };

amulet-core = callPackage ../development/python-modules/amulet-core { };

amulet-leveldb = callPackage ../development/python-modules/amulet-leveldb { };

amulet-nbt = callPackage ../development/python-modules/amulet-nbt { };
Expand Down

0 comments on commit 5bab530

Please sign in to comment.