From 03c9ae18e1efa84c3beb5b6246a6c8316204a795 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Tue, 9 Jul 2024 01:19:55 -0400 Subject: [PATCH 1/5] python312Packages.citeproc-py: nose -> pytest --- .../python-modules/citeproc-py/default.nix | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/citeproc-py/default.nix b/pkgs/development/python-modules/citeproc-py/default.nix index 3cdb2e6bafe23..7f03d0d7a68d6 100644 --- a/pkgs/development/python-modules/citeproc-py/default.nix +++ b/pkgs/development/python-modules/citeproc-py/default.nix @@ -2,39 +2,41 @@ lib, buildPythonPackage, fetchPypi, - nose, + pytestCheckHook, git, lxml, rnc2rng, + setuptools, }: buildPythonPackage rec { pname = "citeproc-py"; version = "0.6.0"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "d9e3a224f936fe2e5033b5d9ffdacab769cedb61d96c4e0cf2f0b488f1d24b4e"; + hash = "sha256-2eOiJPk2/i5QM7XZ/9rKt2nO22HZbE4M8vC0iPHSS04="; }; buildInputs = [ rnc2rng ]; - propagatedBuildInputs = [ lxml ]; + build-system = [ setuptools ]; + + dependencies = [ lxml ]; nativeCheckInputs = [ - nose + pytestCheckHook git ]; - checkPhase = "nosetests tests"; - doCheck = false; # seems to want a Git repository, but fetchgit with leaveDotGit also fails + # doCheck = false; # seems to want a Git repository, but fetchgit with leaveDotGit also fails pythonImportsCheck = [ "citeproc" ]; - meta = with lib; { + meta = { homepage = "https://github.com/brechtm/citeproc-py"; description = "Citation Style Language (CSL) parser for Python"; mainProgram = "csl_unsorted"; - license = licenses.bsd2; - maintainers = with maintainers; [ bcdarwin ]; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ bcdarwin ]; }; } From 68fee0ea337e70125a75d5debb30cb871521c95c Mon Sep 17 00:00:00 2001 From: Pyrox Date: Tue, 9 Jul 2024 01:20:23 -0400 Subject: [PATCH 2/5] python312Packages.chart-studio: nose -> pytest --- .../python-modules/chart-studio/default.nix | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/chart-studio/default.nix b/pkgs/development/python-modules/chart-studio/default.nix index 09ecb4f986b5f..fdc2a35323ed8 100644 --- a/pkgs/development/python-modules/chart-studio/default.nix +++ b/pkgs/development/python-modules/chart-studio/default.nix @@ -3,9 +3,8 @@ buildPythonPackage, fetchFromGitHub, mock, - nose, plotly, - pytest, + pytestCheckHook, requests, retrying, setuptools, @@ -38,18 +37,23 @@ buildPythonPackage rec { nativeCheckInputs = [ mock - nose - pytest + pytestCheckHook ]; - # most tests talk to a service - checkPhase = '' - HOME=$TMPDIR pytest chart_studio/tests/test_core chart_studio/tests/test_plot_ly/test_api + + preCheck = '' + export HOME=$TMPDIR ''; - meta = with lib; { + # most tests talk to a service + pytestFlagsArray = [ + "chart_studio/tests/test_core" + "chart_studio/tests/test_plot_ly/test_api" + ]; + + meta = { description = "Utilities for interfacing with Plotly's Chart Studio service"; homepage = "https://github.com/plotly/plotly.py/tree/master/packages/python/chart-studio"; - license = with licenses; [ mit ]; - maintainers = with maintainers; [ ]; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ ]; }; } From 0e17d680717485e666d2697565a2296c8a24f6bf Mon Sep 17 00:00:00 2001 From: Pyrox Date: Tue, 9 Jul 2024 01:21:03 -0400 Subject: [PATCH 3/5] python312Packages.cgroup-utils: nose -> tests disabled They require privilaged filesystem access(/proc), so they do not run in Nix's sandbox. --- .../python-modules/cgroup-utils/default.nix | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/cgroup-utils/default.nix b/pkgs/development/python-modules/cgroup-utils/default.nix index 89b05b5f34080..46958d7f9bbc5 100644 --- a/pkgs/development/python-modules/cgroup-utils/default.nix +++ b/pkgs/development/python-modules/cgroup-utils/default.nix @@ -2,38 +2,41 @@ lib, buildPythonPackage, fetchFromGitHub, - pep8, - nose, + setuptools, }: buildPythonPackage rec { version = "0.8"; - format = "setuptools"; pname = "cgroup-utils"; - - buildInputs = [ - pep8 - nose - ]; - # Pep8 tests fail... - doCheck = false; - - postPatch = '' - sed -i -e "/argparse/d" setup.py - ''; + pyproject = true; src = fetchFromGitHub { owner = "peo3"; repo = "cgroup-utils"; rev = "v${version}"; - sha256 = "0qnbn8cnq8m14s8s1hcv25xjd55dyb6yy54l5vc7sby5xzzp11fq"; + hash = "sha256-2IVw/+/FL33YLpQU783yrZQmexGbwaCRJqEibBmyy2I="; }; - meta = with lib; { + postPatch = '' + sed -i -e "/argparse/d" setup.py + substituteInPlace test_pep8.py --replace-fail \ + 'print message' 'print(message)' + rm test_pep8.py + ''; + + build-system = [ setuptools ]; + + # Importing causes it to check the /sys directory, which isn't allowed, and so + # tests fail. Therefore, tests can't be run. + doCheck = false; + + pythonImportsCheck = [ "cgutils" ]; + + meta = { description = "Utility tools for control groups of Linux"; mainProgram = "cgutil"; - maintainers = with maintainers; [ layus ]; - platforms = platforms.linux; - license = licenses.gpl2; + maintainers = with lib.maintainers; [ layus ]; + platforms = lib.platforms.linux; + license = lib.licenses.gpl2Plus; }; } From 2275343ee11f7b6f94ab41712e0c635896556545 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Tue, 9 Jul 2024 01:21:27 -0400 Subject: [PATCH 4/5] python312Packages.blessings: nose -> disabled tests See upstream PR #165 for details --- .../python-modules/blessings/default.nix | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/blessings/default.nix b/pkgs/development/python-modules/blessings/default.nix index d4d4e887ce113..0a4aaeb80335e 100644 --- a/pkgs/development/python-modules/blessings/default.nix +++ b/pkgs/development/python-modules/blessings/default.nix @@ -3,33 +3,33 @@ buildPythonPackage, fetchPypi, six, - nose, + setuptools, }: buildPythonPackage rec { pname = "blessings"; version = "1.7"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "98e5854d805f50a5b58ac2333411b0482516a8210f23f43308baeb58d77c157d"; + hash = "sha256-mOWFTYBfUKW1isIzNBGwSCUWqCEPI/QzCLrrWNd8FX0="; }; - # 4 failing tests, 2to3 - doCheck = false; + build-system = [ setuptools ]; + + dependencies = [ six ]; - propagatedBuildInputs = [ six ]; - nativeCheckInputs = [ nose ]; + # Running tests produces a failure that's not able to be patched easily. + # See PR #165 in the repo for the package for more information. + doCheck = false; - checkPhase = '' - nosetests - ''; + pythonImportsCheck = [ "blessings" ]; - meta = with lib; { + meta = { homepage = "https://github.com/erikrose/blessings"; description = "Thin, practical wrapper around terminal coloring, styling, and positioning"; - license = licenses.mit; - maintainers = with maintainers; [ domenkozar ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ domenkozar ]; }; } From 7a4e6733ac27ca47dc23db326b97634fd985d422 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Tue, 9 Jul 2024 01:23:22 -0400 Subject: [PATCH 5/5] python312Packages.binwalk: 2.3.4 -> 2.4.1 Updates to the community supported fork of binwalk, and modernizes the code to modern Nix Python packaging standards. --- pkgs/development/python-modules/binwalk/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/binwalk/default.nix b/pkgs/development/python-modules/binwalk/default.nix index 844765011ca64..9dd70114ed9bc 100644 --- a/pkgs/development/python-modules/binwalk/default.nix +++ b/pkgs/development/python-modules/binwalk/default.nix @@ -37,7 +37,7 @@ buildPythonPackage rec { build-system = [ setuptools ]; - propagatedBuildInputs = + dependencies = [ zlib xz @@ -75,11 +75,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "binwalk" ]; - meta = with lib; { + meta = { homepage = "https://github.com/OSPG/binwalk"; description = "Tool for searching a given binary image for embedded files"; mainProgram = "binwalk"; - maintainers = [ maintainers.koral ]; - license = licenses.mit; + maintainers = with lib.maintainers; [ koral ]; + license = lib.licenses.mit; }; }