k3priorityqueue 0.1.8__tar.gz → 0.1.9__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: k3priorityqueue
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Priority queue with weighted producer support
5
5
  Author-email: Zhang Yanpo <drdr.xp@gmail.com>
6
6
  License-Expression: MIT
@@ -42,10 +42,6 @@ while True:
42
42
  print('consumed all: counts:', repr(count))
43
43
  """
44
44
 
45
- from importlib.metadata import version
46
-
47
- __version__ = version("k3priorityqueue")
48
-
49
45
  from .priorityqueue import (
50
46
  Empty,
51
47
  PriorityQueue,
@@ -59,3 +55,14 @@ __all__ = [
59
55
  "Producer",
60
56
  "default_priority",
61
57
  ]
58
+
59
+
60
+ def __getattr__(name: str) -> str:
61
+ # importlib.metadata takes about 20 ms to import, so it is loaded only
62
+ # when __version__ is read
63
+ if name != "__version__":
64
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
65
+
66
+ from importlib.metadata import version
67
+
68
+ return version("k3priorityqueue")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: k3priorityqueue
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Priority queue with weighted producer support
5
5
  Author-email: Zhang Yanpo <drdr.xp@gmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "k3priorityqueue"
7
- version = "0.1.8"
7
+ version = "0.1.9"
8
8
  description = "Priority queue with weighted producer support"
9
9
  readme = "README.md"
10
10
  license = "MIT"
File without changes