Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faisal/pkg resources update #30

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions plugins/tutor-contrib-learner-dashboard-mfe/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def load_about():
long_description=load_readme(),
packages=find_packages(exclude=["tests*"]),
include_package_data=True,
python_requires=">=3.8",
python_requires=">=3.11",
install_requires=["tutor>=16.0.0,<17.0.0", "tutor-mfe>=16.0.0,<17.0.0"],
extras_require={"dev": ["tutor[dev]>=16.0.0,<17.0.0"]},
entry_points={
Expand All @@ -52,9 +52,7 @@ def load_about():
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.1"
__version__ = "0.1.2"
beingfaisal marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os.path
from glob import glob

import pkg_resources
import importlib.resources

from tutor import hooks
from tutormfe.plugin import MFE_APPS
Expand Down Expand Up @@ -47,10 +47,9 @@ def _add_my_mfe(mfes):
# For each task added to MY_INIT_TASKS, we load the task template
# and add it to the CLI_DO_INIT_TASKS filter, which tells Tutor to
# run it as part of the `init` job.
file_path = importlib.resources.files("tutor_learner_dashboard_mfe")
for service, template_path in MY_INIT_TASKS:
full_path: str = pkg_resources.resource_filename(
"tutor_learner_dashboard_mfe", os.path.join("templates", *template_path)
)
full_path: str = file_path / os.path.join("templates", *template_path)
with open(full_path, encoding="utf-8") as init_task_file:
init_task: str = init_task_file.read()
hooks.Filters.CLI_DO_INIT_TASKS.add_item((service, init_task))
Expand Down Expand Up @@ -78,7 +77,7 @@ def _add_my_mfe(mfes):
# apply a patch based on the file's name and contents.
for path in glob(
os.path.join(
pkg_resources.resource_filename("tutor_learner_dashboard_mfe", "patches"),
importlib.resources.files("tutor_learner_dashboard_mfe") / "patches",
"*",
)
):
Expand Down