diff --git a/pkgs/development/python-modules/pytorch-tabnet/default.nix b/pkgs/development/python-modules/pytorch-tabnet/default.nix new file mode 100644 index 000000000000..90b61e4aa897 --- /dev/null +++ b/pkgs/development/python-modules/pytorch-tabnet/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + fsspec, + numpy, + poetry-core, + pytestCheckHook, + scikit-learn, + scipy, + torch, + tqdm, + typing-extensions, +}: + +buildPythonPackage rec { + pname = "pytorch-tabnet"; + version = "4.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "dreamquark-ai"; + repo = "tabnet"; + tag = "v${version}"; + hash = "sha256-WyNGgAkNn5CaEuHWQ6Fjnvnrp+KONnxUQudd5ckvcsM="; + }; + + # Modernize poetry build setup + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'requires = ["poetry>=0.12"]' 'requires = ["poetry-core"]' \ + --replace-fail 'build-backend = "poetry.masonry.api"' 'build-backend = "poetry.core.masonry.api"' + ''; + + build-system = [ poetry-core ]; + + dependencies = [ + numpy + scikit-learn + scipy + torch + tqdm + typing-extensions + ]; + + nativeCheckInputs = [ + pytestCheckHook + fsspec + ]; + + pythonImportsCheck = [ "pytorch_tabnet" ]; + + meta = { + description = "PyTorch implementation of TabNet"; + homepage = "https://github.com/dreamquark-ai/tabnet"; + changelog = "https://github.com/dreamquark-ai/tabnet/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ jherland ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0ce2835bc24b..e2cfdeff77bf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15245,6 +15245,8 @@ self: super: with self; { pytorch-pfn-extras = callPackage ../development/python-modules/pytorch-pfn-extras { }; + pytorch-tabnet = callPackage ../development/python-modules/pytorch-tabnet { }; + pytorch3d = callPackage ../development/python-modules/pytorch3d { }; pytorchviz = callPackage ../development/python-modules/pytorchviz { };