def with_setup_command(root, *args, **kwds):
 def generator(func):
  @wraps(func)
  def deco(*args2, **kwargs2):
   tempdir = path(tempfile.mkdtemp())
   pkgrootdir = (tempdir / 'root')
   root.copytree(pkgrootdir)
   cwd = os.getcwd()
   os.chdir(pkgrootdir)
   command = [sys.executable, 'setup.py', 'build_sphinx']
   command.extend(args)
   try:
    proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    func(pkgrootdir, proc, *args, **kwds)
   finally:
    tempdir.rmtree()
    os.chdir(cwd)
  return deco
 return generator

def with_setup_command ( root , * args , ** kwds ) : def generator ( func ) : @ wraps ( func ) def deco ( * args2 , ** kwargs2 ) : tempdir = path ( tempfile . mkdtemp ( ) ) pkgrootdir = ( tempdir / 'root' ) root . copytree ( pkgrootdir ) cwd = os . getcwd ( ) os . chdir ( pkgrootdir ) command = [ sys . executable , 'setup.py' , 'build_sphinx' ] command . extend ( args ) try : proc = subprocess . Popen ( command , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) func ( pkgrootdir , proc , * args , ** kwds ) finally : tempdir . rmtree ( ) os . chdir ( cwd ) return deco return generator
run setup .