summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-05-24 20:26:24 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-05-24 20:28:37 +0900
commit25325b0d6f8dc93e2bd40d3f81637c36bf0b3158 (patch)
treed564768ef1a563b10cbc1f4a8a1ca5c39d5b2e0a
parent01fd7dfc0497121ef544fc4c86a7b547260d933e (diff)
downloadbuildstream-25325b0d6f8dc93e2bd40d3f81637c36bf0b3158.tar.gz
Added __init__.py to the plugin subdirectories.
This makes the 'sources' and 'elements' subdirectores modules technically, but it does not effect how we load them with pluginbase, that still works. Updated documentation machinery to have buildstream/plugins in the PYTHONPATH and import the docs as elements.autotools etc. This is all because since recent sphinx started importing from distutils, this was conflicting with our distutils plugin.
-rw-r--r--buildstream/plugins/elements/__init__.py0
-rw-r--r--buildstream/plugins/sources/__init__.py0
-rw-r--r--doc/Makefile24
-rw-r--r--doc/source/index.rst32
-rw-r--r--doc/source/plugin.rsttemplate4
5 files changed, 31 insertions, 29 deletions
diff --git a/buildstream/plugins/elements/__init__.py b/buildstream/plugins/elements/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/buildstream/plugins/elements/__init__.py
diff --git a/buildstream/plugins/sources/__init__.py b/buildstream/plugins/sources/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/buildstream/plugins/sources/__init__.py
diff --git a/doc/Makefile b/doc/Makefile
index 70e0ced95..7d3b3d789 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -48,14 +48,16 @@ all: docs
# from plugin documentation.
#
define plugin-doc-skeleton
- @for file in $$(find ${1} -name "*.py"); do \
- base=$$(basename $$file); \
- modname=$${base%.py}; \
- echo -n "Generating ${2}/$${modname}.rst... "; \
- sed -e "s|@@MODULE@@|$${modname}|g" \
- source/plugin.rsttemplate > \
- ${2}/$${modname}.rst.tmp && \
- mv ${2}/$${modname}.rst.tmp ${2}/$${modname}.rst || exit 1; \
+ @for file in $$(find ${1} -name "*.py"); do \
+ base=$$(basename $$file); \
+ module=${2}.$${base%.py}; \
+ modname=$${base%.py}; \
+ echo -n "Generating source/${2}/$${modname}.rst... "; \
+ sed -e "s|@@MODULENAME@@|$${modname}|g" \
+ -e "s|@@MODULE@@|$${module}|g" \
+ source/plugin.rsttemplate > \
+ source/${2}/$${modname}.rst.tmp && \
+ mv source/${2}/$${modname}.rst.tmp source/${2}/$${modname}.rst || exit 1; \
echo "Done."; \
done
endef
@@ -66,13 +68,13 @@ apidoc:
mkdir -p source/elements
mkdir -p source/sources
sphinx-apidoc --separate -o source $(CURDIR)/../buildstream
- $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/elements,source/elements)
- $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/sources,source/sources)
+ $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/elements,elements)
+ $(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/sources,sources)
# We set PYTHONPATH here because source/conf.py sys.modules hacks dont seem to help sphinx-build import the plugins
.PHONY: docs
docs: apidoc
- PYTHONPATH=$(CURDIR)/../buildstream/plugins/sources:$(CURDIR)/../buildstream/plugins/elements \
+ PYTHONPATH=$(CURDIR)/../buildstream/plugins \
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html \
$(wildcard source/*.rst) \
$(wildcard source/elements/*.rst) \
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 648edd06d..9fbed85d5 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -43,32 +43,32 @@ Elements
General Elements
~~~~~~~~~~~~~~~~
-* :mod:`stack` - Symbolic Element for dependency grouping
-* :mod:`import` - Import sources directly
-* :mod:`compose` - Compose the output of multiple elements
-* :mod:`script` - Run scripts to create output
+* :mod:`stack <elements.stack>` - Symbolic Element for dependency grouping
+* :mod:`import <elements.import>` - Import sources directly
+* :mod:`compose <elements.compose>` - Compose the output of multiple elements
+* :mod:`script <elements.script>` - Run scripts to create output
Build Elements
~~~~~~~~~~~~~~
-* :mod:`manual` - Manual Build Element
-* :mod:`autotools` - Autotools Build Element
-* :mod:`cmake` - CMake Build Element
-* :mod:`qmake` - QMake Build Element
-* :mod:`distutils` - Python Distutils Build Element
-* :mod:`makemaker` - Perl MakeMaker Build Element
-* :mod:`modulebuild` - Perl Module::Build Build Element
-* :mod:`meson` - Meson Build Element
+* :mod:`manual <elements.manual>` - Manual Build Element
+* :mod:`autotools <elements.autotools>` - Autotools Build Element
+* :mod:`cmake <elements.cmake>` - CMake Build Element
+* :mod:`qmake <elements.qmake>` - QMake Build Element
+* :mod:`distutils <elements.distutils>` - Python Distutils Build Element
+* :mod:`makemaker <elements.makemaker>` - Perl MakeMaker Build Element
+* :mod:`modulebuild <elements.modulebuild>` - Perl Module::Build Build Element
+* :mod:`meson <elements.meson>` - Meson Build Element
Sources
--------
The following source types are provided with BuildStream:
-* :mod:`local` - A Source implementation for local files and directories
-* :mod:`tar` - A Source implementation for tarballs
-* :mod:`git` - A Source implementation for git
-* :mod:`ostree` - A Source implementation for ostree
+* :mod:`local <sources.local>` - A Source implementation for local files and directories
+* :mod:`tar <sources.tar>` - A Source implementation for tarballs
+* :mod:`git <sources.git>` - A Source implementation for git
+* :mod:`ostree <sources.ostree>` - A Source implementation for ostree
Core Framework
diff --git a/doc/source/plugin.rsttemplate b/doc/source/plugin.rsttemplate
index f9307fab3..11e090f8b 100644
--- a/doc/source/plugin.rsttemplate
+++ b/doc/source/plugin.rsttemplate
@@ -1,4 +1,4 @@
-@@MODULE@@ plugin
-=======================
+@@MODULENAME@@ plugin
+============================================
.. automodule:: @@MODULE@@