quaint-telephone-89068
12/23/2022, 4:53 PMariadne, which I've placed in a poetry pyproject.toml file:
[tool.poetry.dependencies]
python = "^3.8"
ariadne = "^0.13.0"
Which itself depends on a library called graphql-core, the graphql-core package exposes graphql (see here)
My BUILD file (after running ./pants tailor ::) looks as follows:
poetry_requirements(
name="poetry0",
)
python_sources(
name="root",
)
I'm running a simple script
import ariadne
from graphql.execution import MiddlewareManager
if __name__ == "__main__":
print("hello world", MiddlewareManager, ariadne)
Running the script gives me:
./pants --no-pantsd run main.py
12:03:59.01 [WARN] Pants cannot infer owners for the following imports in the target //main.py:root:
* graphql.execution.MiddlewareManager (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.14/docs/troubleshooting#import-errors-and-missing-dependencies> for common problems.
hello world <class 'graphql.execution.middleware.MiddlewareManager'> <module 'ariadne' from '/Users/jack/.cache/pants/named_caches/pex_root/venvs/6be7984cc4edd737a5b88632bd3ebc4b81ac2419/1600009f0b703061a214410767329cc05f8fd614/lib/python3.9/site-packages/ariadne/__init__.py'>
Given graphql-core is a dependency of ariadne how do I inform pants about this dependency? I've unsuccessfully tried the following:
poetry_requirements(
name="poetry0",
module_mapping={
"graphql-core": ['graphql'],
},
)
Would I have to explicitly add this dependency to my pyproject.toml or is there another mechanism to map module names I'm no aware of?
pantsbuild/pants