summaryrefslogtreecommitdiff
path: root/dev-python/pydot
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
commit623ee73d661e5ed8475cb264511f683407d87365 (patch)
tree993eb27c93ec7a2d2d19550300d888fc1fed9e69 /dev-python/pydot
parentceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (diff)
gentoo Easter resync : 12.04.2020
Diffstat (limited to 'dev-python/pydot')
-rw-r--r--dev-python/pydot/Manifest3
-rw-r--r--dev-python/pydot/files/pydot-1.4.1-unittest.patch74
-rw-r--r--dev-python/pydot/pydot-1.4.1.ebuild8
3 files changed, 82 insertions, 3 deletions
diff --git a/dev-python/pydot/Manifest b/dev-python/pydot/Manifest
index 4e0a67ec892c..17cbec182e75 100644
--- a/dev-python/pydot/Manifest
+++ b/dev-python/pydot/Manifest
@@ -1,3 +1,4 @@
+AUX pydot-1.4.1-unittest.patch 3496 BLAKE2B d5aa063d1700836c2aa967c0856c4b693f0820f1c3ecf41de444781a29f4ff4fde6d8d2cbb30458364efe47154fb6ad50c545fc45fff6fd27864483ab4bef2e6 SHA512 0204de6a767d062e4074344ce093da6789145407c7aab3706abc72d15e655489b7e43f1038b8d5951ac9a107aa0ca8a399e119826100d05433d13b537ae48cdb
DIST pydot-1.4.1.tar.gz 264987 BLAKE2B 61db2b6dbeab582981bf96054686c927d8d4548ac19a6c197ab1725f92c87e973c2dcd84d4c6c04cb2ca76b8f40814cfee1d5a53e4952065a538fc271e75d2a0 SHA512 b5f16b59908586df61cd415cb1a3e242fb69c39674a82b171862beff1f3727f47cba39bdd806901cb56bc8a6888783a53d112b1b70044e124ea992789d77f938
-EBUILD pydot-1.4.1.ebuild 920 BLAKE2B 562239f017f696452c78c34577789927c8699727d54aa00ae5fbad91f364c6bf3ec512a4e86d23d5e2f0d5247f0d789560b0b6c8ad14adc9a219c05e25269098 SHA512 e4968469e606b094a3d36cff0bd23f82116a5a084c2ae125cd7fd4663d1b3212e570174e6101293009ce688e3736b4f9fbe96e0513e8662c39528ff46267eb52
+EBUILD pydot-1.4.1.ebuild 967 BLAKE2B 6dad82ff4efcd57e0131b6ddcf572628403d5a0bd30c0499d9880a68f8e698c040c10f61e6daeaab09c00a33b6b4afaa39a3c40000c202ffaf845d1d83f5a2c0 SHA512 d56a2d19325f747da54deed6d10a8680fadc686eab62880649e7a934e47b8f3474e01a414fc4fedd1522585e7f0e4545fa3458fc3fd31eac6f234c75b0b0e573
MISC metadata.xml 376 BLAKE2B 2118896ad9769d359f3d1573285cc61affc3989d2ea81d0914e01b5e8882ff94fd70a06324ce3cdc38146edc8513aa67457dc65b81af93474568e9a1b3b23c47 SHA512 0f67a0286f6ff6c6b35e67ff08abb0b86f9ac60e57d321ac7ca0508383b5ce8b0c091a3b023e87d20f3705887db40a5edde2055fa96ec7bca21a5b8aacac31ce
diff --git a/dev-python/pydot/files/pydot-1.4.1-unittest.patch b/dev-python/pydot/files/pydot-1.4.1-unittest.patch
new file mode 100644
index 000000000000..b3c0d0e426b5
--- /dev/null
+++ b/dev-python/pydot/files/pydot-1.4.1-unittest.patch
@@ -0,0 +1,74 @@
+From a10ced4d132361027a545a471af4541dea8c5cf5 Mon Sep 17 00:00:00 2001
+From: Peter Nowee <peter@peternowee.com>
+Date: Wed, 26 Jun 2019 15:43:38 +0800
+Subject: [PATCH] Fix multi.dot Graphviz regression test
+
+Commit d6602ad of 2018-12-01 fixed the regression test broken by commit
+2d55978 of 2016-07-01. This revealed that `test/graphs/multi.dot` was
+failing.
+
+`multi.dot` was introduced in commit 2b3f088 of 2010-11-07 together
+with many of the other tests still here today. It has not been touched
+since. It is a DOT-file containing two digraphs. The regression test
+compares the JPEG images rendered from the DOT-file by pydot with those
+rendered by Graphviz's dot directly.
+
+Commit 66734d2 of 2016-07-01 is the actual cause of the failure. It
+changed one of the render methods of the regression test,
+`_render_with_pydot`, from calculating a single hash for all the JPEG
+images to calculating separate hashes for each JPEG image and then
+concatenating those hashes in one long string. The other render method,
+`_render_with_graphviz`, still calculates a single hash over all data.
+For DOT-files that generate only one image the end result is the same,
+but because `multi.dot` has two graphs, it produces two images and this
+leads to comparing a string of two hashes with one single hash.
+
+I do not think the change in generating the hash was intentional, for
+the following reasons:
+- Commit 66734d2 states that its purpose was to adapt the test to an
+ API change in pydot. It does not mention a deliberate choice to
+ change the testing method.
+- There was no effort to change `_render_with_graphviz` to also produce
+ multiple hashes.
+- Except for easier debugging in case of a failing test with multiple
+ images (AFAICT, only `multi.dot`), I do not see much added benefit in
+ checking a concatenation of the hashes of all images vs. checking one
+ hash of all images together: In both cases the test will fail if one
+ or more images is rendered differently.
+- Given that there were many commits authored that same hour, including
+ commit 2d55978 which broke the regression tests, I suspect the author
+ did not run the tests for each individual commit, but only at the end
+ of that batch, and was therefore also not alerted of this change by
+ the test suite.
+
+Assuming that the change was not intended, this commit will now revert
+`_render_with_pydot` to the old behavior of calculating a single hash
+from all JPEG image data.
+
+Tested with Debian 9.9, Graphviz 2.38.0-17, Python 2.7.13-2 and 3.5.3-1.
+
+Fixes https://github.com/pydot/pydot/issues/204.
+---
+ test/pydot_unittest.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/test/pydot_unittest.py b/test/pydot_unittest.py
+index 881ee16..64aa856 100644
+--- a/test/pydot_unittest.py
++++ b/test/pydot_unittest.py
+@@ -194,11 +194,11 @@ def _render_with_graphviz(self, filename, encoding):
+
+ def _render_with_pydot(self, filename, encoding):
+ c = pydot.graph_from_dot_file(filename, encoding=encoding)
+- sha = ''
++ jpe_data = bytearray()
+ for g in c:
+- jpe_data = g.create(prog=TEST_PROGRAM, format='jpe', encoding=encoding)
+- sha += sha256(jpe_data).hexdigest()
+- return sha
++ jpe_data.extend(g.create(prog=TEST_PROGRAM, format='jpe',
++ encoding=encoding))
++ return sha256(jpe_data).hexdigest()
+
+ def test_my_regression_tests(self):
+ path = os.path.join(test_dir, TESTS_DIR_1)
diff --git a/dev-python/pydot/pydot-1.4.1.ebuild b/dev-python/pydot/pydot-1.4.1.ebuild
index fb2062cdb6de..dd84480cc56f 100644
--- a/dev-python/pydot/pydot-1.4.1.ebuild
+++ b/dev-python/pydot/pydot-1.4.1.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python3_{6,7} )
+PYTHON_COMPAT=( python3_{6,7,8} )
inherit distutils-r1
@@ -13,7 +13,7 @@ SRC_URI="https://github.com/erocarrera/pydot/archive/v${PV}.tar.gz -> ${P}.tar.g
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 s390 ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris"
IUSE="test"
RESTRICT="!test? ( test )"
@@ -24,6 +24,10 @@ DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
test? ( dev-python/chardet[${PYTHON_USEDEP}] )"
+PATCHES=(
+ "${FILESDIR}"/${P}-unittest.patch
+)
+
python_test() {
cd test || die
"${PYTHON}" pydot_unittest.py || die "Test failed with ${EPYTHON}"