def make_all_sphinx(sphinx): m.section_break("sphinx related variables", block="header") m.var(variable="SPHINXOPTS", value="-c ./", block="vars") m.var(variable="SPHINXBUILD", value="sphinx-build", block="vars") m.comment("defines a nitpick mode for sphinx's more verbose reporting", block="vars") m.raw(["ifdef NITPICK"], block="vars") m.append_var( variable="SPHINXOPTS", value="-n -w $(branch-output)/build.$(shell date +%Y%m%d%H%M).log", block="vars" ) m.raw(["endif"], block="vars") m.comment("variables related to paper sizing for the latex output", block="vars") m.var(variable="PAPER", value="letter", block="vars") m.var(variable="PAPEROPT_a4", value="-D latex_paper_size=a4", block="vars") m.var(variable="PAPEROPT_letter", value="-D latex_paper_size=letter", block="vars") m.comment("general sphinx variables", block="vars") m.var( variable="ALLSPHINXOPTS", value="-q -d $(branch-output)/doctrees-$@ $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(branch-output)/source", block="vars", ) m.comment("epub build modification and settings", block="vars") m.var(variable="epub-command", value="$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(branch-output)/epub", block="vars") m.var( variable="epub-filter", value="sed $(SED_ARGS_REGEX) -e '/^WARNING: unknown mimetype.*ignoring$$/d' -e '/^WARNING: search index.*incomplete.$$/d'", block="vars", ) m.section_break("sphinx prerequisites") m.target("sphinx-prerequisites", "setup generate-source composite-pages.yaml", block="prereq") m.msg("[sphinx-prep]: completed $@ buildstep.", block="prereq") m.target( "generate-source", "$(branch-output)/source tables installation-guides intersphinx generate-manpages", block="prereq", ) m.job("rsync --recursive --times --delete source/ $(branch-output)/source", block="prereq") m.msg("[sphinx-prep]: updated source in $(branch-output)/source", block="prereq") info_note = "Build in progress past critical phase." m.job(utils.build_platform_notification("Sphinx", info_note), ignore=True, block="prereq") m.msg("[sphinx-prep]: INFO - " + info_note, block="prereq") m.target("$(branch-output)/source", block="prereq") m.job("mkdir -p $@", block="prereq") m.msg("[sphinx-prep]: created $@", block="prereq") m.section_break("sphinx targets", block="sphinx") m.comment("each sphinx target invokes and controls the sphinx build.", block="sphinx") m.newline(block="sphinx") for builder in sphinx: sphinx_builder(builder) m.target(".PHONY", "$(sphinx-targets)", block="footer")
def make_all_sphinx(sphinx): m.section_break('sphinx related variables', block='header') m.comment('variables related to paper sizing for the latex output', block='vars') m.newline() m.var(variable='PAPER', value='letter', block='vars') m.var(variable='PAPEROPT_a4', value='-D latex_paper_size=a4', block='vars') m.var(variable='PAPEROPT_letter', value='-D latex_paper_size=letter', block='vars') m.comment('general sphinx variables', block='vars') m.section_break('sphinx prerequisites') m.newline() m.target('sphinx-prerequisites', 'setup generate-source composite-pages.yaml', block='prereq') m.msg('[sphinx-prep]: completed $@ buildstep.', block='prereq') m.target( 'generate-source', '$(branch-output)/source tables installation-guides intersphinx generate-manpages ref-toc', block='prereq') m.job('rsync --recursive --times --delete source/ $(branch-output)/source', block='prereq') m.msg('[sphinx-prep]: updated source in $(branch-output)/source', block='prereq') info_note = 'Build in progress past critical phase.' m.job(utils.build_platform_notification('Sphinx', info_note), ignore=True, block='prereq') m.msg('[sphinx-prep]: INFO - ' + info_note, block='prereq') m.target('$(branch-output)/source', block='prereq') m.job('mkdir -p $@', block='prereq') m.msg('[sphinx-prep]: created $@', block='prereq') m.section_break('sphinx targets', block='sphinx') m.newline(block='sphinx') for builder in sphinx: sphinx_builder(builder) m.section_break('nitpick sphinx builders') m.newline(block='sphinx') for builder in sphinx: sphinx_builder(builder + '-nitpick') m.target('.PHONY', '$(sphinx-targets)', block='footer')
def make_all_sphinx(sphinx): m.section_break('sphinx related variables', block='header') m.comment('variables related to paper sizing for the latex output', block='vars') m.newline() m.var(variable='PAPER', value='letter', block='vars') m.var(variable='PAPEROPT_a4', value='-D latex_paper_size=a4', block='vars') m.var(variable='PAPEROPT_letter', value='-D latex_paper_size=letter', block='vars') m.comment('general sphinx variables', block='vars') m.section_break('sphinx prerequisites') m.newline() m.target('sphinx-prerequisites', 'setup composites generate-source composite-pages.yaml', block='prereq') m.msg('[sphinx-prep]: completed $@ buildstep.', block='prereq') m.target('generate-source', '$(branch-output)/source tables installation-guides intersphinx generate-manpages ref-toc', block='prereq') m.job('rsync --recursive --times --delete source/ $(branch-output)/source', block='prereq') m.msg('[sphinx-prep]: updated source in $(branch-output)/source', block='prereq') info_note = 'Build in progress past critical phase.' m.job(utils.build_platform_notification('Sphinx', info_note), ignore=True, block='prereq') m.msg('[sphinx-prep]: INFO - ' + info_note, block='prereq') m.target('$(branch-output)/source', block='prereq') m.job('mkdir -p $@', block='prereq') m.msg('[sphinx-prep]: created $@', block='prereq') m.section_break('sphinx targets', block='sphinx') m.newline(block='sphinx') for builder in sphinx: sphinx_builder(builder) m.section_break('nitpick sphinx builders') m.newline(block='sphinx') for builder in sphinx: sphinx_builder(builder + '-nitpick') m.target('.PHONY', '$(sphinx-targets)', block='footer')
def generate_delegated_interface(builders): branches = mongo_meta.PUBLISHED_BRANCHES current_branch = mongo_meta.get_branch() if current_branch not in branches: branches.append(current_branch) builders.append('publish') builders.append('push') builders.append('stage') targets = [] for branch in branches: m.section_break(branch, block=branch) m.newline(block=branch) for target in builders: for sync in [('foreground', '--wait'), ('background', '')]: build_target = 'delegated-%s-%s-%s' % (branch, target, sync[0]) targets.append(build_target) m.target(target=build_target, block=branch) m.job(job=( '$(PYTHONBIN) bin/delegated-build --branch %s --target %s %s' % (branch, target, sync[1])), block=branch) if sync[0] == 'background': m.job(job=utils.build_platform_notification( 'build complete', ' '.join([branch, target])), ignore=True, block=branch) m.newline(block=branch) m.section_break('meta section', block='meta') m.newline() m.target('.PHONY', ' '.join(targets), block='meta')
def generate_delegated_interface(builders): branches = mongo_meta.PUBLISHED_BRANCHES current_branch = mongo_meta.get_branch() if current_branch not in branches: branches.append(current_branch) builders.append('publish') builders.append('push') builders.append('stage') targets = [] for branch in branches: m.section_break(branch, block=branch) m.newline(block=branch) for target in builders: for sync in [ ('foreground', '--wait'), ('background', '') ]: build_target = 'delegated-%s-%s-%s' % ( branch, target, sync[0]) targets.append(build_target) m.target(target=build_target, block=branch) m.job(job=('$(PYTHONBIN) bin/delegated-build --branch %s --target %s %s' % ( branch, target, sync[1])), block=branch) if sync[0] == 'background': m.job(job=utils.build_platform_notification('build complete', ' '.join([branch, target])), ignore=True, block=branch) m.newline(block=branch) m.section_break('meta section', block='meta') m.newline() m.target('.PHONY', ' '.join(targets), block='meta')
def make_all_sphinx(sphinx): m.section_break('sphinx related variables', block='header') m.var(variable='SPHINXOPTS', value='-c ./', block='vars') m.var(variable='SPHINXBUILD', value='sphinx-build', block='vars') m.comment('defines a nitpick mode for sphinx\'s more verbose reporting', block='vars') m.raw(['ifdef NITPICK'], block='vars') m.append_var( variable='SPHINXOPTS', value='-n -w $(branch-output)/build.$(shell date +%Y%m%d%H%M).log', block='vars') m.raw(['endif'], block='vars') m.comment('variables related to paper sizing for the latex output', block='vars') m.var(variable='PAPER', value='letter', block='vars') m.var(variable='PAPEROPT_a4', value='-D latex_paper_size=a4', block='vars') m.var(variable='PAPEROPT_letter', value='-D latex_paper_size=letter', block='vars') m.comment('general sphinx variables', block='vars') m.var( variable='ALLSPHINXOPTS', value= '-q -d $(branch-output)/doctrees-$@ $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(branch-output)/source', block='vars') m.comment('epub build modification and settings', block='vars') m.var( variable='epub-command', value='$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(branch-output)/epub', block='vars') m.var( variable='epub-filter', value= "sed $(SED_ARGS_REGEX) -e '/^WARNING: unknown mimetype.*ignoring$$/d' -e '/^WARNING: search index.*incomplete.$$/d'", block='vars') m.section_break('sphinx prerequisites') m.target('sphinx-prerequisites', 'setup generate-source composite-pages.yaml', block='prereq') m.msg('[sphinx-prep]: completed $@ buildstep.', block='prereq') m.target( 'generate-source', '$(branch-output)/source tables installation-guides intersphinx generate-manpages', block='prereq') m.job('rsync --recursive --times --delete source/ $(branch-output)/source', block='prereq') m.msg('[sphinx-prep]: updated source in $(branch-output)/source', block='prereq') info_note = 'Build in progress past critical phase.' m.job(utils.build_platform_notification('Sphinx', info_note), ignore=True, block='prereq') m.msg('[sphinx-prep]: INFO - ' + info_note, block='prereq') m.target('$(branch-output)/source', block='prereq') m.job('mkdir -p $@', block='prereq') m.msg('[sphinx-prep]: created $@', block='prereq') m.section_break('sphinx targets', block='sphinx') m.comment('each sphinx target invokes and controls the sphinx build.', block='sphinx') m.newline(block='sphinx') for builder in sphinx: sphinx_builder(builder) m.target('.PHONY', '$(sphinx-targets)', block='footer')
def make_all_sphinx(sphinx): m.section_break('sphinx related variables', block='header') m.var(variable='SPHINXOPTS', value='-c ./', block='vars') m.var(variable='SPHINXBUILD', value='sphinx-build', block='vars') m.comment('defines a nitpick mode for sphinx\'s more verbose reporting', block='vars') m.raw(['ifdef NITPICK'], block='vars') m.append_var(variable='SPHINXOPTS', value='-n -w $(branch-output)/build.$(shell date +%Y%m%d%H%M).log', block='vars') m.raw(['endif'], block='vars') m.comment('variables related to paper sizing for the latex output', block='vars') m.var(variable='PAPER', value='letter', block='vars') m.var(variable='PAPEROPT_a4', value='-D latex_paper_size=a4', block='vars') m.var(variable='PAPEROPT_letter', value='-D latex_paper_size=letter', block='vars') m.comment('general sphinx variables', block='vars') m.var(variable='ALLSPHINXOPTS', value='-q -d $(branch-output)/doctrees-$@ $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(branch-output)/source', block='vars') m.comment('epub build modification and settings', block='vars') m.var(variable='epub-command', value='$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(branch-output)/epub', block='vars') m.var(variable='epub-filter', value="sed $(SED_ARGS_REGEX) -e '/^WARNING: unknown mimetype.*ignoring$$/d' -e '/^WARNING: search index.*incomplete.$$/d'", block='vars') m.section_break('sphinx prerequisites') m.target('sphinx-prerequisites', 'setup generate-source composite-pages.yaml', block='prereq') m.msg('[sphinx-prep]: completed $@ buildstep.', block='prereq') m.target('generate-source', '$(branch-output)/source tables installation-guides intersphinx generate-manpages ref-toc', block='prereq') m.job('rsync --recursive --times --delete source/ $(branch-output)/source', block='prereq') m.msg('[sphinx-prep]: updated source in $(branch-output)/source', block='prereq') info_note = 'Build in progress past critical phase.' m.job(utils.build_platform_notification('Sphinx', info_note), ignore=True, block='prereq') m.msg('[sphinx-prep]: INFO - ' + info_note, block='prereq') m.target('$(branch-output)/source', block='prereq') m.job('mkdir -p $@', block='prereq') m.msg('[sphinx-prep]: created $@', block='prereq') m.section_break('sphinx targets', block='sphinx') m.comment('each sphinx target invokes and controls the sphinx build.', block='sphinx') m.newline(block='sphinx') for builder in sphinx: sphinx_builder(builder) m.target('.PHONY', '$(sphinx-targets)', block='footer')