python3.pkgs.dot2tex: fix duplicate script breaking installation

This commit is contained in:
Theodore Ni 2023-08-11 22:12:35 -07:00
parent 981171662b
commit 4c8b3fe3ba
No known key found for this signature in database
GPG key ID: 48B67583BDDD4474
2 changed files with 45 additions and 8 deletions

View file

@ -1,20 +1,22 @@
{ lib
, python
, buildPythonPackage
, fetchpatch
, fetchPypi
, substituteAll
, pyparsing
, graphviz
, pytestCheckHook
, texlive
}:
buildPythonPackage rec {
pname = "dot2tex";
version = "2.11.3";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "1kp77wiv7b5qib82i3y3sn9r49rym43aaqm5aw1bwnzfbbq2m6i9";
hash = "sha256-KZoq8FruW74CV6VipQapPieSk9XDjyjQirissyM/584=";
};
patches = [
@ -23,24 +25,25 @@ buildPythonPackage rec {
inherit graphviz;
})
./test.patch # https://github.com/kjellmf/dot2tex/issues/5
# https://github.com/xyz2tex/dot2tex/pull/104 does not merge cleanly
./remove-duplicate-script.patch
];
propagatedBuildInputs = [ pyparsing ];
propagatedBuildInputs = [
pyparsing
];
nativeCheckInputs = [
pytestCheckHook
(texlive.combine {
inherit (texlive) scheme-small preview pstricks;
})
];
checkPhase = ''
${python.interpreter} tests/test_dot2tex.py
'';
meta = with lib; {
description = "Convert graphs generated by Graphviz to LaTeX friendly formats";
homepage = "https://github.com/kjellmf/dot2tex";
license = licenses.mit;
};
}

View file

@ -0,0 +1,34 @@
From 98a0fbd0c4e13df98b8fb69c241665ab774fda2e Mon Sep 17 00:00:00 2001
From: Theodore Ni <3806110+tjni@users.noreply.github.com>
Date: Fri, 11 Aug 2023 21:58:14 -0700
Subject: [PATCH] Remove script with same name as entry point
---
dot2tex/dot2tex | 5 -----
setup.py | 1 -
2 files changed, 6 deletions(-)
delete mode 100644 dot2tex/dot2tex
diff --git a/dot2tex/dot2tex b/dot2tex/dot2tex
deleted file mode 100644
index 278c0b3..0000000
--- a/dot2tex/dot2tex
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python
-from .dot2tex import main
-
-if __name__ == '__main__':
- main()
diff --git a/setup.py b/setup.py
index d05db37..67a3ee8 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,6 @@
author_email='kjellmf@gmail.com',
url="https://github.com/kjellmf/dot2tex",
py_modules=['dot2tex.dot2tex', 'dot2tex.dotparsing'],
- scripts=['dot2tex/dot2tex'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',