DamnWidget / anaconda

Anaconda turns your Sublime Text 3 in a full featured Python development IDE including autocompletion, code linting, IDE features, autopep8 formating, McCabe complexity checker Vagrant and Docker support for Sublime Text 3 using Jedi, PyFlakes, pep8, MyPy, PyLint, pep257 and McCabe that will never freeze your Sublime Text 3
http://damnwidget.github.io/anaconda/
GNU General Public License v3.0
2.21k stars 260 forks source link

Dir-relative import fails validate_imports #694

Open mikelambert opened 7 years ago

mikelambert commented 7 years ago

Expected Behaviour

Given a module.py in the current directory, I expect this to pass when validate_imports is true:

from . import module

Actual Behaviour

It highlights the above line, saying: can't import . module.

Steps to Reproduce

Create module.py (can be empty) Create test.py containing from . import module.

ST3, Anaconda and OS versions

ST3 Stable Build 3126 Anaconda 2.1.21 Mac OS X 10.12.6 Python (built-in, not overridden in my sublime-project)

ST3 Console Logs

(nothing)

Anaconda's JsonServer Logs

2017-08-27 20:48:37,080: INFO    : client requests: lint
mikelambert commented 7 years ago

Oh, and I have tried sticking "." into my extra_paths, to no avail.

j9ac9k commented 7 years ago

I can confirm I have the same issue; although I'm using a slightly different syntax:

from .other_file import OtherObject

in the same directory, other_file.py is present, and OtherObject is within it. I too can confirm, adding the directory to "extra paths" doesn't help either.

halfnhalf commented 6 years ago

Same issue here

Anaconda 2.2.29

aguilera51284 commented 5 years ago

same here :(!