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

Flake8 does not respect mypy.ini #24

Open
tsoernes opened this issue Dec 7, 2018 · 3 comments
Open

Flake8 does not respect mypy.ini #24

tsoernes opened this issue Dec 7, 2018 · 3 comments

Comments

@tsoernes
Copy link

tsoernes commented Dec 7, 2018

I have a mypy.ini file at project root, with Python version set to 3.7.. Running flake8 on any file in that directory still gives me T499 mypy: error: failed to find a Python executable matching version (3, 6). Running mypy standalone works straight out of the box, with or without mypy.ini, without any additional arguments or configuration.

$ which flake8
~/anaconda3/bin/flake8
$ which python
~/anaconda3/bin/python
$ python ~/anaconda3/bin/flake8 multipuller/feed.py 
multipuller/feed.py:1:1: T499 usage: mypy [-h] [-v] [-V] [more options; see below]
multipuller/feed.py:2:1: T499             [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
multipuller/feed.py:3:1: T499 mypy: error: failed to find a Python executable matching version (3, 6), perhaps try --python-executable, or --no-site-packages?
$ python --version
Python 3.7.0 
$ mypy multipuller/feed.py 
multipuller/feed.py:101:8: error: "Dict[str, Any]" has no attribute "entries"
multipuller/feed.py:102:22: error: "Dict[str, Any]" has no attribute "entries"
multipuller/feed.py:112:13: error: "Dict[str, Any]" has no attribute "feed_dict"
multipuller/feed.py:113:15: error: "Dict[str, Any]" has no attribute "feed_dict"
multipuller/feed.py:114:18: error: "Dict[str, Any]" has no attribute "feed_dict"
multipuller/feed.py:117:17: error: "Dict[str, Any]" has no attribute "feed_dict"
$ head -2 mypy.ini 
[mypy]
python_version=3.7
@tsoernes
Copy link
Author

tsoernes commented Dec 7, 2018

(The problem with using --mypy-config is that is does NOT work in subdirectories)

@tsoernes
Copy link
Author

tsoernes commented Dec 7, 2018

Have also tried adding this to setup.cfg, without luck:

#[mypy]
#python_version = 3.7

@MRigal
Copy link

MRigal commented Jan 4, 2019

Also fixed by https://github.com/ambv/flake8-mypy/pull/22/files

Try from master!

Although this will only fix the problem for the version. In case you wanna check for another platform than linux, I'm afraid that the problem remains...

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

No branches or pull requests

2 participants