From 4da503af1a403d38592ddb838ca2fc78cdad0ce5 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 1 Apr 2025 18:08:37 +0200 Subject: [PATCH] python312Packages.simpy: modernise, unbreak with Python >= 3.13 --- .../python-modules/simpy/default.nix | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/simpy/default.nix b/pkgs/development/python-modules/simpy/default.nix index 7672536d5432..90bcd244265c 100644 --- a/pkgs/development/python-modules/simpy/default.nix +++ b/pkgs/development/python-modules/simpy/default.nix @@ -1,12 +1,14 @@ { - buildPythonPackage, - fetchPypi, - isPy27, lib, + stdenv, + buildPythonPackage, + isPy27, + fetchPypi, setuptools, setuptools-scm, py, pytestCheckHook, + pythonAtLeast, }: buildPythonPackage rec { @@ -21,22 +23,40 @@ buildPythonPackage rec { hash = "sha256-BtB1CniEsR4OjiDOC8fG1O1fF0PUVmlTQNE/3/lQAaY="; }; - nativeBuildInputs = [ + build-system = [ setuptools setuptools-scm ]; + pythonImportsCheck = [ "simpy" ]; + nativeCheckInputs = [ py pytestCheckHook ]; - meta = with lib; { + pytestFlags = [ + "tests" + ]; + + disabledTests = + lib.optionals (pythonAtLeast "3.13") [ + # Failing on python >= 3.13 + # FAILED tests/test_exceptions.py::test_exception_chaining - AssertionError: Traceback mismatch + "test_exception_chaining" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_rt" + "test_rt_multiple_call" + "test_rt_slow_sim_no_error" + ]; + + meta = { downloadPage = "https://github.com/simpx/simpy"; homepage = "https://simpy.readthedocs.io/en/${version}/"; description = "Process-based discrete-event simulation framework based on standard Python"; - license = [ licenses.mit ]; - maintainers = with maintainers; [ + license = [ lib.licenses.mit ]; + maintainers = with lib.maintainers; [ dmrauh shlevy ];