flake8-mypy icon indicating copy to clipboard operation
flake8-mypy copied to clipboard

Support relative imports

Open languitar opened this issue 7 years ago • 4 comments

Putting the files in an isolated named folder prevented relative imports in the form of from .. import from working. I cannot see any use for mangling the project structure through a temp dir for recent mypy versions. Everything seems to work correctly now without this.

This PR also fixes the tests that are currently failing.

languitar avatar Jun 06 '18 15:06 languitar

Yikes, seems to fail horribly on 3.5 and 3.7-dev. But this is probably unrelated to my fix? The whole call to mypy fails there.

languitar avatar Jun 06 '18 15:06 languitar

I don't think this is a good change. You need to handle input via stdin. Most of the flake8 plugins for the IDEs send the buffer contents via stdin.

kaste avatar Jun 27 '18 14:06 kaste

Ah ok, I didn't know this requirement and there seems to be no test that enforces this.

languitar avatar Jun 28 '18 09:06 languitar

It should probably work with temp files just fine if we take a given filename and do the --shadow-file filename tempfilename thing.

kaste avatar Jun 28 '18 09:06 kaste