Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake8 check does not respect projects python version #1212

Closed
Nothing4You opened this issue Dec 17, 2017 · 8 comments
Closed

flake8 check does not respect projects python version #1212

Nothing4You opened this issue Dec 17, 2017 · 8 comments
Labels
help wanted Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@Nothing4You
Copy link

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.

Describe your environment
  1. OS Type: Debian 9
  2. Python version: $ python3 -V: Python 3.5.3
  3. Pipenv version: $ pipenv --version: pipenv, version 9.0.1
Expected result

No errors.

Actual result
/home/user/myenv/testfile.py:2:18: E999 SyntaxError: invalid syntax
Steps to replicate

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]
@kennethreitz kennethreitz added Type: Enhancement 💡 This is a feature or enhancement request. help wanted labels Dec 18, 2017
@kennethreitz
Copy link
Contributor

yes, it is far from perfect.

@uranusjr
Copy link
Member

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’s virtualenv, and use it (pipenv run flake8 .) instead.

Maybe this command can be tweaked to detect whether Flake8 is available in the project’s virtualenv, and use it if possible?

@kennethreitz
Copy link
Contributor

I'd be more apt to remove the flake8 checking myself.

@uranusjr
Copy link
Member

That would be even better.

@taion
Copy link

taion commented Dec 31, 2017

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.

@patchwork-systems
Copy link
Contributor

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?

@Nothing4You
Copy link
Author

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.

@uranusjr
Copy link
Member

This is being worked on in #1394.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

5 participants