Mixed-language Monorepo Pain

Maybe I am missing something obvious, but getting PyCharm to work nicely within a mixed-language Nx-driven monorepo setup seems cumbersome and limited.

Right now, there appear to be three possible approaches with their own issues:

  1. Open and drive the overall project from the root. While this technically works, you will lose the ability to configure environments on a per project basis. For PyCharm to work correctly, dependencies across all projects have to be installed in the same venv.
  2. Open (or attach) each Python project as self-contained projects with their own interpreters. Now, venvs are nicely separated (unless PyCharm gets confused occasionally), but the connection to the Nx-managed root is now lost. You also lose root settings for linting, formatting, agents, etc… 
  3. Open the root and then attach nested Python projects separately. This only works when you explicitly remove any content roots from the parent, otherwise all attached projects vanish (even if you explicitly exclude their folders from the project structure of the root). Nx still won't work either and just as in (2) all root-level settings are lost.

Given how common monorepo setups are nowadays, is there a plan to address this gap in PyCharm? It would be great, if you could open the repo as a single project and then have configurable or implicit (using pyproject.toml) venv boundaries that determine which source files are associated with which interpreter.

0

Hello, dre9k

we have corresponding feature requests  in our issue tracker

https://youtrack.jetbrains.com/issue/PY-48076

https://youtrack.jetbrains.com/issue/PY-66254

Please, vote for them to raise its relevance and receive updates regarding feature status.

0

请先登录再写评论。