diff options
author | Todd Gamblin <gamblin2@llnl.gov> | 2021-07-08 15:12:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 22:12:30 +0000 |
commit | 24c01d57cfb99946eff3af7ec62b71ae6ec72ed8 (patch) | |
tree | a9cbe1b7ef49d14c55fada060476b22fa57ef95e /lib/spack/docs/conf.py | |
parent | 620836a80960396487b5eeba41c2a57c0b4674d2 (diff) | |
download | spack-24c01d57cfb99946eff3af7ec62b71ae6ec72ed8.tar.gz spack-24c01d57cfb99946eff3af7ec62b71ae6ec72ed8.tar.bz2 spack-24c01d57cfb99946eff3af7ec62b71ae6ec72ed8.tar.xz spack-24c01d57cfb99946eff3af7ec62b71ae6ec72ed8.zip |
imports: sort imports everywhere in Spack (#24695)
* fix remaining flake8 errors
* imports: sort imports everywhere in Spack
We enabled import order checking in #23947, but fixing things manually drives
people crazy. This used `spack style --fix --all` from #24071 to automatically
sort everything in Spack so PR submitters won't have to deal with it.
This should go in after #24071, as it assumes we're using `isort`, not
`flake8-import-order` to order things. `isort` seems to be more flexible and
allows `llnl` mports to be in their own group before `spack` ones, so this
seems like a good switch.
Diffstat (limited to 'lib/spack/docs/conf.py')
-rw-r--r-- | lib/spack/docs/conf.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 2de12a5a99..38d75747e3 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -17,10 +17,10 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import re import subprocess +import sys from glob import glob from sphinx.ext.apidoc import main as sphinx_apidoc @@ -82,6 +82,8 @@ todo_include_todos = True # Disable duplicate cross-reference warnings. # from sphinx.domains.python import PythonDomain + + class PatchedPythonDomain(PythonDomain): def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): if 'refspecific' in node: @@ -136,6 +138,7 @@ copyright = u'2013-2021, Lawrence Livermore National Laboratory.' # # The short X.Y version. import spack + version = '.'.join(str(s) for s in spack.spack_version_info[:2]) # The full version, including alpha/beta/rc tags. release = spack.spack_version @@ -179,7 +182,8 @@ exclude_patterns = ['_build', '_spack_root', '.spack-env'] # We use our own extension of the default style with a few modifications from pygments.style import Style from pygments.styles.default import DefaultStyle -from pygments.token import Generic, Comment, Text +from pygments.token import Comment, Generic, Text + class SpackStyle(DefaultStyle): styles = DefaultStyle.styles.copy() @@ -188,6 +192,7 @@ class SpackStyle(DefaultStyle): styles[Generic.Prompt] = "bold #346ec9" import pkg_resources + dist = pkg_resources.Distribution(__file__) sys.path.append('.') # make 'conf' module findable ep = pkg_resources.EntryPoint.parse('spack = conf:SpackStyle', dist=dist) |