def _create_pkg_tarball(tmpdir, pkg_name, version, deps):
tarball_basefilename = pkg_name + '<STR_LIT:->' + version<EOL>pkg_dir = os.path.join(tmpdir, tarball_basefilename)<EOL>os.mkdir(pkg_dir)<EOL>with open(os.path.join(pkg_dir, '<STR_LIT>'), '<STR_LIT>') as setup_py:<EOL><INDENT>setup_py.write('<STR_LIT>')<EOL>setup_py.write('<STR_LIT>' + pkg_name + '<STR_LIT>')<EOL>setup_py.write('<STR_LIT>' + version + '<STR_LIT>')<EOL>setup_py.write('<STR_LIT>' + '<STR_LIT:U+002CU+0020>'.join('<STR_LIT:">' + dep + '<STR_LIT:">' for dep in deps) + '<STR_LIT>')<EOL><DEDENT>tarball_filepath = os.path.join(tmpdir, tarball_basefilename + '<STR_LIT>')<EOL>with tarfile.open(tarball_filepath, '<STR_LIT>') as tar:<EOL><INDENT>tar.add(pkg_dir, arcname=os.path.basename(pkg_dir))<EOL><DEDENT>return tarball_filepath<EOL>
Creates a tarball containing a single valid setup.py file for the (pkg_name, version, deps) provided