From 4e306af93d35f1b765df78f8c110d3b2344f54d8 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 18 May 2025 00:12:44 +0200 Subject: [PATCH 1/2] python312Packages.pythonefl: use pyproject = true, disable for python 3.13 --- .../python-modules/python-efl/default.nix | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/python-efl/default.nix b/pkgs/development/python-modules/python-efl/default.nix index 0b0eaec2d29d..ddb6cdbd05a0 100644 --- a/pkgs/development/python-modules/python-efl/default.nix +++ b/pkgs/development/python-modules/python-efl/default.nix @@ -2,11 +2,17 @@ lib, fetchurl, buildPythonPackage, + pythonAtLeast, + pkg-config, - python, - dbus-python, - packaging, + enlightenment, + + packaging, + setuptools, + + dbus-python, + directoryListingUpdater, }: @@ -15,10 +21,13 @@ buildPythonPackage rec { pname = "python-efl"; version = "1.26.1"; - format = "setuptools"; + pyproject = true; + + # As of 1.26.1, native extensions fail to build with python 3.13+ + disabled = pythonAtLeast "3.13"; src = fetchurl { - url = "http://download.enlightenment.org/rel/bindings/python/${pname}-${version}.tar.xz"; + url = "http://download.enlightenment.org/rel/bindings/python/python-efl-${version}.tar.xz"; hash = "sha256-3Ns5fhIHihnpDYDnxvPP00WIZL/o1UWLzgNott4GKNc="; }; @@ -26,23 +35,19 @@ buildPythonPackage rec { buildInputs = [ enlightenment.efl ]; - propagatedBuildInputs = [ - dbus-python + build-system = [ packaging + setuptools + ]; + + dependencies = [ + dbus-python ]; preConfigure = '' NIX_CFLAGS_COMPILE="$(pkg-config --cflags efl evas) $NIX_CFLAGS_COMPILE" ''; - preBuild = '' - ${python.pythonOnBuildForHost.interpreter} setup.py build_ext - ''; - - installPhase = '' - ${python.pythonOnBuildForHost.interpreter} setup.py install --prefix=$out --single-version-externally-managed - ''; - doCheck = false; passthru.updateScript = directoryListingUpdater { }; From 77ebb549a5401e56f3e5c8ca4fab74971dec49c6 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 18 May 2025 00:59:47 +0200 Subject: [PATCH 2/2] python312Packages.pythonefl: enable tests --- .../python-modules/python-efl/default.nix | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/python-efl/default.nix b/pkgs/development/python-modules/python-efl/default.nix index ddb6cdbd05a0..d227d8ac5f8a 100644 --- a/pkgs/development/python-modules/python-efl/default.nix +++ b/pkgs/development/python-modules/python-efl/default.nix @@ -13,6 +13,8 @@ dbus-python, + pytestCheckHook, + directoryListingUpdater, }: @@ -48,7 +50,30 @@ buildPythonPackage rec { NIX_CFLAGS_COMPILE="$(pkg-config --cflags efl evas) $NIX_CFLAGS_COMPILE" ''; - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + ]; + + preCheck = '' + # make sure we load the library from $out instead of the cwd + # because cwd doesn't contain the built extensions + rm -r efl/ + + patchShebangs tests/ecore/exe_helper.sh + + # use the new name instead of the removed alias + substituteInPlace tests/evas/test_01_rect.py \ + --replace-fail ".assert_(" ".assertTrue(" + ''; + + pytestFlagsArray = [ "tests/" ]; + + disabledTestPaths = [ + "tests/dbus/test_01_basics.py" # needs dbus daemon + "tests/ecore/test_09_file_download.py" # uses network + "tests/ecore/test_11_con.py" # uses network + "tests/elementary/test_02_image_icon.py" # RuntimeWarning: Setting standard icon failed + ]; passthru.updateScript = directoryListingUpdater { };