dropbox / mypy-PyCharm-plugin

A simple plugin that allows running mypy from PyCharm and navigate between errors
Apache License 2.0
313 stars 14 forks source link

. is not a valid Python package name #50

Open fr0der1c opened 4 years ago

fr0der1c commented 4 years ago

image

I just installed the plugin and it gives me this error. It's fine if I run the command in terminal: image

fr0der1c commented 4 years ago

Sorry. I just found that when I'm in the terminal, I didn't go to the actual project directory in Pycharm. Instead, I went to the parent directory. If I go to the actual project directory in terminal, I will see . is not a valid Python package name again. How to fix this error?

fr0der1c commented 4 years ago

I just found myself in a dilemma: My repo (scripts) is a monorepo and there are many subdirectories containing scripts for different usages. Each script has its own dependencies so their Pipfiles are in their own directory. PyCharm only find Pipfile in project root so I have to open the subdirectories as different projects in PyCharm. But the plugin will not work in this way.

scripts
  - script_A
     - Pipfile
     - Pipfile.lock
  - script_B
     - Pipfile
     - Pipfile.lock
ilevkivskyi commented 4 years ago

One possible solution you can try is to modify to the command that plugin runs (right click in plugin window -> Configure plugin...). The plugin configs are stored per-project, so you can have different commands for different projects.