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

Support relative imports - #14

Open
languitar wants to merge 2 commits into
ambv:masterfrom
languitar:relative_imports
Open

Support relative imports#14
languitar wants to merge 2 commits into
ambv:masterfrom
languitar:relative_imports

Conversation

@languitar

Copy link
Copy Markdown

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 added 2 commits June 6, 2018 17:08
* 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
Copy Markdown
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

kaste commented Jun 27, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Author

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

@kaste

kaste commented Jun 28, 2018

Copy link
Copy Markdown
Contributor

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