From e1df8dbd61b9b335b6d090bccb434e1664761963 Mon Sep 17 00:00:00 2001 From: Anton Bolshakov Date: Tue, 4 Jan 2022 16:27:00 +0800 Subject: [PATCH] pydot: fix upstream issue https://github.com/pydot/pydot/issues/277 --- dev-python/pydot/Manifest | 1 + dev-python/pydot/files/281.patch | 11 ++++++++ dev-python/pydot/pydot-1.4.2-r2.ebuild | 38 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 dev-python/pydot/Manifest create mode 100644 dev-python/pydot/files/281.patch create mode 100644 dev-python/pydot/pydot-1.4.2-r2.ebuild diff --git a/dev-python/pydot/Manifest b/dev-python/pydot/Manifest new file mode 100644 index 0000000000..c1159712b3 --- /dev/null +++ b/dev-python/pydot/Manifest @@ -0,0 +1 @@ +DIST pydot-1.4.2.tar.gz 272678 BLAKE2B 966f2c4ef3e26a63cc50ab89b5b6b5b413aabdfeddf994f2d5ba9dedaa1ed3152dd8060186e7380c3e768b783f7bfe1971cd600c18d1b73f7ac63db08ee3ace9 SHA512 caa8051561710129b5164fd1392da941829fd977092a6ec8b00efe7a199d2d60bc7ef13cb0e51615f384550f0fb80190d0f56b83d8d80d1fe372efb5dbbd3632 diff --git a/dev-python/pydot/files/281.patch b/dev-python/pydot/files/281.patch new file mode 100644 index 0000000000..734f22e818 --- /dev/null +++ b/dev-python/pydot/files/281.patch @@ -0,0 +1,11 @@ +--- a/dot_parser.py.orig 2021-02-15 21:19:47.000000000 +0800 ++++ b/dot_parser.py 2022-01-04 16:16:24.522390705 +0800 +@@ -439,6 +439,8 @@ + + noncomma = "".join([c for c in printables if c != ","]) + alphastring_ = OneOrMore(CharsNotIn(noncomma + ' ')) ++ # override pyparsing tightened whitespace-skipping logic ++ alphastring_.skipWhitespace = True + + def parse_html(s, loc, toks): + return '<%s>' % ''.join(toks[0]) diff --git a/dev-python/pydot/pydot-1.4.2-r2.ebuild b/dev-python/pydot/pydot-1.4.2-r2.ebuild new file mode 100644 index 0000000000..4092f6eb75 --- /dev/null +++ b/dev-python/pydot/pydot-1.4.2-r2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 + +DESCRIPTION="Python interface to Graphviz's Dot language" +HOMEPAGE="https://github.com/pydot/pydot https://pypi.org/project/pydot/" +# pypi releases don't include tests +SRC_URI="https://github.com/pydot/pydot/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~sparc-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +# See https://github.com/pydot/pydot/issues/277 for pyparsing dep +RDEPEND=" + >=dev-python/pyparsing-3[${PYTHON_USEDEP}] + media-gfx/graphviz" +BDEPEND=" + test? ( + ${RDEPEND} + dev-python/chardet[${PYTHON_USEDEP}] + )" + +python_test() { + cd test || die + "${PYTHON}" pydot_unittest.py || die "Test failed with ${EPYTHON}" +} + +#https://github.com/pydot/pydot/issues/277 +PATCHES=( + "${FILESDIR}"/281.patch +)