diff --git a/drydock/plugin.py b/drydock/plugin.py index 48bb173f..3fb468f3 100644 --- a/drydock/plugin.py +++ b/drydock/plugin.py @@ -2,7 +2,7 @@ import functools import os import click -import pkg_resources +import importlib_resources import typing as t @@ -186,7 +186,7 @@ def get_sync_waves_for_resource(resource_name: str) -> SYNC_WAVES_ORDER_ATTRS_TY # Plugin templates tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_item( - pkg_resources.resource_filename("drydock", "templates") + str(importlib_resources.files("drydock") / "templates") ) tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items( [ @@ -196,12 +196,7 @@ def get_sync_waves_for_resource(resource_name: str) -> SYNC_WAVES_ORDER_ATTRS_TY ], ) # Load all patches from the "patches" folder -for path in glob( - os.path.join( - pkg_resources.resource_filename("drydock", "patches"), - "*", - ) -): +for path in glob(str(importlib_resources.files("drydock") / "patches" / "*")): with open(path, encoding="utf-8") as patch_file: tutor_hooks.Filters.ENV_PATCHES.add_item((os.path.basename(path), patch_file.read())) @@ -230,7 +225,7 @@ def get_sync_waves_for_resource(resource_name: str) -> SYNC_WAVES_ORDER_ATTRS_TY # # init script with open( - pkg_resources.resource_filename("drydock", "templates/drydock/task/mongodb/init"), + str(importlib_resources.files("drydock") / "templates" / "drydock" / "task" / "mongodb" / "init"), encoding="utf-8", ) as fi: tutor_hooks.Filters.CLI_DO_INIT_TASKS.add_item(("mongodb", fi.read()), priority=tutor_hooks.priorities.HIGH) diff --git a/setup.py b/setup.py index a2f3cf27..d71a2405 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ def load_readme(): - with io.open(os.path.join(HERE, "README.rst"), "rt", encoding="utf8") as f: + with io.open(os.path.join(HERE, "README.md"), "rt", encoding="utf8") as f: return f.read() @@ -39,7 +39,7 @@ def load_about(): packages=find_packages(exclude=["tests*"]), include_package_data=True, python_requires=">=3.8", - install_requires=["tutor>=17.0.0,<18.0.0"], + install_requires=["tutor>=17.0.2,<18.0.0"], entry_points={"tutor.plugin.v1": ["drydock = drydock.plugin"] }, classifiers=[ @@ -51,5 +51,7 @@ def load_about(): "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", ], )