From 1eca6fb65ed0431e3706ebac231361cb24d47888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 11 Dec 2024 16:02:23 -0800 Subject: [PATCH 1/2] python312Packages.type-infer: unpin py3langid --- .../development/python-modules/type-infer/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/type-infer/default.nix b/pkgs/development/python-modules/type-infer/default.nix index 2d9022520150..294769e7c3fb 100644 --- a/pkgs/development/python-modules/type-infer/default.nix +++ b/pkgs/development/python-modules/type-infer/default.nix @@ -30,7 +30,7 @@ in buildPythonPackage rec { pname = "type-infer"; version = "0.0.20"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -41,11 +41,14 @@ buildPythonPackage rec { hash = "sha256-F+gfA7ofrbMEE5SrVt9H3s2mZKQLyr6roNUmL4EMJbI="; }; - pythonRelaxDeps = [ "psutil" ]; + pythonRelaxDeps = [ + "psutil" + "py3langid" + ]; - nativeBuildInputs = [ poetry-core ]; + build-system = [ poetry-core ]; - propagatedBuildInputs = [ + dependencies = [ colorlog dataclasses-json langid From b5abcd6832a951da51e6f8417687fa51072a27e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 11 Dec 2024 16:26:35 -0800 Subject: [PATCH 2/2] python312Packages.type-infer: run tests --- .../python-modules/type-infer/default.nix | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/type-infer/default.nix b/pkgs/development/python-modules/type-infer/default.nix index 294769e7c3fb..b4e544a607ae 100644 --- a/pkgs/development/python-modules/type-infer/default.nix +++ b/pkgs/development/python-modules/type-infer/default.nix @@ -2,16 +2,16 @@ lib, buildPythonPackage, pythonOlder, - fetchPypi, + fetchFromGitHub, poetry-core, colorlog, dataclasses-json, - langid, nltk, numpy, pandas, psutil, py3langid, + pytestCheckHook, python-dateutil, scipy, toml, @@ -23,22 +23,26 @@ let name = "nltk-test-data"; paths = [ nltk-data.punkt + nltk-data.punkt_tab nltk-data.stopwords ]; }; + + version = "0.0.20"; + tag = "v${version}"; in buildPythonPackage rec { pname = "type-infer"; - version = "0.0.20"; + inherit version; pyproject = true; disabled = pythonOlder "3.8"; - # using PyPI because the repo does not have tags or release branches - src = fetchPypi { - pname = "type_infer"; - inherit version; - hash = "sha256-F+gfA7ofrbMEE5SrVt9H3s2mZKQLyr6roNUmL4EMJbI="; + src = fetchFromGitHub { + owner = "mindsdb"; + repo = "type_infer"; + inherit tag; + hash = "sha256-2Y+NPwUnQMj0oXoCMfUOG40lqduy9GTcqxfyuFDOkHc="; }; pythonRelaxDeps = [ @@ -51,7 +55,6 @@ buildPythonPackage rec { dependencies = [ colorlog dataclasses-json - langid nltk numpy pandas @@ -62,8 +65,14 @@ buildPythonPackage rec { toml ]; - # PyPI package does not include tests - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # test hangs + "test_1_stack_overflow_survey" + ]; # Package import requires NLTK data to be downloaded # It is the only way to set NLTK_DATA environment variable, @@ -72,8 +81,9 @@ buildPythonPackage rec { pythonImportsCheck = [ "type_infer" ]; meta = with lib; { + changelog = "https://github.com/mindsdb/type_infer/releases/tag/${tag}"; description = "Automated type inference for Machine Learning pipelines"; - homepage = "https://pypi.org/project/type-infer/"; + homepage = "https://github.com/mindsdb/type_infer"; license = licenses.gpl3Only; maintainers = with maintainers; [ mbalatsko ]; };