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

[py]: exclude *venv directories from flake8 #10651

Closed
wants to merge 1 commit into from

Conversation

symonk
Copy link
Member

@symonk symonk commented May 15, 2022

Invoking tox is a requirement currently and not something that bazel does; this means people need to typically make a virtualenv and install tox in it to do this task; installing tox globally is also possible but not -advised (but that won't encounter the problem this fixes if so).

Common python practice would be:

python3.7 -m venv .venv || python3.7 -m venv venv ( in the case of using 3.7 like selenium encourages)

This excludes *venv so that tox -e flake8 does not take a long time to complete and flag up 200+ false positives by scanning files inside the virtual env.

@codecov-commenter
Copy link

Codecov Report

Merging #10651 (c32947f) into trunk (6083cc4) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##            trunk   #10651   +/-   ##
=======================================
  Coverage   45.60%   45.60%           
=======================================
  Files          86       86           
  Lines        5741     5741           
  Branches      274      274           
=======================================
  Hits         2618     2618           
  Misses       2849     2849           
  Partials      274      274           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6083cc4...c32947f. Read the comment docs.

Copy link
Member

@titusfortner titusfortner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify that what you have is supposed to work? (or why it didn't for me)

@@ -1,5 +1,5 @@
[flake8]
exclude = .tox,docs/source/conf.py
exclude = .tox,docs/source/conf.py,*venv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't actually work for me. I think this did: ./venv

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has this been solved?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't recreate this; where does your virtual env typically reside, can you share the full path? I tested it yesterday and couldn't break it

@titusfortner titusfortner added this to the 4.3 milestone May 24, 2022
@symonk
Copy link
Member Author

symonk commented Jun 9, 2022

@titusfortner This landed in another piece of work of mine, if you come across issues using tox -e linting with delays and or files being parsed from a virtualenv please reach out to me and we can figure it out, this as-is works perfectly for me so I deemed it ok to bring in for now, closing this in favour of #10662

@symonk symonk closed this Jun 9, 2022
@symonk symonk deleted the flake8-venv branch June 9, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants