summaryrefslogtreecommitdiff
path: root/lib/spack/docs/conf.py
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-05-10 10:01:55 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-05-18 16:06:21 -0700
commit6b2c49648a7ad53022a0d83dcb043399d7041027 (patch)
treecec7714aff83866db6822b02799fc5e54d8b90b6 /lib/spack/docs/conf.py
parentf2eb71ca2086a77a2ebd8d08afb564991ef00b43 (diff)
downloadspack-6b2c49648a7ad53022a0d83dcb043399d7041027.tar.gz
spack-6b2c49648a7ad53022a0d83dcb043399d7041027.tar.bz2
spack-6b2c49648a7ad53022a0d83dcb043399d7041027.tar.xz
spack-6b2c49648a7ad53022a0d83dcb043399d7041027.zip
init: move symbols in `spack` to `spack.pkgkit`
- Spack packages were originally expected to call `from spack import *` themselves, but it has become difficult to manage imports in the Spack core. - the top-level namespace polluted by package symbols, and it's not possible to avoid circular dependencies and unnecessary module loads in the core, given all the stuff the packages need. - This makes the top-level `spack` package essentially empty, save for a version tuple and a version string, and `from spack import *` is now essentially a no-op. - The common routines and directives that packages need are now in `spack.pkgkit`, and the import system forces packages to automatically include this so that old packages that call `from spack import *` will continue to work without modification. - Since `from spack import *` is no longer required, we could consider removing ``from spack import *`` from packages in the future and shifting to ``from spack.pkgkit import *``, but we can wait a while to do this.
Diffstat (limited to 'lib/spack/docs/conf.py')
-rw-r--r--lib/spack/docs/conf.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py
index 0b664eb5c0..f543346809 100644
--- a/lib/spack/docs/conf.py
+++ b/lib/spack/docs/conf.py
@@ -111,28 +111,6 @@ apidoc_args = [
sphinx_apidoc(apidoc_args + ['../spack'])
sphinx_apidoc(apidoc_args + ['../llnl'])
-#
-# Exclude everything in spack.__all__ from indexing. All of these
-# symbols are imported from elsewhere in spack; their inclusion in
-# __all__ simply allows package authors to use `from spack import *`.
-# Excluding them ensures they're only documented in their "real" module.
-#
-# This also avoids issues where some of these symbols shadow core spack
-# modules. Sphinx will complain about duplicate docs when this happens.
-#
-import fileinput
-handling_spack = False
-for line in fileinput.input('spack.rst', inplace=1):
- if handling_spack:
- if not line.startswith(' :noindex:'):
- print(' :noindex: %s' % ' '.join(spack.__all__))
- handling_spack = False
-
- if line.startswith('.. automodule::'):
- handling_spack = (line == '.. automodule:: spack\n')
-
- sys.stdout.write(line)
-
# Enable todo items
todo_include_todos = True