<@U06A03HV1> Staring a new thread here for depreca...
# general
i
@witty-crayon-22786 Staring a new thread here for deprecation moving from 2.13 to 2.14
👍 1
I'm trying to find how to fix
Invalid option 'inits' under [python-infer]
w
you should have a deprecation for that in 2.13
i
oh. I see it! my mistake.
w
Deprecated, is scheduled to be removed in version: 2.14.0.dev1.
Use the more powerful option
[python-infer].init_files
. For identical behavior, set to ‘always’. Otherwise, we recommend the default of
content_only
(simply delete the option
[python-infer].inits
to trigger the default).
i
got it. making the upgrades now
Getting a ton of
python can't Pants cannot infer owners for the following imports in the target
warning because of Django prob
I assume that is expected?
h
Hmm, and you weren’t getting these on 2.13?
i
nope
seems to run tho 🤷‍♂️
w
“warn for unowned imports” was enabled by default in 2.14: many of those warnings likely represent issues that would be good to fix: https://www.pantsbuild.org/docs/reference-python-infer#unowned_dependency_behavior
Usually when an import cannot be inferred, it represents an issue like Pants not being properly configured, e.g. targets not set up. Often, missing dependencies will result in confusing runtime errors like
ModuleNotFoundError
, so this option can be helpful to error more eagerly.
To ignore any false positives, either add
# pants: no-infer-dep
to the line of the import or put the import inside a
try: except ImportError:
block.
i
Unfortunately there are hundreds of them. Django does a lot of magic importing
w
ok. you can disable that warning as well, but particularly when they have to do with an undeclared dependencies, they’re good to fix. if most of them have the same shape (such as referring to a particular missing 3rdparty dep), they might be easy to clear (such as by adding the dep)
i
ok. got it. will give it a shot
c
Unfortunately there are hundreds of them. Django does a lot of magic importing
Is that imports for 3rd party deps? If so, you may be able to address them with a proper fix by providing module_mapping config to your
python_requirements
target.
☝️ 1