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

Use importlib.resources once python<3.12 support is dropped #798

Open
olliesilvester opened this issue Feb 4, 2025 · 0 comments
Open

Use importlib.resources once python<3.12 support is dropped #798

olliesilvester opened this issue Feb 4, 2025 · 0 comments

Comments

@olliesilvester
Copy link
Contributor

The latest ophyd-async load plan requires a directory (Path or String type), but the importlib.resources only added support to represent a traversable as a directory as of python 3.12 (see https://docs.python.org/3/library/importlib.resources.html). I had to use some old-fashioned Python to get the correct directory path instead, see #770.

Once Python<3.12 is dropped, we should use importlib.resources to get directory locations rather than using
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))

Acceptance Criteria

  • Support for python<3.12 is dropped in mx-bluesky
  • The ROOT_DIR constant in definitions.py is removed and we use importlib.resources.as_file in its place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant