def pkgfile_from_path(fn): pkgname, version = guess_pkgname_and_version(fn) return PkgFile(root=py.path.local(fn).parts()[1].strpath, fn=fn, pkgname=pkgname, version=version, parsed_version=parse_version(version))
def build_releases(pkg, versions): for x in versions: parsed_version = core.parse_version(x) if parsed_version > pkg.parsed_version: yield core.pkgfile(version=x, parsed_version=parsed_version, pkgname=pkg.pkgname, replaces=pkg)
def test_is_stable_version(version, is_stable): parsed_version = parse_version(version) assert is_stable_version(parsed_version) == is_stable
def pkgfile_from_path(fn): pkgname, version = guess_pkgname_and_version(fn) return pkgfile(root=py.path.local(fn).parts()[1].strpath, fn=fn, pkgname=pkgname, version=version, parsed_version=parse_version(version))