diff --git a/pkgs/development/python-modules/kotsu/default.nix b/pkgs/development/python-modules/kotsu/default.nix new file mode 100644 index 000000000000..47d78c8b916f --- /dev/null +++ b/pkgs/development/python-modules/kotsu/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pandas +, typing-extensions +, pytestCheckHook +, pytest-mock +, scikit-learn +}: + +buildPythonPackage rec { + pname = "kotsu"; + version = "0.3.3"; + format = "setuptools"; + + disable = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "datavaluepeople"; + repo = "kotsu"; + rev = "v${version}"; + hash = "sha256-V5OkgiLUTRNbNt6m94+aYUZd9Nw+/60LfhrqqdFhiUw="; + }; + + patches = [ + ./disable-pytest-coverage-flags.patch + ]; + + propagatedBuildInputs = [ pandas typing-extensions ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-mock + scikit-learn + ]; + pythonImportsCheck = [ "kotsu" ]; + + meta = with lib; { + description = "Lightweight framework for structured and repeatable model validation"; + homepage = "https://github.com/datavaluepeople/kotsu"; + changelog = "https://github.com/datavaluepeople/kotsu/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ mbalatsko ]; + }; +} diff --git a/pkgs/development/python-modules/kotsu/disable-pytest-coverage-flags.patch b/pkgs/development/python-modules/kotsu/disable-pytest-coverage-flags.patch new file mode 100644 index 000000000000..f035ab0e6553 --- /dev/null +++ b/pkgs/development/python-modules/kotsu/disable-pytest-coverage-flags.patch @@ -0,0 +1,18 @@ +diff --git a/setup.cfg b/setup.cfg +index 3ab277a..b253e18 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -50,13 +50,6 @@ convention = google + add_ignore = D105, D107 + #add_ignore = D100,D101,D102,D103,D104,D200 - start with no ignored errors and add as required + +-[tool:pytest] +-addopts = --cov=./kotsu --cov-report xml --cov-report term +- +-[coverage:run] +-# Omit auto-generated versioneer file from test coverage +-omit = kotsu/_version.py +- + [versioneer] + VCS = git + style = pep440 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5e16bf9d3b54..c062db7259cf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5858,6 +5858,8 @@ self: super: with self; { konnected = callPackage ../development/python-modules/konnected { }; + kotsu = callPackage ../development/python-modules/kotsu { }; + korean-lunar-calendar = callPackage ../development/python-modules/korean-lunar-calendar { }; kornia = callPackage ../development/python-modules/kornia { };