From 923d79c8e239033b6cd78a344e46e577e2cb00bf Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 26 Mar 2024 20:48:16 -0400 Subject: [PATCH 1/2] python3Packages.dbf: Fix not running hooks in checkPhase --- pkgs/development/python-modules/dbf/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/dbf/default.nix b/pkgs/development/python-modules/dbf/default.nix index ebe64fa28a50..10c448335b8f 100644 --- a/pkgs/development/python-modules/dbf/default.nix +++ b/pkgs/development/python-modules/dbf/default.nix @@ -22,7 +22,9 @@ buildPythonPackage rec { propagatedBuildInputs = [ aenum ]; checkPhase = '' + runHook preCheck ${python.interpreter} -m dbf.test + runHook postCheck ''; pythonImportsCheck = [ "dbf" ]; From 4fdfab04387758a0e91e54073c5f5536883045ca Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Fri, 22 Mar 2024 10:44:26 -0400 Subject: [PATCH 2/2] python3Packages.dbf: Workaround broken build on Darwin Skip test that fails on case-insensitive filesystems pending an upstream fix (see issue linked in code). --- pkgs/development/python-modules/dbf/darwin.patch | 12 ++++++++++++ pkgs/development/python-modules/dbf/default.nix | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/development/python-modules/dbf/darwin.patch diff --git a/pkgs/development/python-modules/dbf/darwin.patch b/pkgs/development/python-modules/dbf/darwin.patch new file mode 100644 index 000000000000..92c96c7f1c98 --- /dev/null +++ b/pkgs/development/python-modules/dbf/darwin.patch @@ -0,0 +1,12 @@ +diff --git a/dbf/test.py b/dbf/test.py +index 117f611..34a9507 100755 +--- a/dbf/test.py ++++ b/dbf/test.py +@@ -4814,6 +4814,7 @@ def test_index_search(self): + self.assertEqual(sorted.index_search('jul', partial=True), 9) + self.assertTrue(sorted.index_search('jul', partial=True)) + ++ @unittest.skipIf(sys.platform == 'darwin', 'fails on case-insensitive filesystems') + def test_mismatched_extensions(self): + old_memo_name = self.dbf_table._meta.memoname + new_memo_name = old_memo_name[:-3] + 'Dbt' diff --git a/pkgs/development/python-modules/dbf/default.nix b/pkgs/development/python-modules/dbf/default.nix index 10c448335b8f..f6bb0282e8c8 100644 --- a/pkgs/development/python-modules/dbf/default.nix +++ b/pkgs/development/python-modules/dbf/default.nix @@ -19,6 +19,9 @@ buildPythonPackage rec { hash = "sha256-MFEi1U0RNvrfDtV4HpvPgKTCibAh76z7Gnmj32IubYw="; }; + # Workaround for https://github.com/ethanfurman/dbf/issues/48 + patches = lib.optional python.stdenv.isDarwin ./darwin.patch; + propagatedBuildInputs = [ aenum ]; checkPhase = ''