aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/render.py
diff options
context:
space:
mode:
authorJ08nY2023-09-28 17:43:33 +0200
committerJ08nY2023-09-28 17:43:33 +0200
commit0b250f49cbd8961dbfebe399b7063412941cf948 (patch)
tree2b0ff3e0e3f95f9e5fa67cb7ac6928d824998c93 /pyecsca/codegen/render.py
parentf2a0476c778dd5f752bf522f28563ec7a01f186e (diff)
downloadpyecsca-codegen-0b250f49cbd8961dbfebe399b7063412941cf948.tar.gz
pyecsca-codegen-0b250f49cbd8961dbfebe399b7063412941cf948.tar.zst
pyecsca-codegen-0b250f49cbd8961dbfebe399b7063412941cf948.zip
Remove deprecated pkg_resources usage.
Diffstat (limited to 'pyecsca/codegen/render.py')
-rw-r--r--pyecsca/codegen/render.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pyecsca/codegen/render.py b/pyecsca/codegen/render.py
index 19d395f..7202e86 100644
--- a/pyecsca/codegen/render.py
+++ b/pyecsca/codegen/render.py
@@ -7,11 +7,11 @@ from os import makedirs
from typing import Optional, List, Set, Mapping, MutableMapping, Any, Tuple
from jinja2 import Environment, PackageLoader
-from pkg_resources import resource_filename
+from importlib_resources import files, as_file
from public import public
from pyecsca.ec.configuration import HashType, RandomMod, Reduction, Multiplication, Squaring
from pyecsca.ec.coordinates import CoordinateModel
-from pyecsca.ec.formula import (Formula)
+from pyecsca.ec.formula import Formula
from pyecsca.ec.model import CurveModel
from pyecsca.ec.mult import (ScalarMultiplier, LTRMultiplier, RTLMultiplier, CoronMultiplier,
LadderMultiplier, SimpleLadderMultiplier, DifferentialLadderMultiplier,
@@ -248,7 +248,7 @@ def render(config: DeviceConfiguration) -> Tuple[str, str, str]:
symlinks = ["asn1", "bn", "hal", "hash", "prng", "simpleserial", "tommath", "fat.h",
"rand.h", "point.h", "curve.h", "mult.h", "formulas.h", "action.h", "Makefile.inc"]
for sym in symlinks:
- os.symlink(resource_filename("pyecsca.codegen", sym), path.join(temp, sym))
+ os.symlink(files("pyecsca.codegen").joinpath(sym), path.join(temp, sym))
gen_dir = path.join(temp, "gen")
makedirs(gen_dir, exist_ok=True)