anchor.diff:  if errorlevel 1 exit 1
   
   REM Generate `setup.py` from `pavement.py` definition.
  -"%PYTHON%" -m paver generate_setup
  +python -m paver generate_setup
   if errorlevel 1 exit 1
   
   REM XXX **Workaround** `conda build` runs a copy of `setup.py` named
  
positive.code: REM
  REM We work around this by wrapping the original contents of `setup.py` in an
  REM `if` block to only execute during package installation.
  "%PYTHON%" -c "from __future__ import print_function; input_ = open('setup.py', 'r'); data = input_.read(); input_.close(); output_ = open('setup.py', 'w'); output_.write('\n'.join(['import sys', 'import path_helpers as ph', '''if ph.path(sys.argv[0]).name == 'conda-build-script.py':''', '    sys.argv.pop()', 'else:', '\n'.join([('    ' + d) for d in data.splitlines()])])); output_.close(); print(open('setup.py', 'r').read())"
  if errorlevel 1 exit 1
  
  REM Build Python C-extension
  
negative.code: if errorlevel 1 exit 1
  
  REM Generate Arduino/Python code
  python -m paver create_config
  
  REM REM Build firmware
  pio run
  