From a2481ccf178c2f6d8f9ff7cadda81e29b37bed8c Mon Sep 17 00:00:00 2001 From: kilyanni Date: Mon, 4 May 2026 00:47:31 +0200 Subject: [PATCH] python3Packages.python-statemachine: init at 3.0.0 --- .../python-statemachine/default.nix | 79 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 81 insertions(+) create mode 100644 pkgs/development/python-modules/python-statemachine/default.nix diff --git a/pkgs/development/python-modules/python-statemachine/default.nix b/pkgs/development/python-modules/python-statemachine/default.nix new file mode 100644 index 000000000000..83e62d0be083 --- /dev/null +++ b/pkgs/development/python-modules/python-statemachine/default.nix @@ -0,0 +1,79 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchPypi, + hatchling, + pytestCheckHook, + pytest-asyncio, + pytest-benchmark, + pytest-mock, + pytest-timeout, + pytest-django, + pydot, +}: + +buildPythonPackage (finalAttrs: { + pname = "python-statemachine"; + version = "3.0.0"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchPypi { + pname = "python_statemachine"; + inherit (finalAttrs) version; + hash = "sha256-kVI/nq1zwdb+zJddXG4L/jY/v1N8XwvzCbzQ+U+UQbI="; + }; + + build-system = [ hatchling ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + pytest-benchmark + pytest-mock + pytest-timeout + pytest-django + pydot + ]; + + pytestFlags = [ "--benchmark-disable" ]; + + disabledTestPaths = [ + # quite slow + "tests/test_weighted_transitions.py" + "tests/scxml/" + ]; + + disabledTests = [ + # broken upstream + "statemachine.contrib.diagram.quickchart_write_svg" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # async state transitions appear broken on darwin + # TODO: investigate on an actual macOS machine + "test_timeout_fires_done_invoke" + "test_timeout_fires_before_slow_invoke" + "test_custom_event_fires" + + # flaky + "test_group_returns_ordered_results" + "test_group_error_cancels_remaining" + "test_group_with_file_io" + "test_group_cancel_on_exit" + "test_group_single_callable" + "test_each_sm_instance_gets_own_group" + ]; + + pythonImportsCheck = [ "statemachine" ]; + + meta = { + description = "Expressive statecharts and FSMs for modern Python"; + + homepage = "https://github.com/fgmacedo/python-statemachine"; + changelog = "https://github.com/fgmacedo/python-statemachine/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ kilyanni ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8198b154810f..ac1a98d05c03 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16005,6 +16005,8 @@ self: super: with self; { python-sql = callPackage ../development/python-modules/python-sql { }; + python-statemachine = callPackage ../development/python-modules/python-statemachine { }; + python-status = callPackage ../development/python-modules/python-status { }; python-stdnum = callPackage ../development/python-modules/python-stdnum { };