Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
0x29a committed Aug 2, 2024
1 parent d424267 commit 90c3549
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tutors3/__about__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pkg_resources
from importlib import metadata
# __version__ attribute as suggested by (deferred) PEP 396:
# https://www.python.org/dev/peps/pep-0396/
#
# Single-source package definition as suggested (among several
# options) by:
# https://packaging.python.org/guides/single-sourcing-package-version/
__version__ = pkg_resources.get_distribution('tutor-contrib-s3').version
__version__ = metadata.version('tutor-contrib-s3')
12 changes: 4 additions & 8 deletions tutors3/plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import pkg_resources
import importlib_resources
from glob import glob

from tutor import hooks
Expand Down Expand Up @@ -31,7 +31,7 @@

# Add the "templates" folder as a template root
hooks.Filters.ENV_TEMPLATE_ROOTS.add_item(
pkg_resources.resource_filename("tutors3", "templates")
str(importlib_resources.files("tutors3") / "templates")
)
# Render the "build" and "apps" folders
hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
Expand All @@ -41,12 +41,8 @@
],
)
# Load patches from files
for path in glob(
os.path.join(
pkg_resources.resource_filename("tutors3", "patches"),
"*",
)
):
for path in glob(str(
importlib_resources.files("tutors3") / "patches" / "*")):
with open(path, encoding="utf-8") as patch_file:
hooks.Filters.ENV_PATCHES.add_item(
(os.path.basename(path), patch_file.read())
Expand Down

0 comments on commit 90c3549

Please sign in to comment.