From 5bab5303f30dff6e83a4bab14cc40706629ea25f Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Fri, 15 Nov 2024 00:07:34 +0100 Subject: [PATCH] python312Packages.amulet-core: init at 1.9.27 --- .../python-modules/amulet-core/default.nix | 105 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 107 insertions(+) create mode 100644 pkgs/development/python-modules/amulet-core/default.nix diff --git a/pkgs/development/python-modules/amulet-core/default.nix b/pkgs/development/python-modules/amulet-core/default.nix new file mode 100644 index 0000000000000..7495d70f172e0 --- /dev/null +++ b/pkgs/development/python-modules/amulet-core/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fa6d475d64e24..ed88564435c5d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { };