From 96a1dd0fa705294f4774b289b393de0c217a6af7 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 24 Nov 2023 03:21:54 +0100 Subject: [PATCH] python3Packages.frozendict: 2.3.8 -> 2.3.9 Determine at build time if C version or pure-python version is to be used. Diff: https://github.com/Marco-Sulla/python-frozendict/compare/refs/tags/v2.3.8...v2.3.9 Changelog: https://github.com/Marco-Sulla/python-frozendict/releases/tag/v2.3.9 --- .../python-modules/frozendict/default.nix | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/frozendict/default.nix b/pkgs/development/python-modules/frozendict/default.nix index 3ed26a476b6e..6bd1622fa44d 100644 --- a/pkgs/development/python-modules/frozendict/default.nix +++ b/pkgs/development/python-modules/frozendict/default.nix @@ -8,18 +8,30 @@ buildPythonPackage rec { pname = "frozendict"; - version = "2.3.8"; + version = "2.3.9"; format = "setuptools"; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "Marco-Sulla"; repo = "python-frozendict"; rev = "refs/tags/v${version}"; - hash = "sha256-4a0DvZOzNJqpop7wi+FagUR+8oaekz4EDNIYdUaAWC8="; + hash = "sha256-wVsTsUK6TES6YLGZGcHcGufrdVQrODyXrqczae8iTJ0="; }; + # build C version if it exists + preBuild = '' + version_str=$(python -c 'import sys; print("_".join(map(str, sys.version_info[:2])))') + if test -f src/frozendict/c_src/$version_str/frozendictobject.c; then + export CIBUILDWHEEL=1 + export FROZENDICT_PURE_PY=0 + else + export CIBUILDWHEEL=0 + export FROZENDICT_PURE_PY=1 + fi + ''; + nativeCheckInputs = [ pytestCheckHook ]; @@ -28,15 +40,6 @@ buildPythonPackage rec { "frozendict" ]; - preCheck = '' - pushd test - ''; - - disabledTests = lib.optionals (pythonAtLeast "3.11") [ - # https://github.com/Marco-Sulla/python-frozendict/issues/68 - "test_c_extension" - ]; - meta = with lib; { description = "Module for immutable dictionary"; homepage = "https://github.com/Marco-Sulla/python-frozendict";