Files
2026-06-03 07:36:22 +00:00

71 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
hatch-vcs,
hatchling,
interface-meta,
narwhals,
numpy,
pandas,
scipy,
typing-extensions,
wrapt,
pyarrow,
polars,
sympy,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "formulaic";
version = "1.2.2";
pyproject = true;
src = fetchFromGitHub {
owner = "matthewwardrop";
repo = "formulaic";
tag = "v${version}";
hash = "sha256-C4IUuyxBbW2DUxF4at8/736ZMmVZrFRRp+RxrJfmLkY=";
};
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
build-system = [
hatchling
hatch-vcs
];
dependencies = [
narwhals
numpy
pandas
scipy
wrapt
typing-extensions
interface-meta
];
optional-dependencies = {
arrow = [ pyarrow ];
polars = [ polars ];
calculus = [ sympy ];
};
nativeCheckInputs = [
pytestCheckHook
]
++ optional-dependencies.arrow
++ optional-dependencies.calculus;
pythonImportsCheck = [ "formulaic" ];
meta = {
description = "High-performance implementation of Wilkinson formulas";
homepage = "https://matthewwardrop.github.io/formulaic/";
changelog = "https://github.com/matthewwardrop/formulaic/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ swflint ];
};
}