Hey folks, any reason why I might get different re...
# general
a
Hey folks, any reason why I might get different results for
pants dependencies --filter-target-type=python_sources,python_tests --transitive ::
in my CI environment vs locally?
A little more depth on what I am trying to do: Check if there are any dependencies in our
pyproject.toml
file that aren't been used, by taking all the dependencies relating to our
poetry_requirements
that are in use and comparing to the list in the toml file.
h
That is odd. Do you have different config in CI? Typically this is done via extra config files, like pants.ci.toml or something. Or perhaps different gitignore?
a
We don't have a different config in CI, and there is nothing relevant I can see in .gitignore. I had my colleague test on his ubuntu machine since Im on a Mac just to rule out something strange there, but no difference. The library itself is aiohttp, which is referenced here, not sure if that could be the cause since the config should be exactly the same:
Copy code
poetry_requirements(
    name="root",
    overrides={
        "fastapi": {
            "dependencies": [":root#aiohttp"]
Ok, so if I comment out the overrides and run the cli command then I get the same result as in CI. So for some reason
poetry_requirements
is treated differently, do you have any idea why?
h
I cannot imagine why! What are the differences you’re seeing?
a
So let me tell you the x of my x y problem 😬 . I was looking for a way to keep my pyproject.toml file up to date, as in only have the dependencies actually used in my repo. I thought what I would do was use
pants dependencies --filter-target-type=python_sources,python_tests --transitive ::
, take all the
root
targets and then compare against the dependencies in my pyproject.toml. Locally I get a perfect match, but in CI the above command doesn't include
aiohttp
.
h
huh
well, then it’s unsurprising that commenting out the override gives the same result, which is the wrong result…
But in CI that override is not being read somehow
which is bizarre
I think you’ll have to do some experiments along the lines of replacing that override with a different dependency (on something you don’t actually use at all (like https://pypi.org/project/cowsay/) and see if that’s read. Just start moving pieces around until something clicks.
I cannot think what this could be, other than CI isn’t seeing what you think it’s seeing, but that also seems unlikely
a
Yeah I’ll run some experiments when I feel like getting frustrated some more 😂