setdoc 1.3.7__tar.gz → 1.3.8__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.
Files changed (28) hide show
  1. {setdoc-1.3.7/src/setdoc.egg-info → setdoc-1.3.8}/PKG-INFO +1 -1
  2. {setdoc-1.3.7 → setdoc-1.3.8}/pyproject.toml +1 -1
  3. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/_utils/__init__.py +5 -1
  4. setdoc-1.3.8/src/setdoc/core/getbasicdoc.py +10 -0
  5. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/tests/test_core.py +8 -3
  6. {setdoc-1.3.7 → setdoc-1.3.8/src/setdoc.egg-info}/PKG-INFO +1 -1
  7. setdoc-1.3.7/src/setdoc/core/getbasicdoc.py +0 -10
  8. {setdoc-1.3.7 → setdoc-1.3.8}/LICENSE.txt +0 -0
  9. {setdoc-1.3.7 → setdoc-1.3.8}/MANIFEST.in +0 -0
  10. {setdoc-1.3.7 → setdoc-1.3.8}/README.rst +0 -0
  11. {setdoc-1.3.7 → setdoc-1.3.8}/docs/v1.0.rst +0 -0
  12. {setdoc-1.3.7 → setdoc-1.3.8}/docs/v1.1.rst +0 -0
  13. {setdoc-1.3.7 → setdoc-1.3.8}/docs/v1.2.rst +0 -0
  14. {setdoc-1.3.7 → setdoc-1.3.8}/docs/v1.3.rst +0 -0
  15. {setdoc-1.3.7 → setdoc-1.3.8}/setup.cfg +0 -0
  16. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/__init__.py +0 -0
  17. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/_utils/cfg.toml +0 -0
  18. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/core/SetDoc.py +0 -0
  19. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/core/__init__.py +0 -0
  20. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/core/basic.py +0 -0
  21. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/py.typed +0 -0
  22. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/tests/__init__.py +0 -0
  23. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/typing/SupportsDoc.py +0 -0
  24. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/typing/SupportsDocAndName.py +0 -0
  25. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc/typing/__init__.py +0 -0
  26. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc.egg-info/SOURCES.txt +0 -0
  27. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc.egg-info/dependency_links.txt +0 -0
  28. {setdoc-1.3.7 → setdoc-1.3.8}/src/setdoc.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: setdoc
3
- Version: 1.3.7
3
+ Version: 1.3.8
4
4
  Summary: This project helps to set the doc string.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -27,7 +27,7 @@ license-files = [
27
27
  name = "setdoc"
28
28
  readme = "README.rst"
29
29
  requires-python = ">=3.11"
30
- version = "1.3.7"
30
+ version = "1.3.8"
31
31
 
32
32
  [project.urls]
33
33
  Download = "https://pypi.org/project/setdoc/#files"
@@ -2,7 +2,7 @@ import enum
2
2
  import functools
3
3
  import tomllib
4
4
  from importlib import resources
5
- from typing import Any, Self
5
+ from typing import Any, Self, cast
6
6
 
7
7
  __all__ = ["Cfg"]
8
8
 
@@ -10,6 +10,10 @@ __all__ = ["Cfg"]
10
10
  class Cfg(enum.Enum):
11
11
  cfg = None
12
12
 
13
+ @functools.cached_property
14
+ def basic(self: Self) -> dict[str, Any]:
15
+ return cast(dict[str, Any], self.data["basic"])
16
+
13
17
  @functools.cached_property
14
18
  def data(self: Self) -> dict[str, Any]:
15
19
  "This cached property holds the cfg data."
@@ -0,0 +1,10 @@
1
+ from typing import Optional, cast
2
+
3
+ from setdoc._utils import Cfg
4
+
5
+ __all__ = ["getbasicdoc"]
6
+
7
+
8
+ def getbasicdoc(name: str) -> Optional[str]:
9
+ "This function returns the basic docstring for a given name."
10
+ return cast(Optional[str], Cfg.cfg.basic.get(name))
@@ -1,9 +1,10 @@
1
- import types
2
1
  import unittest
3
2
  from typing import Any, Self
4
3
 
5
4
  from setdoc.core.SetDoc import SetDoc
6
5
 
6
+ __all__ = ["TestSetDocDecorator"]
7
+
7
8
 
8
9
  class TestSetDocDecorator(unittest.TestCase):
9
10
 
@@ -42,7 +43,9 @@ class TestSetDocDecorator(unittest.TestCase):
42
43
  def my_static_method() -> None:
43
44
  pass
44
45
 
45
- self.assertEqual(MyClass.my_static_method.__doc__, "This is a static method")
46
+ self.assertEqual(
47
+ MyClass.my_static_method.__doc__, "This is a static method"
48
+ )
46
49
 
47
50
  def test_setdoc_on_class_with_init(self: Self) -> None:
48
51
  # Test the decorator on a class that has an __init__ method
@@ -88,7 +91,9 @@ class TestSetDocDecorator(unittest.TestCase):
88
91
  def my_class_method(cls: type) -> None:
89
92
  pass
90
93
 
91
- self.assertEqual(MyClass.my_class_method.__doc__, "This is a class method")
94
+ self.assertEqual(
95
+ MyClass.my_class_method.__doc__, "This is a class method"
96
+ )
92
97
 
93
98
  def test_setdoc_on_nested_function(self: Self) -> None:
94
99
  # Test the decorator on a nested function
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: setdoc
3
- Version: 1.3.7
3
+ Version: 1.3.8
4
4
  Summary: This project helps to set the doc string.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -1,10 +0,0 @@
1
- from typing import cast
2
-
3
- from setdoc._utils import Cfg
4
-
5
- __all__ = ["getbasicdoc"]
6
-
7
-
8
- def getbasicdoc(name: str) -> str:
9
- "This function returns the basic docstring for a given name."
10
- return cast(str, Cfg.cfg.data["basic"][name])
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