narrow-vegetable-37489
03/27/2024, 4:41 PMERROR: Cannot install foobar-plugin==0.1.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit <https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts>
The conflict is caused by:
foobar-plugin 0.1.0 depends on pantsbuild.pants==2.21.0.dev1
The user requested (constraint) pantsbuild-pants==2.21.0.dev1
The pantsbuild.pants==2.21.0.dev1 requirement on my plugin is added by python_distribution() and seems to come from the fact that I have a pants_requirements(name="pants") in my plugin repository’s BUILD file. If I remove pants_requirements() and publish a new version I can install the plugin just fine since python_distribution() no longer adds that dependency, but then developing the plugin gets problematic instead since I can’t run mypy or my tests locally (unless added again temporarily) or in CI.
Any ideas? I assume if pantsbuild.pants and pantsbuild-pants weren’t different it would work in this case since the versions are the same, but preferably my plugin shouldn’t be tied to one exact Pants version - so I’d rather not have the dependency at all. I guess I could perhaps ignore :pants as a dependency on my python_sources() explicitly, if that’s what python_distribution() bases the dependency list on.gorgeous-winter-99296
03/27/2024, 4:53 PMIf I remove pants_requirements() and publish a new version I can install the plugin just fine since python_distribution() no longer adds that dependency, but then developing the plugin gets problematic instead since I can’t run mypy or my tests locally (unless added again temporarily) or in CI.This seems like the actual problem. None of my plugins depend on pants when published and I can run tests etc fine.
gorgeous-winter-99296
03/27/2024, 4:55 PMnarrow-vegetable-37489
03/27/2024, 5:21 PMnarrow-vegetable-37489
03/27/2024, 5:29 PMpyproject.toml? I let python_distribution() generate all that stuff for me, which results in my packaged distribution containing a setup.py file with pantsbuild.pants as a dependency.gorgeous-winter-99296
03/27/2024, 5:45 PMgorgeous-winter-99296
03/27/2024, 5:47 PMnarrow-vegetable-37489
03/27/2024, 9:31 PMpython_distribution() and the python_sources(), but it still weasels its way in as a dependency in setup.py when the plugin is packaged. It makes sense why it behaves the way it does since pants_requirements() is just a generator for a couple of python_requirement(), but it’s annoying nonetheless 😛. I tried to manually set install_requires, but then Pants yell at me because it wants to own and control that field - so I guess I’ll just have to go down the route of manually creating the setup files for now.gorgeous-winter-99296
03/27/2024, 10:30 PMnarrow-vegetable-37489
03/27/2024, 10:48 PM