pygraphds 0.1.1__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygraphds
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Beginner-friendly graph data structures and operations
5
5
  Author: Dr. Mohamed B.
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pygraphds"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Beginner-friendly graph data structures and operations"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,6 +1,6 @@
1
1
  """Pedagogical graph data structures and operations."""
2
2
 
3
+ from pygraphds._version import __version__
3
4
  from pygraphds.graph import Graph
4
5
 
5
6
  __all__ = ["Graph"]
6
- __version__ = "0.1.1"
@@ -0,0 +1,3 @@
1
+ """Package version, shared by the public and class-level version attributes."""
2
+
3
+ __version__ = "0.1.2"
@@ -7,6 +7,8 @@ from copy import deepcopy
7
7
  import math
8
8
  from typing import Optional
9
9
 
10
+ from ._version import __version__
11
+
10
12
 
11
13
  class Graph:
12
14
  """Store an undirected graph with string-named nodes.
@@ -15,6 +17,9 @@ class Graph:
15
17
  duplicate edges are not allowed. Nodes and edges keep the order in which
16
18
  they were added.
17
19
 
20
+ The loaded library version is available as ``Graph.__version__`` and
21
+ ``graph.__version__``.
22
+
18
23
  Node and edge data are stored as supplied. The getters return those same
19
24
  data objects; :meth:`copy` makes a deep, independent copy of the graph.
20
25
 
@@ -28,6 +33,8 @@ class Graph:
28
33
  ['B']
29
34
  """
30
35
 
36
+ __version__ = __version__
37
+
31
38
  def __init__(self) -> None:
32
39
  self._node_data: dict[str, object] = {}
33
40
  self._adjacency: dict[str, list[str]] = {}
@@ -417,8 +424,9 @@ class Graph:
417
424
  import matplotlib.pyplot as plt
418
425
  except ImportError as error:
419
426
  raise ImportError(
420
- "Graph.show() requires Matplotlib, which should be installed "
421
- "with pygraphds. Check that the package dependencies were installed."
427
+ f"Graph.show() requires Matplotlib (pygraphds {self.__version__}). "
428
+ "Matplotlib should be installed with pygraphds. Check that "
429
+ "the package dependencies were installed."
422
430
  ) from error
423
431
 
424
432
  names = list(self._node_data)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygraphds
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Beginner-friendly graph data structures and operations
5
5
  Author: Dr. Mohamed B.
6
6
  License-Expression: MIT
@@ -2,6 +2,7 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  src/pygraphds/__init__.py
5
+ src/pygraphds/_version.py
5
6
  src/pygraphds/graph.py
6
7
  src/pygraphds.egg-info/PKG-INFO
7
8
  src/pygraphds.egg-info/SOURCES.txt
File without changes
File without changes
File without changes
File without changes