1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
Subject: use the module from the standard library
Forworded: todo, with hybridation
--- a/hvcc/interpreters/pd2hv/HeavyObject.py
+++ b/hvcc/interpreters/pd2hv/HeavyObject.py
@@ -16,7 +16,7 @@
import decimal
import json
-import importlib_resources
+import importlib.resources
from typing import Optional, List, Dict, Any, Union, cast
from .Connection import Connection
@@ -29,11 +29,11 @@
class HeavyObject(PdObject):
- heavy_lang_json = importlib_resources.files('hvcc') / 'core/json/heavy.lang.json'
+ heavy_lang_json = importlib.resources.files('hvcc') / 'core/json/heavy.lang.json'
with open(heavy_lang_json, "r") as f:
__HEAVY_LANG_OBJS = HeavyLangType(**json.load(f)).root
- heavy_ir_json = importlib_resources.files('hvcc') / 'core/json/heavy.ir.json'
+ heavy_ir_json = importlib.resources.files('hvcc') / 'core/json/heavy.ir.json'
with open(heavy_ir_json, "r") as f:
__HEAVY_IR_OBJS = HeavyIRType(**json.load(f)).root
--- a/hvcc/types/IR.py
+++ b/hvcc/types/IR.py
@@ -143,9 +143,9 @@
""" Test object definitions
"""
import json
- import importlib_resources
+ import importlib.resources
- heavy_ir_json = importlib_resources.files('hvcc') / 'core/json/heavy.ir.json'
+ heavy_ir_json = importlib.resources.files('hvcc') / 'core/json/heavy.ir.json'
with open(heavy_ir_json, "r") as f:
data = json.load(f)
heavy_ir = HeavyIRType(root=data)
--- a/hvcc/types/Lang.py
+++ b/hvcc/types/Lang.py
@@ -41,9 +41,9 @@
if __name__ == "__main__":
import json
- import importlib_resources
+ import importlib.resources
- heavy_lang_json = importlib_resources.files('hvcc') / 'core/json/heavy.lang.json'
+ heavy_lang_json = importlib.resources.files('hvcc') / 'core/json/heavy.lang.json'
with open(heavy_lang_json, "r") as f:
data = json.load(f)
heavy_lang = HeavyLangType(root=data)
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -26,7 +26,6 @@
[tool.poetry.dependencies]
python = "^3.8.1"
Jinja2 = ">=2.11"
-importlib-resources = ">=5.1"
wstd2daisy = ">=0.5.3"
pydantic = ">=2.9.1"
|