I'm experimenting with monorepos & python. The idea is having multiple projects in the same repo, each project should have its own virtualenv.
I find it kinda cumbersome managing all of that in PyCharm.
PyCharm supports managing multiple projects in with different venvs: https://www.jetbrains.com/help/pycharm/opening-multiple-projects.html?_ga=2.5681206.409054178.1602169802-543218074.1500382704
But it's not very friendly if you have many projects, I will have to "open" and "attach" each and every one of them.
Let's see an example in this repo:
Under the project
directory I have 2 projects:
The 2 projects directories are marked in bold (just like the root one), basically meaning they are "PyCharm projects".
Under the preferences window, you can see all the projects:
But there's no option of adding new projects there. If I had a 3rd project, I would have to open it and attach it to the current window.
Am I missing something? Is there an easier way of marking a sub-directory as a project? Imagine cloning a repository with 10 projects or more, configuring all the settings on PyCharm is going to be very frustrating.
You can share some of the files into the
.idea
folder via your repository. This folder and particularly the.idea/modules.xml
file contains all the configuration details for your project(s).Therefore, you only have to do the setup once (or as projects are added) then the configuration will be replicated.