curved-microphone-39455
12/14/2022, 7:16 PMproject/BUILD
looks like this
python_sources(
name="project",
dependencies = [
"src/libraries/lib1:poetry",
"src/libraries/lib2:poetry",
"src/libraries/lib3:poetry",
]
)
poetry_requirements(
name="poetry",
)
and all lib looks like this
poetry_requirements(
name="poetry",
module_mapping={
[...] # multiple modules mapping
},
overrides={
[...] # multiple overrides
}
)
it looks like it getting the local dependencies since its throwing errors from inside the library
src/libraries/lib1/lib1/v2/enums/base_format.py:5: in <module>
import yaml
E ModuleNotFoundError: No module named 'yaml'
but if I run the tests of lib1
everything is ok.
Local Dependencies are already declared as Editable in the pyproject.toml
witty-crayon-22786
12/14/2022, 8:12 PMcurved-microphone-39455
12/14/2022, 8:13 PMpants_version = "2.14.0"
witty-crayon-22786
12/14/2022, 8:13 PMwitty-crayon-22786
12/14/2022, 8:14 PMcurved-microphone-39455
12/14/2022, 8:15 PMcurved-microphone-39455
12/14/2022, 8:15 PMwitty-crayon-22786
12/14/2022, 8:16 PMpoetry_requirements
likely have some overlapping dependencies, so you are probably getting ambiguity warningscurved-microphone-39455
12/14/2022, 8:16 PMwitty-crayon-22786
12/14/2022, 8:16 PMyaml
witty-crayon-22786
12/14/2022, 8:17 PMcurved-microphone-39455
12/14/2022, 8:19 PMpyproject.toml
? for each individual projectwitty-crayon-22786
12/14/2022, 8:19 PMpoetry_requirements
helper, yea…curved-microphone-39455
12/14/2022, 8:23 PMwitty-crayon-22786
12/14/2022, 8:28 PMcurved-microphone-39455
12/14/2022, 8:30 PM/src/common/unit-tests
/src/common/runtime
that are empty project with a simple pyproject.toml
that contains stuff like pytest, flask, etc, and my src/libraries
and /src/services
would have a local dependencies with Poetry to those projects ?witty-crayon-22786
12/14/2022, 8:31 PMcurved-microphone-39455
12/14/2022, 8:31 PMpoetry install
from a src/libraries
and the venv creation should be goodcurved-microphone-39455
12/14/2022, 8:32 PMcurved-microphone-39455
12/14/2022, 8:33 PMbroad-processor-92400
12/14/2022, 8:44 PMcurved-microphone-39455
12/14/2022, 8:49 PMwitty-crayon-22786
12/14/2022, 8:51 PMThis does force pants to be using everything the same versions of all dependencies across all projects, though.right: if you actually need multiple versions of some dependencies, you’d need to use multiple `resolve`s in Pants, which is mentioned here. but if you can avoid that, you’re better off.
curved-microphone-39455
12/14/2022, 9:34 PM