installer
installer copied to clipboard
Expose some helper functions in WheelSource
When I extend installer to support custom installation logic, I found the following methods or attributes very useful and worth exposing as a public method:
root_scheme. Currently retrieved by an unexported function_process_WHEEL_file, would be good to make it a property ofWheelSource_determine_scheme(path, source, root_scheme). Currently, it is an unexported function, would be good to make it a method ofWheelSource:WheelSource.determine_scheme(path). This, IMO, can achieve high cohesion.
What do you want these for?
There are several cases:
- I want to get the path to
dist-infodir to build animportlib.metadata.Distribution. Often it is available byos.path.join(destination.scheme_dict[root_scheme], source.dist_info_dir), whereroot_schemeis needed. - Pass a file filter to my custom
WheelSource, whose signature isdef filter(WheelSource, WheelContentElement) -> bool. Inside the filter, we are likely to want to know the scheme the given record entry belongs to, wheredetermine_schemeis needed.
If I am missing something please correct me.