From 20589a7b9935567a4341c620a26fcd41e9f2e50d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 12 May 2024 12:37:41 +0200 Subject: [PATCH 1/2] python312Packages.hjson: refactor --- .../python-modules/hjson/default.nix | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/hjson/default.nix b/pkgs/development/python-modules/hjson/default.nix index 44aa789f0d04..dc5fbbeddd58 100644 --- a/pkgs/development/python-modules/hjson/default.nix +++ b/pkgs/development/python-modules/hjson/default.nix @@ -1,25 +1,33 @@ { lib , buildPythonPackage , fetchFromGitHub -, python , makeWrapper +, pytestCheckHook +, python +, pythonOlder +, setuptools }: buildPythonPackage rec { pname = "hjson"; version = "3.0.2"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.5"; - # N.B. pypi src tarball does not have tests src = fetchFromGitHub { owner = "hjson"; repo = "hjson-py"; - rev = "v${version}"; - sha256 = "1jc7j790rcqnhbrfj4lhnz3f6768dc55aij840wmx16jylfqpc2n"; + rev = "refs/tags/v${version}"; + hash = "sha256-VrCLHfXShF45IEhGVQpryBzjxreQEunyghazDNKRh8k="; }; + build-system = [ setuptools ]; + nativeBuildInputs = [ makeWrapper ]; + nativeCheckInputs = [ pytestCheckHook ]; + pythonImportsCheck = [ "hjson" ]; postInstall = '' @@ -29,11 +37,17 @@ buildPythonPackage rec { --prefix PATH : ${lib.makeBinPath [ python ]} ''; + disabledTestPaths = [ + # AttributeError: b'/build/source/hjson/tool.py:14: Deprecati[151 chars]ools' != b'' + "hjson/tests/test_tool.py" + ]; + meta = with lib; { description = "A user interface for JSON"; - mainProgram = "hjson"; homepage = "https://github.com/hjson/hjson-py"; + changelog = "https://github.com/hjson/hjson-py/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ bhipple ]; + mainProgram = "hjson"; }; } From d9a809c202be790b69d42c144910db7796b3a501 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 12 May 2024 12:38:12 +0200 Subject: [PATCH 2/2] python312Packages.hjson: format with nixfmt --- .../python-modules/hjson/default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/hjson/default.nix b/pkgs/development/python-modules/hjson/default.nix index dc5fbbeddd58..46ae9f518a34 100644 --- a/pkgs/development/python-modules/hjson/default.nix +++ b/pkgs/development/python-modules/hjson/default.nix @@ -1,11 +1,12 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, makeWrapper -, pytestCheckHook -, python -, pythonOlder -, setuptools +{ + lib, + buildPythonPackage, + fetchFromGitHub, + makeWrapper, + pytestCheckHook, + python, + pythonOlder, + setuptools, }: buildPythonPackage rec {