pygraphviz 2.0.2__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygraphviz-2.0.2/pygraphviz.egg-info → pygraphviz-2.0.3}/PKG-INFO +1 -1
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/conf.py +1 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/index.rst +1 -1
- pygraphviz-2.0.3/doc/source/release/release_2.0.3.rst +30 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/__init__.py +1 -1
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/scraper.py +18 -12
- pygraphviz-2.0.3/pygraphviz/tests/test_scraper.py +88 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3/pygraphviz.egg-info}/PKG-INFO +1 -1
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz.egg-info/SOURCES.txt +1 -0
- pygraphviz-2.0.2/pygraphviz/tests/test_scraper.py +0 -36
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/INSTALL.txt +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/LICENSE +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/LICENSE.graphviz +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/MANIFEST.in +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/Makefile +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/README.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/Makefile +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/developer/contribute.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/developer/index.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/developer/release.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/index.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/install.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/reference/agraph.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/reference/credits.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/reference/history.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/reference/index.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/old_release_log.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/release_1.12.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/release_1.13.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/release_1.14.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/release_2.0.1.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/release_2.0.2.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/doc/source/release/release_2.0.rst +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/README.txt +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/miles_dat.txt.gz +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/plot_attributes.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/plot_miles.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/plot_simple.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/plot_star.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/plot_subgraph.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/plot_subgraph_boundaries.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/skip_django_simple.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/examples/skip_utf8_encoding.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/agraph.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/graphviz.i +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/graphviz.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/testing.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/__init__.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_attribute_defaults.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_clear.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_close.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_drawing.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_edge_attributes.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_graph.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_html.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_layout.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_node_attributes.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_pygraphviz.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_readwrite.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_repr_mimebundle.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_string.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_subgraph.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz/tests/test_unicode.py +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz.egg-info/dependency_links.txt +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pygraphviz.egg-info/top_level.txt +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/pyproject.toml +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/setup.cfg +0 -0
- {pygraphviz-2.0.2 → pygraphviz-2.0.3}/setup.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
pygraphviz 2.0.3
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
We're happy to announce the release of pygraphviz 2.0.3!
|
|
5
|
+
|
|
6
|
+
Bug Fixes
|
|
7
|
+
---------
|
|
8
|
+
|
|
9
|
+
- Fix scraper path handling (`#651 <https://github.com/pygraphviz/pygraphviz/pull/651>`_).
|
|
10
|
+
- Fix DLL dependencies of bundled Windows executables (`#653 <https://github.com/pygraphviz/pygraphviz/pull/653>`_).
|
|
11
|
+
|
|
12
|
+
Contributors
|
|
13
|
+
------------
|
|
14
|
+
|
|
15
|
+
4 authors added to this release (alphabetically):
|
|
16
|
+
|
|
17
|
+
- Eric Larson (`@larsoner <https://github.com/larsoner>`_)
|
|
18
|
+
- Jarrod Millman (`@jarrodmillman <https://github.com/jarrodmillman>`_)
|
|
19
|
+
- Mridul Seth (`@MridulS <https://github.com/MridulS>`_)
|
|
20
|
+
- Ross Barnowski (`@rossbar <https://github.com/rossbar>`_)
|
|
21
|
+
|
|
22
|
+
4 reviewers added to this release (alphabetically):
|
|
23
|
+
|
|
24
|
+
- Eric Larson (`@larsoner <https://github.com/larsoner>`_)
|
|
25
|
+
- Jarrod Millman (`@jarrodmillman <https://github.com/jarrodmillman>`_)
|
|
26
|
+
- Mridul Seth (`@MridulS <https://github.com/MridulS>`_)
|
|
27
|
+
- Ross Barnowski (`@rossbar <https://github.com/rossbar>`_)
|
|
28
|
+
|
|
29
|
+
_These lists are automatically generated, and may not be complete or may contain
|
|
30
|
+
duplicates._
|
|
@@ -27,6 +27,11 @@ class PNGScraper:
|
|
|
27
27
|
'image_scrapers': ('matplotlib', 'pygraphviz'),
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
Only ``.png`` files whose names appear in the code block that was just
|
|
31
|
+
executed are collected (e.g., ``"star.png"`` in ``A.draw("star.png")``), so
|
|
32
|
+
examples in the same directory can be built in parallel (sphinx-gallery's
|
|
33
|
+
``parallel`` option) without collecting each other's images.
|
|
34
|
+
|
|
30
35
|
This class is based on the recipe provide in [1]_.
|
|
31
36
|
|
|
32
37
|
References
|
|
@@ -35,9 +40,6 @@ class PNGScraper:
|
|
|
35
40
|
https://sphinx-gallery.github.io/stable/advanced.html
|
|
36
41
|
"""
|
|
37
42
|
|
|
38
|
-
def __init__(self):
|
|
39
|
-
self.seen = set()
|
|
40
|
-
|
|
41
43
|
def __repr__(self):
|
|
42
44
|
return "PNGScraper"
|
|
43
45
|
|
|
@@ -50,8 +52,10 @@ class PNGScraper:
|
|
|
50
52
|
Parameters
|
|
51
53
|
----------
|
|
52
54
|
block : tuple
|
|
53
|
-
A tuple containing the (label, content, line_number of the
|
|
54
|
-
block.
|
|
55
|
+
A tuple containing the (label, content, line_number) of the
|
|
56
|
+
block. Only PNG files whose names appear in ``content`` are
|
|
57
|
+
collected. If ``None``, all PNG files in the example's directory are
|
|
58
|
+
collected.
|
|
55
59
|
block_vars : dict
|
|
56
60
|
Dict of block variables
|
|
57
61
|
gallery_conf : dict
|
|
@@ -68,19 +72,21 @@ class PNGScraper:
|
|
|
68
72
|
except ImportError as e:
|
|
69
73
|
raise ImportError("You must install `sphinx_gallery`") from e
|
|
70
74
|
|
|
71
|
-
# Find
|
|
75
|
+
# Find the PNG files in the directory of this example that were written
|
|
76
|
+
# by this code block
|
|
72
77
|
path_current_example = os.path.dirname(block_vars["src_file"])
|
|
73
78
|
pngs = sorted(glob(os.path.join(path_current_example, "*.png")))
|
|
79
|
+
if block is not None:
|
|
80
|
+
pngs = [png for png in pngs if os.path.basename(png) in block[1]]
|
|
74
81
|
|
|
75
|
-
#
|
|
82
|
+
# Move PNGs to the sphinx-gallery output dir (so they can't be collected
|
|
83
|
+
# twice, while a later example can still write a file with the same name)
|
|
76
84
|
image_names = []
|
|
77
85
|
image_path_iterator = block_vars["image_path_iterator"]
|
|
78
86
|
for png in pngs:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
image_names.append(this_image_path)
|
|
83
|
-
shutil.move(png, this_image_path)
|
|
87
|
+
this_image_path = next(image_path_iterator)
|
|
88
|
+
image_names.append(this_image_path)
|
|
89
|
+
shutil.move(png, this_image_path)
|
|
84
90
|
|
|
85
91
|
# Use figure_rst to generate rST for image files
|
|
86
92
|
return figure_rst(image_names, gallery_conf["src_dir"])
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
import pygraphviz as pgv
|
|
5
|
+
from pygraphviz.scraper import _get_sg_image_scraper
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_scraper(tmpdir):
|
|
9
|
+
pytest.importorskip("sphinx_gallery")
|
|
10
|
+
scraper = _get_sg_image_scraper()
|
|
11
|
+
|
|
12
|
+
### Source
|
|
13
|
+
src_dir = str(tmpdir)
|
|
14
|
+
src_file = os.path.join(src_dir, "simple.py") # no need for this to exist
|
|
15
|
+
# Create source PNG
|
|
16
|
+
A = pgv.AGraph()
|
|
17
|
+
A.add_edge(1, 2)
|
|
18
|
+
A.layout()
|
|
19
|
+
A.draw(os.path.join(src_dir, "simple.png"))
|
|
20
|
+
|
|
21
|
+
### Target
|
|
22
|
+
out_dir = os.path.join(src_dir, "build", "html")
|
|
23
|
+
os.makedirs(out_dir)
|
|
24
|
+
out_file = os.path.join(out_dir, "simple.png")
|
|
25
|
+
# Target should **not** exist
|
|
26
|
+
assert not os.path.isfile(out_file)
|
|
27
|
+
# Copy source PNG to target location
|
|
28
|
+
block = None
|
|
29
|
+
block_vars = {
|
|
30
|
+
"image_path_iterator": (img for img in [out_file]),
|
|
31
|
+
"src_file": src_file,
|
|
32
|
+
}
|
|
33
|
+
gallery_conf = {"src_dir": src_dir, "builder_name": "html"}
|
|
34
|
+
scraper(block, block_vars, gallery_conf)
|
|
35
|
+
# Target should exist
|
|
36
|
+
assert os.path.isfile(out_file)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def test_scraper_only_block_pngs(tmpdir):
|
|
40
|
+
"""Only PNGs named in the block are collected, e.g. for parallel builds."""
|
|
41
|
+
pytest.importorskip("sphinx_gallery")
|
|
42
|
+
scraper = _get_sg_image_scraper()
|
|
43
|
+
src_dir = str(tmpdir)
|
|
44
|
+
A = pgv.AGraph()
|
|
45
|
+
A.add_edge(1, 2)
|
|
46
|
+
A.layout()
|
|
47
|
+
# "other.png" stands in for an image written by another example in the
|
|
48
|
+
# same directory that is running at the same time
|
|
49
|
+
for name in ("mine.png", "other.png"):
|
|
50
|
+
A.draw(os.path.join(src_dir, name))
|
|
51
|
+
out_dir = os.path.join(src_dir, "build", "html")
|
|
52
|
+
os.makedirs(out_dir)
|
|
53
|
+
out_files = [os.path.join(out_dir, f"img_{ii}.png") for ii in range(2)]
|
|
54
|
+
block = ("code", 'A.draw("mine.png")', 1)
|
|
55
|
+
block_vars = {
|
|
56
|
+
"image_path_iterator": iter(out_files),
|
|
57
|
+
"src_file": os.path.join(src_dir, "mine.py"),
|
|
58
|
+
}
|
|
59
|
+
gallery_conf = {"src_dir": src_dir, "builder_name": "html"}
|
|
60
|
+
rst = scraper(block, block_vars, gallery_conf)
|
|
61
|
+
assert os.path.isfile(out_files[0])
|
|
62
|
+
assert not os.path.isfile(out_files[1])
|
|
63
|
+
assert "img_0.png" in rst
|
|
64
|
+
assert not os.path.isfile(os.path.join(src_dir, "mine.png"))
|
|
65
|
+
assert os.path.isfile(os.path.join(src_dir, "other.png"))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def test_scraper_same_name_twice(tmpdir):
|
|
69
|
+
"""A file name reused by a later block (or example) is collected again."""
|
|
70
|
+
pytest.importorskip("sphinx_gallery")
|
|
71
|
+
scraper = _get_sg_image_scraper()
|
|
72
|
+
src_dir = str(tmpdir)
|
|
73
|
+
A = pgv.AGraph()
|
|
74
|
+
A.add_edge(1, 2)
|
|
75
|
+
A.layout()
|
|
76
|
+
out_dir = os.path.join(src_dir, "build", "html")
|
|
77
|
+
os.makedirs(out_dir)
|
|
78
|
+
block = ("code", 'A.draw("same.png")', 1)
|
|
79
|
+
gallery_conf = {"src_dir": src_dir, "builder_name": "html"}
|
|
80
|
+
for ii in range(2):
|
|
81
|
+
A.draw(os.path.join(src_dir, "same.png"))
|
|
82
|
+
out_file = os.path.join(out_dir, f"img_{ii}.png")
|
|
83
|
+
block_vars = {
|
|
84
|
+
"image_path_iterator": iter([out_file]),
|
|
85
|
+
"src_file": os.path.join(src_dir, f"example_{ii}.py"),
|
|
86
|
+
}
|
|
87
|
+
scraper(block, block_vars, gallery_conf)
|
|
88
|
+
assert os.path.isfile(out_file)
|
|
@@ -24,6 +24,7 @@ doc/source/release/release_1.13.rst
|
|
|
24
24
|
doc/source/release/release_1.14.rst
|
|
25
25
|
doc/source/release/release_2.0.1.rst
|
|
26
26
|
doc/source/release/release_2.0.2.rst
|
|
27
|
+
doc/source/release/release_2.0.3.rst
|
|
27
28
|
doc/source/release/release_2.0.rst
|
|
28
29
|
examples/README.txt
|
|
29
30
|
examples/miles_dat.txt.gz
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import pytest
|
|
3
|
-
|
|
4
|
-
import pygraphviz as pgv
|
|
5
|
-
from pygraphviz.scraper import _get_sg_image_scraper
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def test_scraper(tmpdir):
|
|
9
|
-
pytest.importorskip("sphinx_gallery")
|
|
10
|
-
scraper = _get_sg_image_scraper()
|
|
11
|
-
|
|
12
|
-
### Source
|
|
13
|
-
src_dir = str(tmpdir)
|
|
14
|
-
src_file = os.path.join(src_dir, "simple.py") # no need for this to exist
|
|
15
|
-
# Create source PNG
|
|
16
|
-
A = pgv.AGraph()
|
|
17
|
-
A.add_edge(1, 2)
|
|
18
|
-
A.layout()
|
|
19
|
-
A.draw(os.path.join(src_dir, "simple.png"))
|
|
20
|
-
|
|
21
|
-
### Target
|
|
22
|
-
out_dir = os.path.join(src_dir, "build", "html")
|
|
23
|
-
os.makedirs(out_dir)
|
|
24
|
-
out_file = os.path.join(out_dir, "simple.png")
|
|
25
|
-
# Target should **not** exist
|
|
26
|
-
assert not os.path.isfile(out_file)
|
|
27
|
-
# Copy source PNG to target location
|
|
28
|
-
block = None
|
|
29
|
-
block_vars = {
|
|
30
|
-
"image_path_iterator": (img for img in [out_file]),
|
|
31
|
-
"src_file": src_file,
|
|
32
|
-
}
|
|
33
|
-
gallery_conf = {"src_dir": src_dir, "builder_name": "html"}
|
|
34
|
-
scraper(block, block_vars, gallery_conf)
|
|
35
|
-
# Target should exist
|
|
36
|
-
assert os.path.isfile(out_file)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|