dazzling-elephant-33766
05/31/2023, 4:42 PMrequirements.txt
I have the scipy
dep, which itself has numpy
as dependency
scipy==1.10.1
I have a little script that imports both packages
import scipy
import numpy
print(scipy.__version__)
print(numpy.__version__)
I ran pants tailor ::
and this gives me my BUILD
file.
python_requirements(
name="reqs0",
)
python_sources(
name="root",
)
When I run pants run script.py
I get the following warning
17:38:20.11 [WARN] Pants cannot infer owners for the following imports in the target //script.py:root:
* numpy (line: 2)
If you do not expect an import to be inferrable, add `# pants: no-infer-dep` to the import line. Otherwise, see <https://www.pantsbuild.org/v2.15/docs/troubleshooting#import-errors-and-missing-dependencies> for common problems.
1.10.1
1.24.3
What’s the best way to go about suppressing this error correctly?
Is the only way to add numpy
explicitly in my requirement.txt
file or pyproject.toml
file here? Or is there another way to tell pants “numpy is a transitive dependency of scipy” so use that.refined-addition-53644
05/31/2023, 4:54 PMenough-analyst-54434
05/31/2023, 5:04 PMdazzling-elephant-33766
06/01/2023, 9:06 AMenough-analyst-54434
06/01/2023, 1:20 PMnumpy
. If it does, add a version constraint. If your version constraint ends up conflicting with scipy's and fails a resolve at some point, that's excellent! You found out as fast as possible you have a real issue.