Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Support relative imports #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support relative imports #14

wants to merge 2 commits into from

Conversation

languitar
Copy link

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.

* Disable some more flake8 warnings that pop up on my machine
* Newer flake8 columns seems to be indexed one off from the previous
  tests
This reenables handling relative imports correctly and doesn't seem to
be necessary anymore on more recent mypy versions.

This will fix #6
@languitar
Copy link
Author

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.

@kaste
Copy link
Contributor

kaste commented Jun 27, 2018

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.

@languitar
Copy link
Author

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

@kaste
Copy link
Contributor

kaste commented Jun 28, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants