boilerplate

boilerplate

nothing special here, only some of my boilerplates

Hit ‘?’ to see keyboard shortcuts

boilerplate@GitHub

contributed by return42

Intro

In my projects I like to run tests and build processes from make. The boilerplate code here is for common build purpose and heavily based on:

add boilerplate to your project

copy ./utils folder to your repository and add some includes to your ./Makefile (python projects see Makefile.python_prj)

# -*- coding: utf-8; mode: makefile-gmake -*-

include utils/makefile.include
include utils/makefile.python
include utils/makefile.sphinx
include utils/makefile.0

In your repository add developer’s requirements.txt

Sphinx
sphinx_rtd_theme
sphinx-autobuild
pip
git+https://github.com/return42/sphinxjp.themes.revealjs

common make options

$ make make-help
  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose
  make V=2   [targets] 2 => give reason for rebuild of target

add doc targets to Makefile (1)

Use definitions from makefile.sphinx to define your doc targets.

help:
    @echo  '  docs      - build documentation'
    @echo  '  docs-live - autobuild HTML doc while editing'
    @$(MAKE) -s -f utils/makefile.include make-help
    @$(MAKE) -s -f utils/makefile.sphinx docs-help

docs: sphinx-doc
    $(call cmd,sphinx,html,docs,docs)

docs-live: sphinx-live
    $(call cmd,sphinx_autobuild,html,docs,docs)

builds (Sphinx) documentation from folder docs.

add doc targets to Makefile (2)

build (reveal.js) presentation from folder docs/slides.

slides:  sphinx-doc
        $(call cmd,sphinx,html,docs/slides,docs/slides,slides)

help:
        @echo  '  slides - build reveal.js slide presentation'

.PHONY: slides help

in your requirements.txt use my more up-to-date fork

git+https://github.com/return42/sphinxjp.themes.revealjs

use predefined python targets (1)

help:
  @echo  '  install   - developer install'
  @echo  '  uninstall - developer uninstall'
  @echo  ''
  @$(MAKE) -s -f utils/makefile.python python-help

install: pyinstall

uninstall: pyuninstall

use predefined python targets (2)

$ make help
  install   - developer install
  uninstall - developer uninstall

makefile.python:
  pylint        - run pylint *linting*
  pytest        - run *tox* test on python objects
  pydebug       - run tests within a PDB debug session
  pybuild       - build python packages
  pyclean       - clean intermediate python objects
  py[un]install - [un]install python objects in editable mode
  upload-pypi   - upload py_dist/* files to PyPi
options:
  make PY=2  [targets] => to eval targets with python 2 (3)
  make PIP_INST=       => to set/unset pip install options (--user)
  make TEST=.          => choose test from ./tests (default "." runs all)
  make DEBUG=          => target "debug": do not invoke PDB on errors
when using target "pydebug", set breakpoints within py-source by adding::
    ...
    DEBUG()
    ...

About this presentation

This is a small REVAL.JS presentation. The source format of it’s content is in reST-markup.

The HTML is build by the Sphinx-doc extension sphinxjp.themes.revealjs.

Hit s on your keyboard to see the speaker notes.

Thanks!

more slides comming soon ...