Skip to content

A bit of modernisation: importlib, pathlib#65

Merged
ajjackson merged 2 commits intomainfrom
importlib
Jan 22, 2026
Merged

A bit of modernisation: importlib, pathlib#65
ajjackson merged 2 commits intomainfrom
importlib

Conversation

@ajjackson
Copy link
Member

This is a cherry-pick and tidy-up of some useful things from #43.
The INSTRUMENT_DATA_PATH variable becomes packaging-level information accessed via importlib. This resolves some circular import issues encountered in #43.

It does slightly complicate the testing situation; for now we patch importlib.resources.files() as a fixture.
This is a bit more risky than changing our own INSTRUMENT_DATA_PATH variable; if we run into conflict with other uses for this function then we might need to reintroduce the variable. Alternatively we could consider using an environment variable so additional paths can be set at runtime.

The INSTRUMENT_DATA_PATH variable becomes packaging-level information
accessed via importlib. That slightly complicates the testing situation;
for now we patch importlib.resources.files() as a fixture.

This is a bit more risky than changing our own INSTRUMENT_DATA_PATH
variable; if we run into conflict with other uses for this function
then we might need to reintroduce the variable.
Alternatively we could consider using an environment variable so
additional paths can be set at runtime.
@ajjackson ajjackson merged commit b308958 into main Jan 22, 2026
5 checks passed
@ajjackson
Copy link
Member Author

Thanks @oerc0122 🚀

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

Successfully merging this pull request may close these issues.

2 participants