Unverified Commit ffeda929 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

Merge pull request #333903 from dotlambda/python3Packages.md2pdf

python312Packages.md2pdf: init at 1.0.1
parents 12941fc1 a3495eb0
Loading
Loading
Loading
Loading
+57 −0
Original line number Diff line number Diff line
{
  buildPythonPackage,
  docopt,
  fetchFromGitHub,
  lib,
  markdown2,
  pytest-cov-stub,
  pytestCheckHook,
  setuptools,
  weasyprint,
}:

buildPythonPackage rec {
  pname = "md2pdf";
  version = "1.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jmaupetit";
    repo = "md2pdf";
    rev = "refs/tags/${version}";
    hash = "sha256-9B1vVfcBHk+xdE2Xouu95j3Hp4xm9d5DgPv2zKwCvHY=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail '"pytest-runner",' ""
  '';

  build-system = [ setuptools ];

  dependencies = [
    docopt
    markdown2
    weasyprint
  ];

  pythonImportsCheck = [ "md2pdf" ];

  nativeCheckInputs = [
    pytest-cov-stub
    pytestCheckHook
  ];

  preCheck = ''
    export PATH="$out/bin:$PATH"
  '';

  meta = {
    changelog = "https://github.com/jmaupetit/md2pdf/blob/${src.rev}/CHANGELOG.md";
    description = "Markdown to PDF conversion tool";
    homepage = "https://github.com/jmaupetit/md2pdf";
    license = lib.licenses.mit;
    mainProgram = "md2pdf";
    maintainers = with lib.maintainers; [ dotlambda ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -9616,6 +9616,8 @@ with pkgs;
  md2gemini = with python3.pkgs; toPythonApplication md2gemini;
  md2pdf = with python3Packages; toPythonApplication md2pdf;
  mdbook-emojicodes = callPackage ../tools/text/mdbook-emojicodes { };
  mdbook-epub = callPackage ../tools/text/mdbook-epub {
+2 −0
Original line number Diff line number Diff line
@@ -7566,6 +7566,8 @@ self: super: with self; {
  md2gemini = callPackage ../development/python-modules/md2gemini { };
  md2pdf = callPackage ../development/python-modules/md2pdf { };
  mdformat = callPackage ../development/python-modules/mdformat { };
  mdformat-admon = callPackage ../development/python-modules/mdformat-admon { };
  mdformat-beautysh = callPackage ../development/python-modules/mdformat-beautysh { };