def install(self): with TempDir() as tempdir: acc = set() self.gist.download(tempdir, acc) if 'setup.py' not in self.gist.files: logger.fatal('Error: gist must contain at least the `setup.py` file') Installer.from_dir(tempdir, 'gist {0}'.format(self.gist.gist_id))
def _install_package_from_name(package, ignore=False): if os.path.exists(package) and not ignore: path = os.path.abspath(package) logger.info('Installing {0}', path) if os.path.isfile(path): return Installer.from_file(path) elif os.path.isdir(path): if not os.path.exists(os.path.join(path, 'setup.py')): raise PygError('{0} must contain the setup.py file', path) return Installer.from_dir(path) else: raise PygError('Cannot install the package: {0} is neither a file nor a directory', path) if package.startswith(('http://', 'https://')): return Installer.from_url(package) for s in ('git+', 'hg+', 'bzr+', 'svn+'): if package.startswith(s): with TempDir() as tempdir: return vcs(package, tempdir).install() return Installer(package).install()
def install(self): self.retrieve_data() Installer.from_dir(self.dir, self.package_name)