Skip to content

Commit

Permalink
fix: use importlib_resources backport for compatability with older py…
Browse files Browse the repository at this point in the history
…thon versions

Signed-off-by: George Vauter <[email protected]>
  • Loading branch information
gvauter committed Aug 20, 2024
1 parent f5752f5 commit 4e14272
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ github3-py = "^4.0.1"
python-gitlab = "^4.2.0"
ruamel-yaml = "^0.18.5"
pydantic = "^2.0.0"
importlib-resources = "^6.4.3"

[tool.poetry.group.dev.dependencies]
flake8 = "^7.0.0"
Expand Down
4 changes: 2 additions & 2 deletions trestlebot/entrypoints/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"""

import argparse
import importlib.resources
import logging
import pathlib
import shutil
import sys
import traceback

import importlib_resources
from trestle.common import file_utils
from trestle.core.commands.init import InitCmd

Expand Down Expand Up @@ -151,7 +151,7 @@ def _copy_provider_files(self, args: argparse.Namespace) -> None:
)
provider_dir.mkdir(parents=True, exist_ok=True)

templates_dir = importlib.resources.files(
templates_dir = importlib_resources.files(
f"{self.TEMPLATES_MODULE}.{args.provider}"
)
for template_file in self.PROVIDER_TEMPLATES[args.provider][args.oscal_model]:
Expand Down

0 comments on commit 4e14272

Please sign in to comment.