Unverified Commit 3a84013a authored by Nick Cao's avatar Nick Cao
Browse files

python312Packages.oelint-parser: modernize, use fetchFromGitHub, enable tests

parent 23d6d12b
Loading
Loading
Loading
Loading
+29 −16
Original line number Diff line number Diff line
{
  lib,
  nix-update-script,
  fetchPypi,
  fetchFromGitHub,
  buildPythonPackage,
  setuptools,
  deprecated,
  regex,
  pip,
  pytest-cov-stub,
  pytest-forked,
  pytest-random-order,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "oelint-parser";
  version = "5.0.0";
  format = "setuptools";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "oelint_parser";
    hash = "sha256-TrH3aqG1jZGK5oBlLnIZDu7B8KYZIkt68FXVAQPUEck=";
  src = fetchFromGitHub {
    owner = "priv-kweihmann";
    repo = "oelint-parser";
    rev = "refs/tags/${version}";
    hash = "sha256-7LEjo/Z9mk2gx2vzDKz5cFR5bDTDgjIVVOquj0o/+0I=";
  };

  buildInputs = [ pip ];
  propagatedBuildInputs = [
    deprecated
  pythonRelaxDeps = [ "regex" ];

  build-system = [ setuptools ];

  dependencies = [
    regex
    deprecated
  ];

  nativeCheckInputs = [
    pytest-cov-stub
    pytest-forked
    pytest-random-order
    pytestCheckHook
  ];
  pythonImportsCheck = [ "oelint_parser" ];

  # Fail to run inside the code the build.
  doCheck = false;
  pythonImportsCheck = [ "oelint_parser" ];

  passthru.updateScript = nix-update-script { };

  meta = with lib; {
  meta = {
    description = "Alternative parser for bitbake recipes";
    homepage = "https://github.com/priv-kweihmann/oelint-parser";
    changelog = "https://github.com/priv-kweihmann/oelint-parser/releases/tag/${version}";
    license = licenses.bsd2;
    maintainers = with maintainers; [ otavio ];
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ otavio ];
  };
}