banks 2.1.2__py3-none-any.whl → 2.1.3__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.
banks/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2023-present Massimiliano Pippi <mpippi@gmail.com>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "2.1.2"
4
+ __version__ = "2.1.3"
@@ -27,7 +27,7 @@ DEFAULT_INDEX_NAME = "index.json"
27
27
  class PromptFile(PromptModel):
28
28
  """Model representing a prompt file stored on disk."""
29
29
 
30
- path: Path = Field(exclude=True)
30
+ path: Path | None = Field(default=None, exclude=True)
31
31
 
32
32
  @classmethod
33
33
  def from_prompt_path(cls: type[Self], prompt: Prompt, path: Path) -> Self:
@@ -101,7 +101,7 @@ class DirectoryPromptRegistry:
101
101
  """
102
102
  version = version or DEFAULT_VERSION
103
103
  for pf in self._index.files:
104
- if pf.name == name and pf.version == version and pf.path.exists():
104
+ if pf.name == name and pf.version == version and pf.path and pf.path.exists():
105
105
  return Prompt(**pf.model_dump())
106
106
  raise PromptNotFoundError
107
107
 
@@ -135,6 +135,10 @@ class DirectoryPromptRegistry:
135
135
  def _load(self):
136
136
  """Load the prompt index from disk."""
137
137
  self._index = PromptFileIndex.model_validate_json(self._index_path.read_text())
138
+ # Reconstruct the file paths since they're excluded from serialization
139
+ for pf in self._index.files:
140
+ if pf.path is None:
141
+ pf.path = self._path / f"{pf.name}.{pf.version}.jinja"
138
142
 
139
143
  def _save(self):
140
144
  """Save the prompt index to disk."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: banks
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: A prompt programming language
5
5
  Project-URL: Documentation, https://github.com/masci/banks#readme
6
6
  Project-URL: Issues, https://github.com/masci/banks/issues
@@ -1,4 +1,4 @@
1
- banks/__about__.py,sha256=FgQqeZsldfp1gHFQOfAIpO9mYK5Yl83xo-6r31g2O-0,132
1
+ banks/__about__.py,sha256=GetPXxJYXnTH5Y2Q50FaMRs7TJ2tkq34MorPa-qCNpc,132
2
2
  banks/__init__.py,sha256=4IBopxXstFZliCvSjOuTurSQb32Vy26EXOPhmNZ4Hus,334
3
3
  banks/cache.py,sha256=uUGAu82-mfrscc2q24x19ZMZBkoQzf3hh7_V300J-Ik,1069
4
4
  banks/config.py,sha256=c6B1cXUZ-NN0XmJvfezXeHPXHP7knk8TfbmcZL7gCzk,1082
@@ -18,10 +18,10 @@ banks/filters/image.py,sha256=cxp_Tlqy-DQ1y3I6IyO6TwM7KkdP8aL_xEKcSqeWX1w,1140
18
18
  banks/filters/lemmatize.py,sha256=Yvp8M4HCx6C0nrcu3UEMtjJUwsyVYI6GQDYOG4S6EEw,887
19
19
  banks/filters/tool.py,sha256=i8ukSDYw54ksShVJ2abfRQAiKzKrqUtmgBB1H04cig0,475
20
20
  banks/registries/__init__.py,sha256=iRK-8420cKBckOTd5KcIFQyV66EsF0Mc7UHCkzf8qZU,255
21
- banks/registries/directory.py,sha256=WXVL8gIrH2OqDYcC89TuTW-iXSwT9WqJq_OWe_kYC2Q,5803
21
+ banks/registries/directory.py,sha256=gRFO7fl9yXHt2NJ1pDA2wPSQtlORhSw1GKWxSTyFzE8,6055
22
22
  banks/registries/file.py,sha256=8ayvFrcM8Tk0DWgGXmKD2DRBfGXr5CmgtdQaQ5cXhow,4054
23
23
  banks/registries/redis.py,sha256=eBL92URJa-NegOxRLS4b2xrDRDxz6iiaz_7Ddi32Rtc,2756
24
- banks-2.1.2.dist-info/METADATA,sha256=o-tu_uFkiR7T3pkakUGoIZq4iOWIy7bkTay_9vX36lw,12098
25
- banks-2.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- banks-2.1.2.dist-info/licenses/LICENSE.txt,sha256=NZJne_JTwMFwq_g-kq-sm4PuaeVOgu1l3NUGOgBHX-g,1102
27
- banks-2.1.2.dist-info/RECORD,,
24
+ banks-2.1.3.dist-info/METADATA,sha256=TL6VlzchrWjdEduPj_aHzVKJts7peXbug1CUaogpPbo,12098
25
+ banks-2.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ banks-2.1.3.dist-info/licenses/LICENSE.txt,sha256=NZJne_JTwMFwq_g-kq-sm4PuaeVOgu1l3NUGOgBHX-g,1102
27
+ banks-2.1.3.dist-info/RECORD,,
File without changes