Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3.pkgs.dot2tex: fix duplicate script breaking installation #248640

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions pkgs/development/python-modules/dot2tex/default.nix
Original file line number Diff line number Diff line change
@@ -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 = [
Expand All @@ -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;
};

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 98a0fbd0c4e13df98b8fb69c241665ab774fda2e Mon Sep 17 00:00:00 2001
From: Theodore Ni <[email protected]>
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='[email protected]',
url="https://github.com/kjellmf/dot2tex",
py_modules=['dot2tex.dot2tex', 'dot2tex.dotparsing'],
- scripts=['dot2tex/dot2tex'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',