scruby-plugin 2.2.3__py3-none-any.whl → 2.2.5__py3-none-any.whl

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.
scruby_plugin/plugin.py CHANGED
@@ -19,5 +19,5 @@ class ScrubyPlugin:
19
19
  # What version of Scruby is the plugin for?
20
20
  SCRUBY_VERSION: ClassVar[Literal[2]] = 2
21
21
 
22
- def __init__(self, scruby_self: Scruby) -> None: # noqa: D107
22
+ def __init__(self, scruby_self: Scruby) -> None: # ruff:ignore[undocumented-public-init]
23
23
  self.scruby_self = weakref.ref(scruby_self)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scruby-plugin
3
- Version: 2.2.3
3
+ Version: 2.2.5
4
4
  Summary: Library for creating Scruby plugins.
5
5
  Project-URL: Bug Tracker, https://github.com/kebasyaty/scruby-plugin/issues
6
6
  Project-URL: Changelog, https://github.com/kebasyaty/scruby-plugin/blob/v2/CHANGELOG.md
@@ -46,7 +46,7 @@ Library for creating plugins for <a href="https://pypi.org/project/scruby/" alt=
46
46
  <a href="https://docs.astral.sh/ruff/" alt="Code style: Ruff"><img src="https://img.shields.io/badge/code%20style-Ruff-FDD835.svg" alt="Code style: Ruff"></a>
47
47
  <a href="https://pypi.org/project/scruby-plugin"><img src="https://img.shields.io/pypi/format/scruby-plugin" alt="Format"></a>
48
48
  <a href="https://pepy.tech/projects/scruby-plugin"><img src="https://static.pepy.tech/badge/scruby-plugin" alt="PyPI Downloads"></a>
49
- <a href="https://github.com/kebasyaty/scruby-plugin/blob/main/LICENSE" alt="GitHub license"><img src="https://img.shields.io/github/license/kebasyaty/scruby-plugin" alt="GitHub license"></a>
49
+ <a href="https://github.com/kebasyaty/scruby-plugin/blob/v2/LICENSE" alt="GitHub license"><img src="https://img.shields.io/github/license/kebasyaty/scruby-plugin" alt="GitHub license"></a>
50
50
  </p>
51
51
 
52
52
  <br>
@@ -81,7 +81,7 @@ class PluginName(ScrubyPlugin):
81
81
 
82
82
  ```python
83
83
  import anyio
84
- from typing import Any
84
+ from typing import Annotated, Any
85
85
  from pydantic import Field
86
86
  from scruby import Scruby, ScrubyModel
87
87
  from scruby_plugin import ScrubyPlugin
@@ -100,16 +100,19 @@ class CollectionMeta(ScrubyPlugin):
100
100
 
101
101
  class Car(ScrubyModel):
102
102
  """Car model."""
103
- brand: str = Field(strict=True, frozen=True)
104
- model: str = Field(strict=True, frozen=True)
105
- year: int = Field(strict=True)
106
- power_reserve: int = Field(strict=True)
103
+
104
+ brand: str = Field(frozen=True)
105
+ model: str = Field(frozen=True)
106
+ year: int
107
+ power_reserve: int
107
108
  # key is always at bottom
108
- key: str = Field(
109
- strict=True,
110
- frozen=True,
111
- default_factory=lambda data: f"{data['brand']}:{data['model']}",
112
- )
109
+ key: Annotated[
110
+ str,
111
+ Field(
112
+ frozen=True,
113
+ default_factory=lambda data: f"{data['brand']}:{data['model']}",
114
+ ),
115
+ ]
113
116
 
114
117
 
115
118
  async def main() -> None:
@@ -136,4 +139,4 @@ if __name__ == "__main__":
136
139
 
137
140
  [![Changelog](https://raw.githubusercontent.com/kebasyaty/scruby-plugin/v2/assets/links/changelog.svg "Changelog")](https://github.com/kebasyaty/scruby-plugin/blob/v2/CHANGELOG.md "Changelog")
138
141
 
139
- [![MIT](https://raw.githubusercontent.com/kebasyaty/scruby-plugin/v2/assets/links/mit.svg "MIT")](https://github.com/kebasyaty/scruby-plugin/blob/main/LICENSE "MIT")
142
+ [![MIT](https://raw.githubusercontent.com/kebasyaty/scruby-plugin/v2/assets/links/mit.svg "MIT")](https://github.com/kebasyaty/scruby-plugin/blob/v2/LICENSE "MIT")
@@ -0,0 +1,7 @@
1
+ scruby_plugin/__init__.py,sha256=kWaqpz4RYNT9Kc9FF6jj0GX1Mppm1uhFfArPY6EYneI,241
2
+ scruby_plugin/plugin.py,sha256=ZoGodGSVBEDU-xka3-82k94f-Ffi7mB_ZksKjyyRHAM,642
3
+ scruby_plugin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ scruby_plugin-2.2.5.dist-info/METADATA,sha256=oKSIlNHKs1_M1LILBq3AcCU80m4PngKRDmSeVaIyPIs,5374
5
+ scruby_plugin-2.2.5.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
6
+ scruby_plugin-2.2.5.dist-info/licenses/LICENSE,sha256=mvh5qv1YJGyuVCkRxonDDNOzxlwXszKvwxXfOeXKrqw,1074
7
+ scruby_plugin-2.2.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.30.1
2
+ Generator: hatchling 1.31.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- scruby_plugin/__init__.py,sha256=kWaqpz4RYNT9Kc9FF6jj0GX1Mppm1uhFfArPY6EYneI,241
2
- scruby_plugin/plugin.py,sha256=DkKhcHrmfSJ9kaYqyfbYxIEc0ICyPbGzKsoGEHjRTRY,615
3
- scruby_plugin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- scruby_plugin-2.2.3.dist-info/METADATA,sha256=JY6vwzmtZ__7K1Gdr_VULQMwtCfTDC4n1eZJZP8oB9Q,5410
5
- scruby_plugin-2.2.3.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
6
- scruby_plugin-2.2.3.dist-info/licenses/LICENSE,sha256=mvh5qv1YJGyuVCkRxonDDNOzxlwXszKvwxXfOeXKrqw,1074
7
- scruby_plugin-2.2.3.dist-info/RECORD,,