diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..781a8c14 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +# Exclude the symlink included to allow +# importlib.resources to work for editable installs +exclude src/*/resources diff --git a/src/asdf_standard/integration.py b/src/asdf_standard/integration.py index 8981fe56..3b90b06f 100644 --- a/src/asdf_standard/integration.py +++ b/src/asdf_standard/integration.py @@ -1,5 +1,4 @@ import sys -from pathlib import Path if sys.version_info < (3, 9): import importlib_resources @@ -10,13 +9,7 @@ def get_resource_mappings(): - resources_root = importlib_resources.files(asdf_standard) / "resources" - if not resources_root.is_dir(): - # In an editable install, the resources directory will exist off the - # repository root: - resources_root = Path(__file__).absolute().parent.parent.parent / "resources" - if not resources_root.is_dir(): - raise RuntimeError("Missing resources directory") + resources_root = importlib_resources.files("asdf_standard") / "resources" return [ asdf_standard.DirectoryResourceMapping( diff --git a/src/asdf_standard/resources b/src/asdf_standard/resources new file mode 120000 index 00000000..bc764151 --- /dev/null +++ b/src/asdf_standard/resources @@ -0,0 +1 @@ +../../resources \ No newline at end of file