def build_sdist(py):
 with cd(repo_root):
  cmd = [py, 'setup.py', 'sdist', '--formats=gztar']
  run(cmd)
 return glob.glob(pjoin(repo_root, 'dist', '*.tar.gz'))[0]

def build_sdist ( py ) : with cd ( repo_root ) : cmd = [ py , 'setup.py' , 'sdist' , '--formats=gztar' ] run ( cmd ) return glob . glob ( pjoin ( repo_root , 'dist' , '*.tar.gz' ) ) [ 0 ]
build sdists returns the path to the tarball .