def reserve_name(self): """ Reserve a name on PyPI with template files. Untested. :param generalpackager.Packager self: """ path = Path.get_cache_dir() / "python/pypi_reserve" # type: Path packager = type(self)(self.name, path=path) packager.create_blank_locally(install=False) packager.localrepo.upload() path.delete()
def download(self, path, version=None, overwrite=False): """ Download tar ball to cache, extract it, remove tar ball. Returns target folder tarball is extracted in. """ if version is None: version = self.get_version() path = Path(path) temp = Path.get_cache_dir() / "Python/temp.tar.gz" download(self.get_tarball_url(version=version), path=temp) temp.unpack(base=path, overwrite=overwrite) temp.delete(error=False) return path / f"{self.name}-{version}"
def _compare_local(self, platform, aesthetic): """ :param generalpackager.Packager self: """ unpack_target = Path.get_cache_dir() / "Python" package_path = platform.download(path=unpack_target, overwrite=True) filt = lambda path: not path.match(*self.git_exclude_lines) differing_files = self.path.get_differing_files(target=package_path, filt=filt) return self.filter_relative_filenames(*differing_files, aesthetic=aesthetic)