Skip to content

Commit

Permalink
chore: add python 3.12 support (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 authored Apr 22, 2024
1 parent 8e1f74e commit f412f3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
13 changes: 4 additions & 9 deletions drydock/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import functools
import os
import click
import pkg_resources
import importlib_resources

import typing as t

Expand Down Expand Up @@ -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(
[
Expand All @@ -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()))

Expand Down Expand Up @@ -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)
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down Expand Up @@ -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=[
Expand All @@ -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",
],
)

0 comments on commit f412f3a

Please sign in to comment.