fast-nail-55400
04/21/2026, 6:58 AMsys.path question: I am adding a new backend to Pants called src/python/pants/backend/observability/opentelemetry. I am seeing this backend shadow the actual third-party opentelemetry package though because the parent directory src/python/pants/backend/observability is in the sys.path when running tests and so an absolute import (from opentelemetry import trace) fails because of the shadowing. This parent directory is not a source root, is this expected behavior?fast-nail-55400
04/21/2026, 7:09 AMprepared_sources.source_roots=('.', 'src/python')curved-manchester-66006
04/21/2026, 8:38 PMsrc/python/pants/backend/ I'm double surprised we didn't hit it before.)happy-kitchen-89482
04/21/2026, 11:12 PMfast-nail-55400
04/22/2026, 3:53 AM. can even be a valid source root?happy-kitchen-89482
04/22/2026, 3:55 AMfast-nail-55400
04/22/2026, 4:43 AMpants.toml.fast-nail-55400
04/22/2026, 4:44 AMsys.path in use in the test file is from dumping the value there).fast-nail-55400
04/22/2026, 6:41 AMconftest.py in the repository has its source root resolved as . and not /.fast-nail-55400
04/22/2026, 6:43 AM. seems wrong. It would make more sense for them to be resolved as /. (Whether this will fix the shadowing problem is its own issue.)fast-nail-55400
04/22/2026, 9:37 AMfast-nail-55400
04/22/2026, 9:43 AM—import-mode flag.fast-nail-55400
04/22/2026, 9:45 AMopentelemetry will come from the cached import.fast-nail-55400
04/22/2026, 9:56 AM__init__.py in the parent directory. Adding that changed the auto-import behavior. Ugh.happy-kitchen-89482
04/22/2026, 5:03 PM