nshutils 0.12.1__tar.gz → 0.13.0__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.1
2
2
  Name: nshutils
3
- Version: 0.12.1
3
+ Version: 0.13.0
4
4
  Summary:
5
5
  Author: Nima Shoghi
6
6
  Author-email: nimashoghi@gmail.com
@@ -16,6 +16,7 @@ Requires-Dist: lovely-numpy ; extra == "extra"
16
16
  Requires-Dist: lovely-tensors ; extra == "extra"
17
17
  Requires-Dist: numpy
18
18
  Requires-Dist: pysnooper ; extra == "extra"
19
+ Requires-Dist: rich ; extra == "extra"
19
20
  Requires-Dist: typing-extensions
20
21
  Requires-Dist: uuid7
21
22
  Project-URL: homepage, https://github.com/nimashoghi/nshutils
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nshutils"
3
- version = "0.12.1"
3
+ version = "0.13.0"
4
4
  description = ""
5
5
  authors = ["Nima Shoghi <nimashoghi@gmail.com>"]
6
6
  readme = "README.md"
@@ -18,6 +18,7 @@ uuid7 = "*"
18
18
  lovely-numpy = { version = "*", optional = true }
19
19
  lovely-tensors = { version = "*", optional = true }
20
20
  pysnooper = { version = "*", optional = true }
21
+ rich = { version = "*", optional = true }
21
22
 
22
23
  [tool.poetry.group.dev.dependencies]
23
24
  pyright = "^1.1.373"
@@ -41,4 +42,4 @@ reportPrivateImportUsage = false
41
42
  ignore = ["F722", "F821", "E731", "E741"]
42
43
 
43
44
  [tool.poetry.extras]
44
- extra = ["pysnooper", "lovely-numpy", "lovely-tensors"]
45
+ extra = ["pysnooper", "lovely-numpy", "lovely-tensors", "rich"]
@@ -1,4 +1,5 @@
1
1
  import contextlib
2
+ import importlib.metadata
2
3
  from typing import Any, Protocol, cast
3
4
 
4
5
  from typing_extensions import TypeVar
@@ -18,7 +19,6 @@ try:
18
19
 
19
20
  import pysnooper # type: ignore
20
21
  import pysnooper.utils # type: ignore
21
- from pkg_resources import DistributionNotFound, get_distribution
22
22
 
23
23
  try:
24
24
  import torch # type: ignore
@@ -38,8 +38,8 @@ try:
38
38
  FLOATING_POINTS.add(getattr(torch, i))
39
39
 
40
40
  try:
41
- __version__ = get_distribution(__name__).version
42
- except DistributionNotFound:
41
+ __version__ = importlib.metadata.version(__name__)
42
+ except importlib.metadata.PackageNotFoundError:
43
43
  # package is not installed
44
44
  pass
45
45
 
File without changes