Hello all, so I have the following dependencies li...
# general
a
Hello all, so I have the following dependencies listed below, and when I add
hydra
it collides with an underlying dependency of
statsforecast
. And unfortunately no version of statsforecast or hydra seem to satisfy the pip dependency resolver. To circumvent the issue I created a separate lockfile just for hydra. Firstly is this right solution, secondly if it is, when I use both resolves using parametrization (python-default, hydra),
pants check
complains with the following:
Copy code
Engine traceback:
  in `check` goal

NoCompatibleResolveException: The input targets use the `resolve` `python-default`, but some of their dependencies are not compatible with that resolve.

Input targets:

  * common/experimentation/__init__.py@resolve=python-default
  * common/experimentation/example_experiment.py@resolve=python-default

Bad dependencies:

  * requirements:exp-reqs#hydra-zen (experimentation)

All dependencies must work with the same `resolve`. To fix this, either change the `resolve=` field on those dependencies to `python-default`, or change the `resolve=` of the input targets. If those dependencies should work with multiple resolves, use the `parametrize` mechanism with the `resolve=` field or manually create multiple targets for the same entity.
prefect==2.14.*
pandera==0.18.*
pydantic==2.5.*
boto3==1.34.*
boto3-stubs[s3]==1.34.*
returns
mlforecast==0.11.*
statsforecast
xgboost==2.0.*
# dev-reqs
pytest==8.0.0
For reference I'm using pyright for the type checking
c
Using multiple resolves is a good way to isolate your conflicting requirements. I think of it like creating 2 separate venvs. Parametrising is generally the correct thing to do to specify that python sources should work with both resolves. I think the problem is that one of your files doesn't. For example, if the file contains
import hydra
, it can't work in the resolve that doesn't contain hydra. There are a few ways around this, depending on what you want to do: 1. if the file should only work in 1 resolve, you can remove the parametrisation for it (potentially manually excluding it from a `python_sources`and creating a manual target) 2. if the file should only use hydra if it's available, you can guard the import with a
try/except ImportError