Skip to content

Commit

Permalink
add resources symlink
Browse files Browse the repository at this point in the history
this allows editable installs to find
asdf_standard.resources during an editable
install (via importlib.resources.files)
  • Loading branch information
braingram committed Dec 12, 2023
1 parent 6e46c62 commit 665c82d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude src/*/resources
9 changes: 1 addition & 8 deletions src/asdf_standard/integration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sys
from pathlib import Path

if sys.version_info < (3, 9):
import importlib_resources
Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions src/asdf_standard/resources

0 comments on commit 665c82d

Please sign in to comment.