Module mapping from pattern? Hello team, I am look...
# general
m
Module mapping from pattern? Hello team, I am looking through the Pants code base to see if I can register a
module_pattern_mapping
. Specifically I want to map
prefix-some-library
to
some_library
. It seems there are default module pattern mapping defined in the Python backend and
python_requirements
support custom module mapping. But am I right in that users cannot register custom module pattern mapping?
h
m
Hello Benjy, thanks for the reply. Yes... right now I am doing this but basically all my company internal libraries is published with a prefix
mycompany-libary-name
and maps to
import library_name
right now I have a large list specifying all of the module mapping but wanted to make sure that I am not missing a better way of doing things...
h
Ah, I see, so you want a pattern-based thing
yeah, no way to do that for a custom internal library I think
you could write a custom dep inference plugin I think
if it’s worth the hassle
m
Ah ok... where would I find documentation for that?
h
For custom dep inference, specifically, looks like we don’t have good documentation
you’d have to look at examples, I will try and find some
m
Ah no worries... I can go through the repo in that case. Thank you!