Hello community,
here is the log from the commit of package python-pydot for openSUSE:Factory checked in at 2019-04-08 10:32:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pydot (Old)
and /work/SRC/openSUSE:Factory/.python-pydot.new.3908 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pydot"
Mon Apr 8 10:32:21 2019 rev:8 rq:691521 version:1.4.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pydot/python-pydot.changes 2018-12-24 11:46:24.713185461 +0100
+++ /work/SRC/openSUSE:Factory/.python-pydot.new.3908/python-pydot.changes 2019-04-08 10:32:27.511268002 +0200
@@ -1,0 +2,18 @@
+Thu Apr 4 12:58:15 UTC 2019 - Tomáš Chvátal
+
+- Skip one failing test:
+ * pydot-skip-test.patch
+- Enable testsuite and add tests dependencies
+
+-------------------------------------------------------------------
+Tue Apr 2 12:56:07 UTC 2019 - Colleen Murphy
+
+- Update to 1.4.1:
+ * Make graph, edge, node attributes order deterministic
+ * Fix string formatting after catching error (#201)
+ * Installation of pydot in conda env on Windows directly supported
+ * Fixed comparing of SHA hash in regression tests (which fail now)
+ * Dropped Python 2.6 support (#185)
+ * Move errno from os to builtin. Fixes #177 (#191, #182)
+
+-------------------------------------------------------------------
Old:
----
pydot-1.2.4.tar.gz
New:
----
pydot-1.4.1.tar.gz
pydot-skip-test.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pydot.spec ++++++
--- /var/tmp/diff_new_pack.btkXpb/_old 2019-04-08 10:32:28.723266461 +0200
+++ /var/tmp/diff_new_pack.btkXpb/_new 2019-04-08 10:32:28.727266455 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pydot
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,19 +18,26 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pydot
-Version: 1.2.4
+Version: 1.4.1
Release: 0
Summary: Module to create (dot) graphs from Python
License: MIT
Group: Development/Libraries/Python
URL: https://github.com/erocarrera/pydot
Source: https://files.pythonhosted.org/packages/source/p/pydot/pydot-%{version}.tar.gz
+# https://github.com/pydot/pydot/issues/204
+Patch0: pydot-skip-test.patch
+BuildRequires: %{python_module chardet}
BuildRequires: %{python_module pyparsing >= 2.1.4}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
+BuildRequires: ghostscript-fonts-std
+BuildRequires: graphviz
+BuildRequires: graphviz-gd
BuildRequires: python-rpm-macros
Requires: graphviz
Requires: python-pyparsing >= 2.1.4
+Recommends: graphviz-gd
BuildArch: noarch
%python_subpackages
@@ -41,6 +48,7 @@
%prep
%setup -q -n pydot-%{version}
+%patch0 -p1
%build
%python_build
@@ -49,6 +57,9 @@
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%check
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python test/pydot_unittest.py --no-check
+
%files %{python_files}
%license LICENSE
%doc README.md
++++++ pydot-1.2.4.tar.gz -> pydot-1.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/ChangeLog new/pydot-1.4.1/ChangeLog
--- old/pydot-1.2.4/ChangeLog 2017-12-25 17:36:05.000000000 +0100
+++ new/pydot-1.4.1/ChangeLog 2018-12-12 21:59:45.000000000 +0100
@@ -1,7 +1,29 @@
# `pydot` changelog
-## 1.2.4 (2017-12-25)
+1.4.1 (2018-12-12)
+------------------
+
+- Make graph, edge, node attributes order deterministic
+- Fix string formatting after catching error (#201)
+
+
+1.4.0 (2018-12-01)
+------------------
+
+- Installation of pydot in conda env on Windows directly supported
+- Fixed comparing of SHA hash in regression tests (which fail now)
+
+
+1.3.0 (2018-11-19)
+------------------
+
+- Dropped Python 2.6 support (#185)
+- Move errno from os to builtin. Fixes #177 (#191, #182)
+
+
+1.2.4 (2017-12-25)
+------------------
- ENH: propagate `LD_LIBRARY_PATH` when calling GraphViz
- API: raise `OSError` when a GraphViz executable is not found
@@ -12,14 +34,16 @@
- API: never ignore `src, dst`, overwrite if `points` defined in `obj_dict`
-## 1.2.3 (2016-10-06)
+1.2.3 (2016-10-06)
+------------------
- support Python 2.6
- several corrections
- quote empty strings to avoid graphviz errors
-## 1.2.0 (2016-07-01)
+1.2.0 (2016-07-01)
+------------------
- support Python 3
- bumped dependency to `pyparsing >= 2.1.4`
@@ -61,7 +85,8 @@
- rm attribute `pydot.Dot.progs`
-## 1.1.0 (2016-05-23)
+1.1.0 (2016-05-23)
+------------------
- compatibility with `pyparsing >= 1.5.7`
@@ -72,7 +97,8 @@
instead of `print`
-## 1.0.29 (2016-05-16)
+1.0.29 (2016-05-16)
+------------------
- Maintenance release that keeps the same API
- pin `pyparsing == 1.5.7`
@@ -97,7 +123,7 @@
2004-04-24 13:26 carrer
* ChangeLog, LICENSE, MANIFEST, README, setup.py: Adding
- suplementary files to the distribution to the CVS.
+ supplementary files to the distribution to the CVS.
2004-04-24 12:57 carrer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/PKG-INFO new/pydot-1.4.1/PKG-INFO
--- old/pydot-1.2.4/PKG-INFO 2017-12-25 17:42:01.000000000 +0100
+++ new/pydot-1.4.1/PKG-INFO 2018-12-12 22:00:23.000000000 +0100
@@ -1,21 +1,71 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: pydot
-Version: 1.2.4
+Version: 1.4.1
Summary: Python interface to Graphviz's Dot
-Home-page: https://github.com/erocarrera/pydot
-Author: Ioannis Filippidis
-Author-email: jfilippidis@gmail.com
+Home-page: https://github.com/pydot/pydot
+Author: Ero Carrera
+Author-email: ero@dkbza.org
+Maintainer: Sebastian Kalinowski
+Maintainer-email: sebastian@kalinowski.eu
License: MIT
-Description-Content-Type: UNKNOWN
-Description:
- A Python interface to GraphViz and the DOT language.
+Description: [![Build Status](https://www.travis-ci.com/pydot/pydot.svg?branch=master)](https://www.travis-ci.com/pydot/pydot)
+ [![PyPI](https://img.shields.io/pypi/v/pydot.svg)](https://pypi.org/project/pydot/)
- This package includes an interface to GraphViz [1], with classes to represent
- graphs and dump them in the DOT language [2], and a parser from DOT.
+ About
+ =====
- [1] http://www.graphviz.org
- [2] http://www.graphviz.org/doc/info/lang.html
+ `pydot`:
+
+ - is an interface to [Graphviz][1]
+ - can parse and dump into the [DOT language][2] used by GraphViz,
+ - is written in pure Python,
+
+ and [`networkx`][3] can convert its graphs to `pydot`.
+ Development occurs at [GitHub][11] (under branch `dev`),
+ where you can report issues and contribute code.
+
+
+ Installation
+ ============
+
+ From [PyPI][4] using [`pip`][5]:
+
+ `pip install pydot`
+
+ From source:
+
+ `python setup.py install`
+
+
+ Dependencies
+ ============
+
+ - [`pyparsing`][6]: used only for *loading* DOT files,
+ installed automatically during `pydot` installation.
+
+ - GraphViz: used to render graphs as PDF, PNG, SVG, etc.
+ Should be installed separately, using your system's
+ [package manager][7], something similar (e.g., [MacPorts][8]),
+ or from [its source][9].
+
+
+ License
+ =======
+
+ Distributed under an [MIT license][10].
+
+ [1]: https://www.graphviz.org
+ [2]: https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29
+ [3]: https://github.com/networkx/networkx
+ [4]: https://pypi.python.org/pypi
+ [5]: https://github.com/pypa/pip
+ [6]: https://github.com/pyparsing/pyparsing
+ [7]: https://en.wikipedia.org/wiki/Package_manager
+ [8]: https://www.macports.org
+ [9]: https://github.com/ellson/graphviz
+ [10]: https://github.com/pydot/pydot/blob/master/LICENSE
+ [11]: https://github.com/pydot/pydot
Keywords: graphviz dot graphs visualization
Platform: UNKNOWN
@@ -25,7 +75,7 @@
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
@@ -34,3 +84,5 @@
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/README.md new/pydot-1.4.1/README.md
--- old/pydot-1.2.4/README.md 2017-12-25 17:35:47.000000000 +0100
+++ new/pydot-1.4.1/README.md 2018-11-30 22:23:39.000000000 +0100
@@ -1,4 +1,5 @@
-[![Build Status][build_img]][travis]
+[![Build Status](https://www.travis-ci.com/pydot/pydot.svg?branch=master)](https://www.travis-ci.com/pydot/pydot)
+[![PyPI](https://img.shields.io/pypi/v/pydot.svg)](https://pypi.org/project/pydot/)
About
@@ -11,7 +12,7 @@
- is written in pure Python,
and [`networkx`][3] can convert its graphs to `pydot`.
-Development occurs at [github][11] (under branch `dev`),
+Development occurs at [GitHub][11] (under branch `dev`),
where you can report issues and contribute code.
@@ -44,16 +45,14 @@
Distributed under an [MIT license][10].
-[1]: http://www.graphviz.org
+[1]: https://www.graphviz.org
[2]: https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29
[3]: https://github.com/networkx/networkx
[4]: https://pypi.python.org/pypi
[5]: https://github.com/pypa/pip
-[6]: http://pyparsing.wikispaces.com/
+[6]: https://github.com/pyparsing/pyparsing
[7]: https://en.wikipedia.org/wiki/Package_manager
[8]: https://www.macports.org
[9]: https://github.com/ellson/graphviz
-[10]: https://github.com/erocarrera/pydot/blob/master/LICENSE
-[11]: https://github.com/erocarrera/pydot
-[build_img]: https://travis-ci.org/erocarrera/pydot.svg?branch=master
-[travis]: https://travis-ci.org/erocarrera/pydot
+[10]: https://github.com/pydot/pydot/blob/master/LICENSE
+[11]: https://github.com/pydot/pydot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/pydot.egg-info/PKG-INFO new/pydot-1.4.1/pydot.egg-info/PKG-INFO
--- old/pydot-1.2.4/pydot.egg-info/PKG-INFO 2017-12-25 17:42:01.000000000 +0100
+++ new/pydot-1.4.1/pydot.egg-info/PKG-INFO 2018-12-12 22:00:22.000000000 +0100
@@ -1,21 +1,71 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: pydot
-Version: 1.2.4
+Version: 1.4.1
Summary: Python interface to Graphviz's Dot
-Home-page: https://github.com/erocarrera/pydot
-Author: Ioannis Filippidis
-Author-email: jfilippidis@gmail.com
+Home-page: https://github.com/pydot/pydot
+Author: Ero Carrera
+Author-email: ero@dkbza.org
+Maintainer: Sebastian Kalinowski
+Maintainer-email: sebastian@kalinowski.eu
License: MIT
-Description-Content-Type: UNKNOWN
-Description:
- A Python interface to GraphViz and the DOT language.
+Description: [![Build Status](https://www.travis-ci.com/pydot/pydot.svg?branch=master)](https://www.travis-ci.com/pydot/pydot)
+ [![PyPI](https://img.shields.io/pypi/v/pydot.svg)](https://pypi.org/project/pydot/)
- This package includes an interface to GraphViz [1], with classes to represent
- graphs and dump them in the DOT language [2], and a parser from DOT.
+ About
+ =====
- [1] http://www.graphviz.org
- [2] http://www.graphviz.org/doc/info/lang.html
+ `pydot`:
+
+ - is an interface to [Graphviz][1]
+ - can parse and dump into the [DOT language][2] used by GraphViz,
+ - is written in pure Python,
+
+ and [`networkx`][3] can convert its graphs to `pydot`.
+ Development occurs at [GitHub][11] (under branch `dev`),
+ where you can report issues and contribute code.
+
+
+ Installation
+ ============
+
+ From [PyPI][4] using [`pip`][5]:
+
+ `pip install pydot`
+
+ From source:
+
+ `python setup.py install`
+
+
+ Dependencies
+ ============
+
+ - [`pyparsing`][6]: used only for *loading* DOT files,
+ installed automatically during `pydot` installation.
+
+ - GraphViz: used to render graphs as PDF, PNG, SVG, etc.
+ Should be installed separately, using your system's
+ [package manager][7], something similar (e.g., [MacPorts][8]),
+ or from [its source][9].
+
+
+ License
+ =======
+
+ Distributed under an [MIT license][10].
+
+ [1]: https://www.graphviz.org
+ [2]: https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29
+ [3]: https://github.com/networkx/networkx
+ [4]: https://pypi.python.org/pypi
+ [5]: https://github.com/pypa/pip
+ [6]: https://github.com/pyparsing/pyparsing
+ [7]: https://en.wikipedia.org/wiki/Package_manager
+ [8]: https://www.macports.org
+ [9]: https://github.com/ellson/graphviz
+ [10]: https://github.com/pydot/pydot/blob/master/LICENSE
+ [11]: https://github.com/pydot/pydot
Keywords: graphviz dot graphs visualization
Platform: UNKNOWN
@@ -25,7 +75,7 @@
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
@@ -34,3 +84,5 @@
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/pydot.egg-info/SOURCES.txt new/pydot-1.4.1/pydot.egg-info/SOURCES.txt
--- old/pydot-1.2.4/pydot.egg-info/SOURCES.txt 2017-12-25 17:42:01.000000000 +0100
+++ new/pydot-1.4.1/pydot.egg-info/SOURCES.txt 2018-12-12 22:00:22.000000000 +0100
@@ -5,6 +5,7 @@
dot_parser.py
pydot.py
requirements.txt
+setup.cfg
setup.py
pydot.egg-info/PKG-INFO
pydot.egg-info/SOURCES.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/pydot.py new/pydot-1.4.1/pydot.py
--- old/pydot-1.2.4/pydot.py 2017-12-25 17:35:47.000000000 +0100
+++ new/pydot-1.4.1/pydot.py 2018-12-12 21:59:45.000000000 +0100
@@ -3,6 +3,7 @@
from __future__ import print_function
import copy
import io
+import errno
import os
import re
import subprocess
@@ -19,7 +20,7 @@
__author__ = 'Ero Carrera'
-__version__ = '1.2.4'
+__version__ = '1.4.1'
__license__ = 'MIT'
@@ -30,7 +31,7 @@
str_type = basestring
-GRAPH_ATTRIBUTES = set( ['Damping', 'K', 'URL', 'aspect', 'bb', 'bgcolor',
+GRAPH_ATTRIBUTES = { 'Damping', 'K', 'URL', 'aspect', 'bb', 'bgcolor',
'center', 'charset', 'clusterrank', 'colorscheme', 'comment', 'compound',
'concentrate', 'defaultdist', 'dim', 'dimen', 'diredgeconstraints',
'dpi', 'epsilon', 'esep', 'fontcolor', 'fontname', 'fontnames',
@@ -45,10 +46,10 @@
'showboxes', 'size', 'smoothing', 'sortv', 'splines', 'start',
'stylesheet', 'target', 'truecolor', 'viewport', 'voro_margin',
# for subgraphs
- 'rank' ] )
+ 'rank' }
-EDGE_ATTRIBUTES = set( ['URL', 'arrowhead', 'arrowsize', 'arrowtail',
+EDGE_ATTRIBUTES = { 'URL', 'arrowhead', 'arrowsize', 'arrowtail',
'color', 'colorscheme', 'comment', 'constraint', 'decorate', 'dir',
'edgeURL', 'edgehref', 'edgetarget', 'edgetooltip', 'fontcolor',
'fontname', 'fontsize', 'headURL', 'headclip', 'headhref', 'headlabel',
@@ -59,10 +60,10 @@
'nojustify', 'penwidth', 'pos', 'samehead', 'sametail', 'showboxes',
'style', 'tailURL', 'tailclip', 'tailhref', 'taillabel', 'tailport',
'tailtarget', 'tailtooltip', 'target', 'tooltip', 'weight',
- 'rank' ] )
+ 'rank' }
-NODE_ATTRIBUTES = set( ['URL', 'color', 'colorscheme', 'comment',
+NODE_ATTRIBUTES = { 'URL', 'color', 'colorscheme', 'comment',
'distortion', 'fillcolor', 'fixedsize', 'fontcolor', 'fontname',
'fontsize', 'group', 'height', 'id', 'image', 'imagescale', 'label',
'labelloc', 'layer', 'margin', 'nojustify', 'orientation', 'penwidth',
@@ -70,19 +71,79 @@
'shape', 'shapefile', 'showboxes', 'sides', 'skew', 'sortv', 'style',
'target', 'tooltip', 'vertices', 'width', 'z',
# The following are attributes dot2tex
- 'texlbl', 'texmode' ] )
+ 'texlbl', 'texmode' }
-CLUSTER_ATTRIBUTES = set( ['K', 'URL', 'bgcolor', 'color', 'colorscheme',
+CLUSTER_ATTRIBUTES = { 'K', 'URL', 'bgcolor', 'color', 'colorscheme',
'fillcolor', 'fontcolor', 'fontname', 'fontsize', 'label', 'labeljust',
'labelloc', 'lheight', 'lp', 'lwidth', 'nojustify', 'pencolor',
- 'penwidth', 'peripheries', 'sortv', 'style', 'target', 'tooltip'] )
+ 'penwidth', 'peripheries', 'sortv', 'style', 'target', 'tooltip' }
+
+
+DEFAULT_PROGRAMS = {
+ 'dot',
+ 'twopi',
+ 'neato',
+ 'circo',
+ 'fdp',
+ 'sfdp',
+}
+
+
+def is_windows():
+ # type: () -> bool
+ return os.name == 'nt'
+
+
+def is_anacoda():
+ # type: () -> bool
+ return os.path.exists(os.path.join(sys.prefix, 'conda-meta'))
+
+
+def get_executable_extension():
+ # type: () -> str
+ if is_windows():
+ return '.bat' if is_anacoda() else '.exe'
+ else:
+ return ''
+
+
+def call_graphviz(program, arguments, working_dir, **kwargs):
+ # explicitly inherit `$PATH`, on Windows too,
+ # with `shell=False`
+
+ if program in DEFAULT_PROGRAMS:
+ extension = get_executable_extension()
+ program += extension
+
+ if arguments is None:
+ arguments = []
+
+ env = {
+ 'PATH': os.environ.get('PATH', ''),
+ 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''),
+ }
+
+ program_with_args = [program, ] + arguments
+
+ process = subprocess.Popen(
+ program_with_args,
+ env=env,
+ cwd=working_dir,
+ shell=False,
+ stderr=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ **kwargs
+ )
+ stdout_data, stderr_data = process.communicate()
+
+ return stdout_data, stderr_data, process
#
-# Extented version of ASPN's Python Cookbook Recipe:
+# Extended version of ASPN's Python Cookbook Recipe:
# Frozen dictionaries.
-# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/414283
+# https://code.activestate.com/recipes/414283/
#
# This version freezes dictionaries used as values within dictionaries.
#
@@ -600,7 +661,7 @@
node_attr = list()
- for attr in self.obj_dict['attributes']:
+ for attr in sorted(self.obj_dict['attributes']):
value = self.obj_dict['attributes'][attr]
if value == '':
value = '""'
@@ -642,7 +703,7 @@
All the attributes defined in the Graphviz dot language should
be supported.
- Attributes can be set through the dynamically generated methods:
+ Attributes can be set through the dynamically generated methods:
set_[attribute name], i.e. set_label, set_fontname
@@ -795,7 +856,7 @@
edge_attr = list()
- for attr in self.obj_dict['attributes']:
+ for attr in sorted(self.obj_dict['attributes']):
value = self.obj_dict['attributes'][attr]
if value == '':
value = '""'
@@ -1433,7 +1494,7 @@
name=self.obj_dict['name'])
graph.append(s)
- for attr in self.obj_dict['attributes']:
+ for attr in sorted(self.obj_dict['attributes']):
if self.obj_dict['attributes'].get(attr, None) is not None:
@@ -1758,7 +1819,6 @@
f.write(s)
return True
-
def create(self, prog=None, format='ps', encoding=None):
"""Creates and returns a binary image for the graph.
@@ -1817,24 +1877,23 @@
then you may want to give the absolute path to the
executable (for example, to `dot.exe`) in `prog`.
"""
- default_names = set([
- 'dot', 'twopi', 'neato',
- 'circo', 'fdp', 'sfdp'])
+
if prog is None:
prog = self.prog
+
assert prog is not None
+
if isinstance(prog, (list, tuple)):
prog, args = prog[0], prog[1:]
else:
args = []
- if os.name == 'nt' and prog in default_names:
- if not prog.endswith('.exe'):
- prog += '.exe'
+
# temp file
tmp_fd, tmp_name = tempfile.mkstemp()
os.close(tmp_fd)
self.write(tmp_name, encoding=encoding)
tmp_dir = os.path.dirname(tmp_name)
+
# For each of the image files...
for img in self.shape_files:
# Get its data
@@ -1846,40 +1905,43 @@
f = open(os.path.join(tmp_dir, os.path.basename(img)), 'wb')
f.write(f_data)
f.close()
- # explicitly inherit `$PATH`, on Windows too,
- # with `shell=False`
- env = dict()
- env['PATH'] = os.environ.get('PATH', '')
- env['LD_LIBRARY_PATH'] = os.environ.get('LD_LIBRARY_PATH', '')
- cmdline = [prog, '-T' + format] + args + [tmp_name]
+
+ arguments = ['-T{}'.format(format), ] + args + [tmp_name]
+
try:
- p = subprocess.Popen(
- cmdline,
- env=env,
- cwd=tmp_dir,
- shell=False,
- stderr=subprocess.PIPE, stdout=subprocess.PIPE)
+ stdout_data, stderr_data, process = call_graphviz(
+ program=prog,
+ arguments=arguments,
+ working_dir=tmp_dir,
+ )
except OSError as e:
- if e.errno == os.errno.ENOENT:
+ if e.errno == errno.ENOENT:
args = list(e.args)
args[1] = '"{prog}" not found in path.'.format(
prog=prog)
raise OSError(*args)
else:
raise
- stdout_data, stderr_data = p.communicate()
+
# clean file litter
for img in self.shape_files:
os.unlink(os.path.join(tmp_dir, os.path.basename(img)))
+
os.unlink(tmp_name)
- # print(stdout_data)
- if p.returncode != 0:
- print(
- ('{cmdline} return code: {c}\n\n'
- 'stdout, stderr:\n {out}\n{err}\n').format(
- cmdline=cmdline,
- c=p.returncode,
- out=stdout_data,
- err=stderr_data))
- assert p.returncode == 0, p.returncode
+
+ if process.returncode != 0:
+ message = (
+ '"{prog}" with args {arguments} returned code: {code}\n\n'
+ 'stdout, stderr:\n {out}\n{err}\n'
+ ).format(
+ prog=prog,
+ arguments=arguments,
+ code=process.returncode,
+ out=stdout_data,
+ err=stderr_data,
+ )
+ print(message)
+
+ assert process.returncode == 0, process.returncode
+
return stdout_data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/requirements.txt new/pydot-1.4.1/requirements.txt
--- old/pydot-1.2.4/requirements.txt 2017-12-25 17:35:47.000000000 +0100
+++ new/pydot-1.4.1/requirements.txt 2018-12-05 22:07:40.000000000 +0100
@@ -1,4 +1,2 @@
# dev
chardet
-coveralls
-nose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/setup.cfg new/pydot-1.4.1/setup.cfg
--- old/pydot-1.2.4/setup.cfg 2017-12-25 17:42:01.000000000 +0100
+++ new/pydot-1.4.1/setup.cfg 2018-12-12 22:00:23.000000000 +0100
@@ -1,3 +1,13 @@
+[bdist_wheel]
+universal = 1
+
+[zest.releaser]
+python-file-with-version = pydot.py
+release = no
+push-changes = no
+create-wheel = yes
+tag-format = v{version}
+
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/setup.py new/pydot-1.4.1/setup.py
--- old/pydot-1.2.4/setup.py 2017-12-25 17:41:37.000000000 +0100
+++ new/pydot-1.4.1/setup.py 2018-12-05 22:07:40.000000000 +0100
@@ -4,32 +4,43 @@
from setuptools import setup
except ImportError:
from distutils.core import setup
-import pydot
+import ast
+import codecs
+import os
+import re
-long_description = '''
-A Python interface to GraphViz and the DOT language.
-This package includes an interface to GraphViz [1], with classes to represent
-graphs and dump them in the DOT language [2], and a parser from DOT.
+CURRENT_DIR = os.path.dirname(__file__)
-[1] http://www.graphviz.org
-[2] http://www.graphviz.org/doc/info/lang.html
-'''
+def get_long_description():
+ readme_path = os.path.join(CURRENT_DIR, "README.md")
+ with codecs.open(readme_path, encoding="utf8") as ld_file:
+ return ld_file.read()
+
+
+def get_version():
+ pydot_py = os.path.join(CURRENT_DIR, 'pydot.py')
+ _version_re = re.compile(r'__version__\s+=\s+(?P<version>.*)')
+ with codecs.open(pydot_py, 'r', encoding='utf8') as f:
+ match = _version_re.search(f.read())
+ version = match.group('version') if match is not None else '"unknown"'
+ return str(ast.literal_eval(version))
setup(
name='pydot',
- version=pydot.__version__,
+ version=get_version(),
description="Python interface to Graphviz's Dot",
author='Ero Carrera',
author_email='ero@dkbza.org',
- maintainer='Ioannis Filippidis',
- maintainer_email='jfilippidis@gmail.com',
- url='https://github.com/erocarrera/pydot',
+ maintainer='Sebastian Kalinowski',
+ maintainer_email='sebastian@kalinowski.eu',
+ url='https://github.com/pydot/pydot',
license='MIT',
keywords='graphviz dot graphs visualization',
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
@@ -37,7 +48,7 @@
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
- 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
@@ -46,7 +57,8 @@
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Visualization',
'Topic :: Software Development :: Libraries :: Python Modules'],
- long_description=long_description,
+ long_description=get_long_description(),
+ long_description_content_type="text/markdown",
py_modules=['pydot', 'dot_parser'],
install_requires=['pyparsing>=2.1.4'],
tests_require=['chardet'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/test/graphs/url.dot new/pydot-1.4.1/test/graphs/url.dot
--- old/pydot-1.2.4/test/graphs/url.dot 2017-12-25 17:35:47.000000000 +0100
+++ new/pydot-1.4.1/test/graphs/url.dot 2018-11-26 21:31:46.000000000 +0100
@@ -1,25 +1,25 @@
digraph G {
- URL="http://www.graphviz.org/doc/info/output.html"
+ URL="https://www.graphviz.org/doc/info/output.html"
label=output
- lang [ URL="http://www.graphviz.org/doc/info/lang.html" ]
+ lang [ URL="https://www.graphviz.org/doc/info/lang.html" ]
colors [
style=filled
fillcolor=lightblue
- URL="http://www.graphviz.org/doc/info/output.html"
-label=<<table href="http://www.graphviz.org/doc/info/colors.html"><tr><td BGCOLOR="green">colors</td></tr></table>>];
+ URL="https://www.graphviz.org/doc/info/output.html"
+label=<<table href="https://www.graphviz.org/doc/info/colors.html"><tr><td BGCOLOR="green">colors</td></tr></table>>];
subgraph cluster0 {
style=filled
fillcolor=yellow
- URL="http://www.graphviz.org/doc/info/arrows.html"
+ URL="https://www.graphviz.org/doc/info/arrows.html"
label=arrows
command [ style=filled
fillcolor=grey
- URL="http://www.graphviz.org/doc/info/command.html" ]
+ URL="https://www.graphviz.org/doc/info/command.html" ]
name [ URL="\G \N"]
}
- lang -> command [ URL="http://www.graphviz.org/doc/info/shapes.html"
+ lang -> command [ URL="https://www.graphviz.org/doc/info/shapes.html"
]
lang -> colors [ URL="\E" edgetooltip=self ]
lang -> size [ URL="headurl" edgetooltip=headurl headlabel=size headULR=headsize]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pydot-1.2.4/test/pydot_unittest.py new/pydot-1.4.1/test/pydot_unittest.py
--- old/pydot-1.2.4/test/pydot_unittest.py 2017-12-25 17:35:47.000000000 +0100
+++ new/pydot-1.4.1/test/pydot_unittest.py 2018-12-10 09:01:14.000000000 +0100
@@ -21,7 +21,7 @@
import unittest
-DOT_BINARY_PATH = 'dot'
+TEST_PROGRAM = 'dot'
TESTS_DIR_1 = 'my_tests'
TESTS_DIR_2 = 'graphs'
@@ -72,9 +72,8 @@
g.add_node(node)
node.set('label', 'mine')
s = g.to_string()
- s_0 = 'digraph G {\nlegend [label=mine, shape=box];\n}\n'
- s_1 = 'digraph G {\nlegend [shape=box, label=mine];\n}\n'
- assert s == s_0 or s == s_1, (s, s_0)
+ expected = 'digraph G {\nlegend [label=mine, shape=box];\n}\n'
+ assert s == expected
def test_attribute_with_implicit_value(self):
@@ -141,19 +140,16 @@
def test_graph_with_shapefiles(self):
-
- shapefile_dir = os.path.join(test_dir,
- 'from-past-to-future')
+ shapefile_dir = os.path.join(test_dir, 'from-past-to-future')
# image files are omitted from sdist
if not os.path.isdir(shapefile_dir):
warnings.warn('Skipping tests that involve images, '
'they can be found in the `git` repository.')
return
- dot_file = os.path.join(shapefile_dir,
- 'from-past-to-future.dot')
+ dot_file = os.path.join(shapefile_dir, 'from-past-to-future.dot')
- pngs = dot_files = [
+ pngs = [
os.path.join(shapefile_dir, fname) for
fname in os.listdir(shapefile_dir)
if fname.endswith('.png')]
@@ -185,20 +181,22 @@
def _render_with_graphviz(self, filename, encoding):
with io.open(filename, 'rt', encoding=encoding) as stdin:
- p = subprocess.Popen(
- [DOT_BINARY_PATH, '-Tjpe'],
- cwd=os.path.dirname(filename),
+ stdout_data, stderr_data, process = pydot.call_graphviz(
+ program=TEST_PROGRAM,
+ arguments=['-Tjpe', ],
+ working_dir=os.path.dirname(filename),
stdin=stdin,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- stdout_data, stderr_data = p.communicate()
+ )
+
+ assert process.returncode == 0, stderr_data
+
return sha256(stdout_data).hexdigest()
def _render_with_pydot(self, filename, encoding):
c = pydot.graph_from_dot_file(filename, encoding=encoding)
sha = ''
for g in c:
- jpe_data = g.create(format='jpe', encoding=encoding)
+ jpe_data = g.create(prog=TEST_PROGRAM, format='jpe', encoding=encoding)
sha += sha256(jpe_data).hexdigest()
return sha
@@ -228,8 +226,8 @@
os.sys.stdout.write('#')
os.sys.stdout.flush()
pydot_sha = self._render_with_pydot(fpath, encoding)
- pydot_sha = self._render_with_graphviz(fpath, encoding)
- assert pydot_sha == pydot_sha, (pydot_sha, pydot_sha)
+ graphviz_sha = self._render_with_graphviz(fpath, encoding)
+ assert pydot_sha == graphviz_sha, (pydot_sha, graphviz_sha)
def test_numeric_node_id(self):
@@ -295,15 +293,15 @@
self._reset_graphs()
- names = set([ 'node_%05d' % i for i in range(10**3) ])
+ names = { 'node_%05d' % i for i in range(10**3) }
for name in names:
self.graph_directed.add_node( pydot.Node(name, label=name) )
self.assertEqual(
- set([n.get_name()
- for n in self.graph_directed.get_nodes()]), names)
+ {n.get_name()
+ for n in self.graph_directed.get_nodes()}, names)
def test_executable_not_found_exception(self):
@@ -375,7 +373,4 @@
check_path()
test_dir = os.path.dirname(sys.argv[0])
print('The tests are using `pydot` from: {pd}'.format(pd=pydot))
- if sys.version_info >= (2, 7):
- unittest.main(verbosity=2)
- else:
- unittest.main()
+ unittest.main(verbosity=2)
++++++ pydot-skip-test.patch ++++++
Index: pydot-1.4.1/test/pydot_unittest.py
===================================================================
--- pydot-1.4.1.orig/test/pydot_unittest.py
+++ pydot-1.4.1/test/pydot_unittest.py
@@ -205,6 +205,7 @@ class TestGraphAPI(unittest.TestCase):
self._render_and_compare_dot_files(path)
+ @unittest.skip("fails even in git on travis")
def test_graphviz_regression_tests(self):
path = os.path.join(test_dir, TESTS_DIR_2)
self._render_and_compare_dot_files(path)