cold-sugar-5437608/25/2022, 12:21 AM
as a first party dependency in other code? i have a repo that looks something like this:
internal_lib has a
- src - internal_lib - setup.py - internal_lib - __init__.py (and other files) - other_app: python files that ideally do import internal_lib.asdf
file, so i’d basically like to be able to just do
in my other
code instead of having to do
. The reason I need it to be an actual distribution is so I can distribute that code elsewhere as well.
happy-kitchen-8948208/25/2022, 4:57 AM
pants should infer the dependency on that module. There is no logic that says “since this is in a distribution, don’t depend on it. If that dep isn’t being inferred, it may be because source roots aren’t set up correctly in this case. In fact, since you mentioned that there would be a different import path depending on whether you consumed the code as first party or as a published artifact, that leads me to believe that there is a source roots issue.
) based on how you consume the code
to be a source root, so that imports are always
, and you want your
to respect that.
cold-sugar-5437608/25/2022, 5:02 PM