def _from_distribution( cls, dist ): # type: (Union[pkginfo.BDist, pkginfo.SDist, pkginfo.Wheel]) -> PackageInfo """ Helper method to parse package information from a `pkginfo.Distribution` instance. :param dist: The distribution instance to parse information from. """ requirements = None if dist.requires_dist: requirements = list(dist.requires_dist) else: requires = Path(dist.filename) / "requires.txt" if requires.exists(): with requires.open(encoding="utf-8") as f: requirements = parse_requires(f.read()) info = cls( name=dist.name, version=dist.version, summary=dist.summary, platform=dist.supported_platforms, requires_dist=requirements, requires_python=dist.requires_python, ) info._source_type = "file" info._source_url = Path(dist.filename).resolve().as_posix() return info
def test_build_wheel_extended(): with temporary_directory() as tmp_dir, cwd( os.path.join(fixtures, "extended")): filename = api.build_wheel(tmp_dir) whl = Path(tmp_dir) / filename assert whl.exists() validate_wheel_contents(name="extended", version="0.1", path=whl.as_posix())
def test_build_wheel_extended(): with temporary_directory() as tmp_dir, cwd( os.path.join(fixtures, "extended")): filename = api.build_wheel(tmp_dir) whl = Path(tmp_dir) / filename assert whl.exists() with zipfile.ZipFile(str(os.path.join(tmp_dir, filename))) as zip: namelist = zip.namelist() assert "extended-0.1.dist-info/RECORD" in namelist assert "extended-0.1.dist-info/WHEEL" in namelist assert "extended-0.1.dist-info/METADATA" in namelist