From dae81036fea005e5c170463853c3152156fe42d9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 14 Feb 2024 11:07:05 +0100 Subject: [PATCH 1/3] python311Packages.uqbar: refactor --- .../python-modules/uqbar/default.nix | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/pkgs/development/python-modules/uqbar/default.nix b/pkgs/development/python-modules/uqbar/default.nix index 3af7ba636e9e..da5231c07de7 100644 --- a/pkgs/development/python-modules/uqbar/default.nix +++ b/pkgs/development/python-modules/uqbar/default.nix @@ -1,18 +1,18 @@ { lib , buildPythonPackage , fetchPypi -, unidecode -, sphinx +, pytestCheckHook , pythonAtLeast , pythonOlder -, pytestCheckHook -, pytest-cov +, setuptools +, sphinx +, unidecode }: buildPythonPackage rec { pname = "uqbar"; version = "0.7.0"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -22,9 +22,15 @@ buildPythonPackage rec { }; postPatch = '' - sed -i '/"black"/d' pyproject.toml + sed -i pyproject.toml \ + -e '/"black"/d' \ + -e "/--cov/d" ''; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ unidecode sphinx @@ -32,22 +38,10 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - pytest-cov - ]; - - pytestFlagsArray = [ - "tests/" - "-vv" - "-rf" - "--cov-branch" - "--cov-report=html" - "--cov-report=term" - "--doctest-modules" ]; disabledTests = [ - # UnboundLocalError: local variable 'output_path' referenced before - # assignment + # UnboundLocalError: local variable 'output_path' referenced before assignment "test_01" # AssertionError: assert False "test_sphinx_book_html_cached" @@ -58,16 +52,19 @@ buildPythonPackage rec { "test_sphinx_style_latex" ] # assert not '\x1b[91m/build/uqbar-0.7.0/tests/fake_package/enums.py:docstring - ++ lib.optional (pythonAtLeast "3.11") "test_sphinx_style"; + ++ lib.optional (pythonAtLeast "3.11") [ + "test_sphinx_style" + ]; - pythonImportsCheck = [ "uqbar" ]; + pythonImportsCheck = [ + "uqbar" + ]; - meta = { + meta = with lib; { description = "Tools for creating Sphinx and Graphviz documentation"; - license = lib.licenses.mit; homepage = "https://github.com/josiah-wolf-oberholtzer/uqbar"; - changelog = - "https://github.com/josiah-wolf-oberholtzer/uqbar/releases/tag/v${version}"; - maintainers = [ lib.maintainers.davisrichard437 ]; + changelog = "https://github.com/josiah-wolf-oberholtzer/uqbar/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ davisrichard437 ]; }; } From 3d8c54ee89cbbe4fa7034f01eeb50b5dda850470 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 14 Feb 2024 11:07:26 +0100 Subject: [PATCH 2/3] python311Packages.uqbar: 0.7.0 -> 0.7.1 Changelog: https://github.com/josiah-wolf-oberholtzer/uqbar/releases/tag/v0.7.1 --- pkgs/development/python-modules/uqbar/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/uqbar/default.nix b/pkgs/development/python-modules/uqbar/default.nix index da5231c07de7..111bf723b032 100644 --- a/pkgs/development/python-modules/uqbar/default.nix +++ b/pkgs/development/python-modules/uqbar/default.nix @@ -11,14 +11,14 @@ buildPythonPackage rec { pname = "uqbar"; - version = "0.7.0"; + version = "0.7.1"; pyproject = true; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-cEhWXGtMSXVjT5QigDedjT/lwYQnVqPCE5vbctXWznk="; + hash = "sha256-pZ2sNs9uK49PK8qxRRqpGMEI1Xr6Fn+fxptlEVv3GSk="; }; postPatch = '' From 88375096b0e1b8de6a1ff25c0556690ca2f2185f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 14 Feb 2024 11:26:25 +0100 Subject: [PATCH 3/3] python312Packages.uqbar: disable failing test on Python 3.12 --- pkgs/development/python-modules/uqbar/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/uqbar/default.nix b/pkgs/development/python-modules/uqbar/default.nix index 111bf723b032..36fe7e0eb1f8 100644 --- a/pkgs/development/python-modules/uqbar/default.nix +++ b/pkgs/development/python-modules/uqbar/default.nix @@ -50,10 +50,12 @@ buildPythonPackage rec { # assert not ["\x1b[91mWARNING: dot command 'dot' cannot be run (needed for # graphviz output), check the graphviz_dot setting\x1b[39;49;00m"] "test_sphinx_style_latex" - ] - # assert not '\x1b[91m/build/uqbar-0.7.0/tests/fake_package/enums.py:docstring - ++ lib.optional (pythonAtLeast "3.11") [ + ] ++ lib.optional (pythonAtLeast "3.11") [ + # assert not '\x1b[91m/build/uqbar-0.7.0/tests/fake_package/enums.py:docstring "test_sphinx_style" + ] ++ lib.optional (pythonAtLeast "3.12") [ + # https://github.com/josiah-wolf-oberholtzer/uqbar/issues/93 + "objects.get_vars" ]; pythonImportsCheck = [