I have a working import (and test) when having `st...
# general
f
I have a working import (and test) when having
string_imports = true
in
pants.toml
but when I convert the needed import to be dynamic, the module isn't found - which makes sense somehow I guess. How would I get rid of the need for string imports at this stage?
so, from the docs:
string_imports
--[no-]python-infer-string-imports
PANTS_PYTHON_INFER_STRING_IMPORTS
default:
False
Infer a target's dependencies based on strings that look like dynamic dependencies, such as Django settings files expressing dependencies as strings.
To ignore a false positive, you can either put
# pants: no-infer-dep
on the line of the string or put
!{bad_address}
in the
dependencies
field of your target.
ok, nevermind, found a solution in providing the needed module in the function, then pants can pick it up again and import it _configure_settings_(["service_a.app_a"], "service_a.app_a.urls")
👍 1
h
Yep, something like that 🙂