summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2021-07-05 21:43:52 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2022-07-31 13:29:20 -0700
commit67d27841ae796f02bce3efa465d20211f5f3f084 (patch)
tree9c315560e8a1a1edecc15a334a7ed48ae1488398 /var
parentec879240396b457f8bf05361a7d55280e0fa19fb (diff)
downloadspack-67d27841ae796f02bce3efa465d20211f5f3f084.tar.gz
spack-67d27841ae796f02bce3efa465d20211f5f3f084.tar.bz2
spack-67d27841ae796f02bce3efa465d20211f5f3f084.tar.xz
spack-67d27841ae796f02bce3efa465d20211f5f3f084.zip
black: configuration
This adds necessary configuration for flake8 and black to work together. This also sets the line length to 99, per the data here: * https://github.com/spack/spack/pull/24718#issuecomment-876933636 Given the data and the spirit of black's 88-character limit, we set the limit to 99 characters for all of Spack, because: * 99 is one less than 100, a nice round number, and all lines will fit in a 100-character wide terminal (even when the text editor puts a \ at EOL). * 99 is just past the knee the file size curve for packages, and it means that packages remain readable and not significantly longer than they are now. * It doesn't seem to hurt core -- files in core might change length by a few percent but seem like they'll be mostly the same as before -- just a bit more roomy. - [x] set line length to 99 - [x] remove most exceptions from `.flake8` and add the ones black cares about - [x] add `[tool.black]` to `pyproject.toml` - [x] make `black` run if available in `spack style --fix` Co-Authored-By: Tom Scogland <tscogland@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-black/package.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/py-black/package.py b/var/spack/repos/builtin/packages/py-black/package.py
index b679f88065..dd3b1d0b7f 100644
--- a/var/spack/repos/builtin/packages/py-black/package.py
+++ b/var/spack/repos/builtin/packages/py-black/package.py
@@ -21,6 +21,9 @@ class PyBlack(PythonPackage):
version('22.3.0', sha256='35020b8886c022ced9282b51b5a875b6d1ab0c387b31a065b84db7c33085ca79')
version('22.1.0', sha256='a7c0192d35635f6fc1174be575cb7915e92e5dd629ee79fdaf0dcfa41a80afb5')
+ # This is the last v21 release, and it's needed to format for Python 2.7
+ version('21.12b0', sha256='77b80f693a569e2e527958459634f18df9b0ba2625ba4e0c2d5da5be42e6f2b3')
+
variant('d', default=False, description='enable blackd HTTP server')
variant('colorama', default=False, description='enable colorama support')
variant('uvloop', default=False, description='enable uvloop support')
@@ -32,10 +35,14 @@ class PyBlack(PythonPackage):
# setup.py
depends_on('python@3.6.2:', type=('build', 'run'))
+
depends_on('py-click@8:', type=('build', 'run'))
+ # see: https://github.com/psf/black/issues/2964
+ # note that pip doesn't know this constraint.
+ depends_on("py-click@:8.0", when="@:22.2", type=("build", "run"))
+
depends_on('py-platformdirs@2:', type=('build', 'run'))
- depends_on('py-tomli@1.1:', when='@22.3: ^python@:3.10', type=('build', 'run'))
- depends_on('py-tomli@1.1:', when='@22.1', type=('build', 'run'))
+ depends_on('py-tomli@1.1:', when='@21.7:', type=('build', 'run'))
depends_on('py-typed-ast@1.4.2:', when='^python@:3.7', type=('build', 'run'))
depends_on('py-pathspec@0.9:', type=('build', 'run'))
depends_on('py-dataclasses@0.6:', when='^python@:3.6', type=('build', 'run'))