refined-addition-53644
04/04/2022, 9:19 AMpyproject.toml
) python projects using multiple lockfiles "resolves"? I guess the issue could be if these projects have some common third party dependencies. We have a monorepo but it contains multiple python packages generated using poetry which have their own dependencies.bitter-ability-32190
04/04/2022, 3:30 PMrefined-addition-53644
04/04/2022, 3:35 PMIf you want the same requirement to show up in multiple resolves, you currently need to create a distinct target per resolve. This will be improved in Pants 2.11 through a newI suppose this is yet to be added to 2.11 though.mechanism.parametrize()
bitter-ability-32190
04/04/2022, 3:35 PMhundreds-father-404
04/04/2022, 3:36 PMhundreds-father-404
04/04/2022, 3:36 PMhundreds-father-404
04/04/2022, 3:37 PMrefined-addition-53644
04/04/2022, 3:49 PM# src/py/utils/BUILD
python_sources(
# The files in this folder can be used with both resolves.
#
# This `parametrize` mechanism is added in Pants 2.11. In
# Pants 2.10, you can explicitly create multiple targets.
resolve=parametrize("data-science", "web-app"),
)
@hundreds-father-404
How does this work? If I have say pandas
defined as a dependency in both data-science
and web-app
, putting the parameterize
line will make sure to just generate one target associated with pandas
?hundreds-father-404
04/04/2022, 3:57 PMrefined-addition-53644
04/04/2022, 4:06 PMpandas
is defined in both data-science
and web-app
, I only need to use one of the resolves from data-science
and web-app
where pandas
is a 3rd party dependency?witty-crayon-22786
04/04/2022, 4:07 PMparametrize
in 2.11: https://www.pantsbuild.org/v2.11/docs/targets#parametrizing-targets … but they’re not specific to this usecasewitty-crayon-22786
04/04/2022, 5:19 PM