diff --git a/pkgs/development/python-modules/py-deprecate/default.nix b/pkgs/development/python-modules/py-deprecate/default.nix index ada770119d57..93111eec9b62 100644 --- a/pkgs/development/python-modules/py-deprecate/default.nix +++ b/pkgs/development/python-modules/py-deprecate/default.nix @@ -2,36 +2,74 @@ lib, buildPythonPackage, fetchFromGitHub, + pythonOlder, + + # build-system + setuptools, + + # dependencies + typing-extensions, + + # optional-dependencies + # audit + packaging, + # cli + fire, + rich, + + # tests + pytest-asyncio, pytestCheckHook, scikit-learn, }: -let +buildPythonPackage (finalAttrs: { pname = "py-deprecate"; - version = "0.7.0"; -in -buildPythonPackage { - inherit pname version; - format = "setuptools"; + version = "0.9.0"; + pyproject = true; + __structuredAttrs = true; src = fetchFromGitHub { owner = "Borda"; repo = "pyDeprecate"; - tag = "v${version}"; - hash = "sha256-agJTANU3WhmAxj8EjeewHtvPxF9Fr0cRHNTMZBtDFQA="; + tag = "v${finalAttrs.version}"; + hash = "sha256-M3h5m+MqUYl8902YUqKqPfLpZXF3yQjlXP8f0ehnHds="; }; - nativeCheckInputs = [ - pytestCheckHook - scikit-learn + build-system = [ + setuptools ]; + dependencies = lib.optionals (pythonOlder "3.13") [ + typing-extensions + ]; + + optional-dependencies = { + audit = [ + packaging + ]; + cli = [ + fire + rich + ]; + }; + pythonImportsCheck = [ "deprecate" ]; + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + scikit-learn + typing-extensions + ] + ++ finalAttrs.passthru.optional-dependencies.cli; + meta = { - description = "Module for marking deprecated functions or classes and re-routing to the new successors' instance. Used by torchmetrics"; + description = "Module for marking deprecated functions or classes and re-routing to the new successors' instance"; homepage = "https://borda.github.io/pyDeprecate/"; + downloadPage = "https://github.com/Borda/pyDeprecate"; + changelog = "https://github.com/Borda/pyDeprecate/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ SomeoneSerge ]; }; -} +})