A recurring frustrating error I see is: ```ERROR: ...
# general
s
A recurring frustrating error I see is:
Copy code
ERROR: usage: pex [options] [file_or_dir] [file_or_dir] [...]
pex: error: unrecognized arguments: --ddtrace
  inifile: /private/var/folders/_9/qvrc0kmj4ssfvbybnz4_wb7c0000gn/T/pants-sandbox-WruWez/backend/python/libs/expression/pytest.ini
  rootdir: /private/var/folders/_9/qvrc0kmj4ssfvbybnz4_wb7c0000gn/T/pants-sandbox-WruWez/backend/python/libs/expression
🧵
✅ 1
The stacktrace shows error is coming from
Copy code
config = pluginmanager.hook.pytest_cmdline_parse()
But the root cause of this error is always a strange mystery. Debug logs don't show any hints.
My pants.toml does indeed have these args, which are very valid and work for 99% of our repo:
Copy code
[pytest]
args = ['--disable-pytest-warnings', '--ddtrace']
Except, that pex argument error happens in the one directory where I have this in my build file:
Copy code
__defaults__(
    all={
        "dependencies": [
            "!backend/python/conftest.py:conftest",
        ]
    }
)
I'm simply trying to disable an inferred dependency on a conftest file. This same snippet works in other BUILD files...
Commenting out this block makes pants succeed, but the requirements pex has hundreds of unneccessary deps
Ugh, ignore me.... the conftest.py file was transitively bringing the
ddtrace
dependency, and this target did not directly import
ddtrace