diff --git a/pkgs/development/python-modules/constantdict/default.nix b/pkgs/development/python-modules/constantdict/default.nix new file mode 100644 index 000000000000..a0c00d6a8fe7 --- /dev/null +++ b/pkgs/development/python-modules/constantdict/default.nix @@ -0,0 +1,45 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "constantdict"; + version = "2025.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "matthiasdiener"; + repo = "constantdict"; + tag = "v${version}"; + hash = "sha256-M3duCafyJk/W3KIqP43ErXr/EfCj6/Sin6eCaaxyI5g="; + }; + + build-system = [ + hatchling + ]; + + pythonImportsCheck = [ + "constantdict" + ]; + + # Assumes that unpickling a pickled dict in a different Python process will result in a different hash. + # This doesn't seem to work in the Nix sandbox but works fine in a normal environment. + disabledTests = [ + "test_pickle_hash" + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + meta = { + homepage = "https://matthiasdiener.github.io/constantdict"; + downloadPage = "https://github.com/matthiasdiener/constantdict"; + description = "Immutable dictionary class for Python, implemented as a thin layer around Python's builtin dict class"; + changelog = "https://github.com/matthiasdiener/constantdict/releases/tag/${src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ qbisi ]; + }; +} diff --git a/pkgs/development/python-modules/loopy/default.nix b/pkgs/development/python-modules/loopy/default.nix index f8833a60ddfb..0be0d9802eb9 100644 --- a/pkgs/development/python-modules/loopy/default.nix +++ b/pkgs/development/python-modules/loopy/default.nix @@ -1,60 +1,75 @@ { lib, + stdenv, buildPythonPackage, - codepy, - cgen, - colorama, - fetchFromGitHub, - genpy, - immutables, - islpy, - mako, - numpy, - pymbolic, - pyopencl, - pyrsistent, pythonOlder, + fetchFromGitHub, + writableTmpDirAsHomeHook, + + # build-system + hatchling, + + # dependencies pytools, - setuptools, + pymbolic, + genpy, + numpy, + cgen, + islpy, + codepy, + colorama, + mako, + constantdict, typing-extensions, + + # optional-dependencies + pyopencl, + fparser, + ply, }: buildPythonPackage rec { pname = "loopy"; - version = "2024.1"; + version = "2025.1"; pyproject = true; - disabled = pythonOlder "3.8"; + disabled = pythonOlder "3.10"; src = fetchFromGitHub { owner = "inducer"; repo = "loopy"; tag = "v${version}"; - hash = "sha256-mU8vXEPR88QpJpzXZlZdDhMtlwIx5YpeYhXU8Vw2T9g="; + hash = "sha256-3Ebnje+EBw2Jdp2xLqffWx592OoUrSdRDXQkw6FpEzc="; fetchSubmodules = true; # submodule at `loopy/target/c/compyte` }; - build-system = [ setuptools ]; + build-system = [ hatchling ]; + + nativeBuildInputs = [ writableTmpDirAsHomeHook ]; dependencies = [ - codepy - cgen - colorama - genpy - immutables - islpy - mako - numpy - pymbolic - pyopencl - pyrsistent pytools + pymbolic + genpy + numpy + cgen + islpy + codepy + colorama + mako + constantdict typing-extensions ]; - postConfigure = '' - export HOME=$(mktemp -d) - ''; + optional-dependencies = { + pyopencl = [ + pyopencl + ]; + fortran = [ + fparser + ply + ]; + }; pythonImportsCheck = [ "loopy" ]; @@ -64,6 +79,7 @@ buildPythonPackage rec { meta = { description = "Code generator for array-based code on CPUs and GPUs"; homepage = "https://github.com/inducer/loopy"; + changelog = "https://github.com/inducer/loopy/releases/tag/${src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ tomasajt ]; }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7119f764d77a..218b2096c0aa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2803,6 +2803,8 @@ self: super: with self; { consonance = callPackage ../development/python-modules/consonance { }; + constantdict = callPackage ../development/python-modules/constantdict { }; + constantly = callPackage ../development/python-modules/constantly { }; construct = callPackage ../development/python-modules/construct { };