Skip to content

importlib.resources support in editable mode #388

Closed
@LecrisUT

Description

@LecrisUT

For now I want to gather a few notes about my experimentation with importlib.resources:

  • scikit-build-core strips out the suffix of the library, i.e. in the _editable.py file
    install(
      {...},
      {...,
        'spglib.lib.libsymspg': 'spglib/lib/libsymspg.so.2.1.0'
      }, ...
      )
    In principle that seems really nice, but the name would be inconsistent on unix and windows anyway (prefix lib or not). At which point the cmake author would have to make a new library with fixed OUTPUT_NAME and suffixes, etc. But in that case it is unnecessary to sanitize the file anymore right? I think it is better to just export all files as is and handle these on the python side
  • After running importlib.resources.files() the files are not picked when using iterdir(). Only the files that are actually in that folder and pycache are detected. Presumably the paths from _editable.py have to be injected there? Sure enough when doing importlib.resources.as_file it redirects to the original source path.

Any clues on where to start to help implement this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions