From e5dca17201e4a329f08a0342c50c5d538c5940a5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 21 Jan 2023 13:58:08 +0100 Subject: [PATCH 1/2] python311Packages.ansiwrap: patch test --- .../python-modules/ansiwrap/default.nix | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/ansiwrap/default.nix b/pkgs/development/python-modules/ansiwrap/default.nix index 49cf4a63ba63..3dc3a8df13be 100644 --- a/pkgs/development/python-modules/ansiwrap/default.nix +++ b/pkgs/development/python-modules/ansiwrap/default.nix @@ -1,16 +1,18 @@ { lib , ansicolors , buildPythonPackage -, coverage , fetchPypi -, pytest-cov , pytestCheckHook +, pythonOlder , textwrap3 }: buildPythonPackage rec { pname = "ansiwrap"; version = "0.8.4"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; @@ -18,21 +20,31 @@ buildPythonPackage rec { sha256 = "ca0c740734cde59bf919f8ff2c386f74f9a369818cdc60efe94893d01ea8d9b7"; }; - nativeCheckInputs = [ + postPatch = '' + # https://github.com/jonathaneunice/ansiwrap/issues/18 + substituteInPlace test/test_ansiwrap.py \ + --replace "set(range(20, 120)).difference(LINE_LENGTHS)" "sorted(set(range(20, 120)).difference(LINE_LENGTHS))" \ + --replace "set(range(120, 400)).difference(LINE_LENGTHS)" "sorted(set(range(120, 400)).difference(LINE_LENGTHS))" + ''; + + checkInputs = [ ansicolors - coverage - pytest-cov pytestCheckHook ]; - propagatedBuildInputs = [ textwrap3 ]; + propagatedBuildInputs = [ + textwrap3 + ]; - pythonImportsCheck = [ "ansiwrap" ]; + pythonImportsCheck = [ + "ansiwrap" + ]; meta = with lib; { description = "Textwrap, but savvy to ANSI colors and styles"; homepage = "https://github.com/jonathaneunice/ansiwrap"; + changelog = "https://github.com/jonathaneunice/ansiwrap/blob/master/CHANGES.yml"; license = licenses.asl20; - maintainers = [ maintainers.costrouc ]; + maintainers = with maintainers; [ costrouc ]; }; } From 098cdb205648a4da56c022954a4d816b292b4643 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Jan 2023 19:20:48 +0100 Subject: [PATCH 2/2] python310Packages.vector: adjust inputs --- .../python-modules/vector/default.nix | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/vector/default.nix b/pkgs/development/python-modules/vector/default.nix index fcf4a306ca59..a1b153deefab 100644 --- a/pkgs/development/python-modules/vector/default.nix +++ b/pkgs/development/python-modules/vector/default.nix @@ -1,10 +1,16 @@ { lib +, awkward , buildPythonPackage , fetchPypi , hatch-vcs , hatchling +, numba , numpy +, notebook +, packaging +, papermill , pytestCheckHook +, pythonOlder }: buildPythonPackage rec { @@ -12,6 +18,8 @@ buildPythonPackage rec { version = "0.11.0"; format = "pyproject"; + disabled = pythonOlder "3.8"; + src = fetchPypi { inherit pname version; sha256 = "sha256-/e0wZDWIIm9vi37NEkIEitQj0p1M132AAO6id0eaA5Y="; @@ -21,17 +29,30 @@ buildPythonPackage rec { hatch-vcs hatchling ]; + propagatedBuildInputs = [ numpy + packaging ]; - nativeCheckInputs = [ pytestCheckHook ]; + checkInputs = [ + awkward + notebook + numba + papermill + pytestCheckHook + ]; - pythonImportsCheck = [ "vector" ]; + pythonImportsCheck = [ + "vector" + ]; + + __darwinAllowLocalNetworking = true; meta = with lib; { - description = "A Python 3.7+ library for 2D, 3D, and Lorentz vectors, especially arrays of vectors, to solve common physics problems in a NumPy-like way"; + description = "Library for 2D, 3D, and Lorentz vectors, especially arrays of vectors, to solve common physics problems in a NumPy-like way"; homepage = "https://github.com/scikit-hep/vector"; + changelog = "https://github.com/scikit-hep/vector/releases/tag/v${version}"; license = with licenses; [ bsd3 ]; maintainers = with maintainers; [ veprbl ]; };