Merge pull request #311028 from fabaff/hjson-refactor

python312Packages.hjson: refactor
This commit is contained in:
Fabian Affolter
2024-05-12 17:44:46 +02:00
committed by GitHub
@@ -1,25 +1,34 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, python
, makeWrapper
{
lib,
buildPythonPackage,
fetchFromGitHub,
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 +38,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";
};
}