https://pantsbuild.org/ logo
#general
Title
# general
b

bitter-ability-32190

10/26/2021, 5:57 PM
Is there a way to programmatically find what needs to belong in
module_mapping
? Conceivably some tool could download the metadata for packages in
requirements.txt
and then see what violates the default mapping rules. ...I suppose that tool could also provide a best-guess on
module_mapping
as well 🤔
c

curved-television-6568

10/26/2021, 8:01 PM
I used this when developing the initial support for the default module mapping: https://gist.github.com/kaos/1481cef9a6742654274c32b11c8e55ac Not polished or anything, and only works on installed dists.
💪 1
🙌 1
b

bitter-ability-32190

10/26/2021, 8:37 PM
This is what I came to see ❤️
❤️ 1
I just noticed this seems to replace dashes in the package name with underscores. E.g.
jack-client
in my
requirements.txt
is listed as
jack_client
as the toplevel entry in the YAML
There ought to be a command to find unresolved imports, right? E,g. the inference couldn't find a good match?
💯 1
Yeah, I wonder if there could be a "strict" mode. pants will error if it isn't able to resolve a dep.
👍 1
I suppose one of the linters conceivably has this already. I'll have to check tomorrow
Nevermind, they will execute in the env and not care about package names
5 Views