pipenv check --style
appears to run the syntax check depending on its own python version instead of respecting the python version specified in the projects Pipfile.
$ python3 -V
: Python 3.5.3
$ pipenv --version
: pipenv, version 9.0.1
No errors.
/home/user/myenv/testfile.py:2:18: E999 SyntaxError: invalid syntax
pipenv check --style testfile.py
testfile.py
bar = 'baz'
print(f'foo {bar}')
Pipfile
[[source]]
verify_ssl = true
url = "https://pypi.python.org/simple"
name = "pypi"
[requires]
python_version = "3.6"
[dev-packages]
[packages]
yes, it is far from perfect.
AFAIK PyFlakes relies on the Python itself is installed in to analyse the code (with ast
), and therefore is only capable of linting that exact Python version. There is really no way around this but to install a seperate Flake8 copy inside the project鈥檚 virtualenv, and use it (pipenv run flake8 .
) instead.
Maybe this command can be tweaked to detect whether Flake8 is available in the project鈥檚 virtualenv, and use it if possible?
I'd be more apt to remove the flake8 checking myself.
That would be even better.
It would be great to remove the Flake8 integration. In addition to the integration not working quite right, I also find it quite odd to see Flake8 end up in my production environments via Pipenv.
So what would the desired outcome be to fix this ticket?
Should --style
be removed altogether or is there a better alternative syntax checker to use instead?
Since it doesn't work properly and that doesn't seem to be an issue easily solved I'd also prefer removal, if at some point there will be a better solution that could be implemented if people agree on it, however, imo it shouldn't be left in a broken state.
This is being worked on in #1394.
Most helpful comment
I'd be more apt to remove the flake8 checking myself.