Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit f034125

Browse files
authored
fix: use importlib-resources to be compatible with py3.8 (#12)
Signed-off-by: tison <wander4096@gmail.com>
1 parent cfedfdb commit f034125

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

griseo/prompts/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import importlib.resources
1615
import json
1716
from pathlib import Path
1817

18+
import importlib_resources
19+
1920

2021
def load(prompt: str):
2122
# 1. try bundled prompts
22-
p = importlib.resources.files(__package__).joinpath(prompt)
23+
p = importlib_resources.files(__package__).joinpath(prompt)
2324
if p.is_file():
2425
with p.open() as f:
2526
return [json.loads(line) for line in f.readlines()]

poetry.lock

Lines changed: 36 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
[tool.poetry]
1616
name = "griseo"
17-
version = "0.13.0"
17+
version = "0.13.1"
1818
description = "Chat with OpenAI in the Hacker way."
1919
authors = ["tison <wander4096@gmail.com>"]
2020
license = "Apache-2.0"
@@ -32,6 +32,7 @@ openai = "^0.27.4"
3232
python-dotenv = "^1.0.0"
3333
tenacity = "^8.2.2"
3434
prompt-toolkit = "^3.0.38"
35+
importlib-resources = "^5.12.0"
3536

3637
[tool.poetry.scripts]
3738
griseo = "griseo:main"

0 commit comments

Comments
 (0)