enthought / envisage

Envisage is a Python-based framework for building applications whose functionalities can be extended by adding "plug-ins".
http://docs.enthought.com/envisage/
Other
82 stars 26 forks source link

Exclude the build directory in flake8 configuration #536

Closed mdickinson closed 1 year ago

mdickinson commented 1 year ago

Currently, flake8 errors in the codebase get reported twice by the continuous integration workflows: once for the true location of the code, and once for the copy in the build directory that's created as a side-effect of the way that modern pip and setuptools work together.

For example, from a recent run (https://github.com/enthought/envisage/actions/runs/4436008433/jobs/7783891320):

[EXECUTING] /home/runner/edm/bin/edm run -e envisage-test-3.8-null -- python -m flake8
./build/lib/envisage/tests/test_plugin.py:34:1: E303 too many blank lines (3)
./envisage/tests/test_plugin.py:34:1: E303 too many blank lines (3)
Command '['/home/runner/edm/bin/edm', 'run', '-e', 'envisage-test-3.8-null', '--', 'python', '-m', 'flake8']' returned non-zero exit status 1.

We're already excluding the build directory in .gitignore, but not in our flake8 configuration. This PR fixes that, so that we no longer get duplicate flake8 errors.

(Tested manually locally.)

mdickinson commented 1 year ago

Sort of surprised that flake8 doesn't automatically skip build?

I'm more surprised that there isn't a good solution to getting rid of the build directory after build. It doesn't make sense to me that build has to be excluded on a tool-by-tool basis, instead of finding a way that pip and the build backend can work together on this to clean up the build directory.