You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now most of the resources are searched through resource_files, but if other projects want to inject files there, e.g. json schemas, there is no way to make it searchable.
Approach 1
Extend resource_files to allow more general Traversable types:
Helper function to get path of package file or directory.
This is in order to allow the usage of MultiplexedPath, where the roots are package="tmt" and entry-point tmt.resources
Difficulty: For this approach, many implementation must be generalized from Path to Traversable until the final item where it will be cast to Path. For the most part as I navigated, there doesn't seem to be much issue except for tmt.utils.load_schema_store where glob is used. In principle that could be handled by using iterdir instead.
Approach 2
For each resource_files implement a search mechanism to look in each entry-point.
Difficulty:
How to convert variables like TEMPLATES_DIRECTORY?
Increased complexity since this search will now be done near each execution of resource_files
Will not be able to support native MultiplexedPath e.g. from namespaced packages of the third-party project
The text was updated successfully, but these errors were encountered:
Issue
Right now most of the resources are searched through
resource_files
, but if other projects want to inject files there, e.g. json schemas, there is no way to make it searchable.Approach 1
Extend
resource_files
to allow more generalTraversable
types:tmt/tmt/utils.py
Lines 7028 to 7030 in b782a60
This is in order to allow the usage of
MultiplexedPath
, where the roots arepackage="tmt"
and entry-pointtmt.resources
Difficulty: For this approach, many implementation must be generalized from
Path
toTraversable
until the final item where it will be cast toPath
. For the most part as I navigated, there doesn't seem to be much issue except fortmt.utils.load_schema_store
whereglob
is used. In principle that could be handled by usingiterdir
instead.Approach 2
For each
resource_files
implement a search mechanism to look in each entry-point.Difficulty:
TEMPLATES_DIRECTORY
?resource_files
MultiplexedPath
e.g. from namespaced packages of the third-party projectThe text was updated successfully, but these errors were encountered: