spack/.flake8
Tom Scogland 762ba27036
Make GHA tests parallel by using xdist (#32361)
* Add two no-op jobs named "all-prechecks" and "all"

These are a suggestion from @tgamblin, they are stable named markers we
can use from gitlab and possibly for required checks to make CI more
resilient to refactors changing the names of specific checks.

* Enable parallel testing using xdist for unit testing in CI

* Normalize tmp paths to deal with macos

* add -u flag compatibility to spack python

As of now, it is accepted and ignored.  The usage with xdist, where it
is invoked specifically by `python -u spack python` which is then passed
`-u` by xdist is the entire reason for doing this.  It should never be
used without explicitly passing -u to the executing python interpreter.

* use spack python in xdist to support python 2

When running on python2, spack has many import cycles unless started
through main.  To allow that, this uses `spack python` as the
interpreter, leveraging the `-u` support so xdist doesn't error out when
it unconditionally requests unbuffered binary IO.

* Use shutil.move to account for tmpdir being in a separate filesystem sometimes
2022-09-07 20:12:57 +02:00

56 lines
1.4 KiB
INI

# -*- conf -*-
# flake8 settings for Spack.
#
# These exceptions are for Spack core files. We're slightly more lenient
# with packages. See .flake8_packages for that.
#
# This is the only flake8 rule Spack violates somewhat flagrantly
# - E731: do not assign a lambda expression, use a def
#
# This is the only flake8 exception needed when using Black.
# - E203: white space around slice operators can be required, ignore : warn
#
# We still allow these in packages (Would like to get rid of them or rely on mypy
# in the future)
# - F403: from/import * used; unable to detect undefined names
# - F405: undefined name or from *
# - F821: undefined name (needed with from/import *)
#
[flake8]
#ignore = E129,,W503,W504,F999,N801,N813,N814,F403,F405,E203
extend-ignore = E731,E203
max-line-length = 99
# F4: Import
# - F405: `name` may be undefined, or undefined from star imports: `module`
#
# F8: Name
# - F821: undefined name `name`
#
per-file-ignores =
var/spack/repos/*/package.py:F403,F405,F821
*-ci-package.py:F403,F405,F821
# exclude things we usually do not want linting for.
# These still get linted when passed explicitly, as when spack flake8 passes
# them on the command line.
exclude =
.git
etc/
opt/
share/
var/spack/cache/
var/spack/gpg*/
var/spack/junit-report/
var/spack/mock-configs/
lib/spack/external
__pycache__
var
format = spack
[flake8:local-plugins]
report =
spack = flake8_formatter:SpackFormatter
paths =
./share/spack/qa/