in tools/release/release.py [0:0]
def main(cfg: Config) -> None:
hydra_root = find_parent_dir_containing(target="ATTRIBUTION")
build_dir = f"{os.getcwd()}/{cfg.build_dir}"
Path(build_dir).mkdir(parents=True)
log.info(f"Build outputs : {build_dir}")
if cfg.action == Action.check:
log.info("Checking for unpublished packages")
for package in cfg.packages.values():
pkg_path = os.path.normpath(os.path.join(hydra_root, package.path))
ret = get_package_info(pkg_path)
if ret.local_version == ret.latest_version:
log.info(f"\U0000274a : {ret.name} : match ({ret.latest_version})")
elif ret.local_version > ret.latest_version:
log.info(
f"\U0000274b : {ret.name} : newer (local={ret.local_version} > latest={ret.latest_version})"
)
else:
log.info(
f"\U0000274c : {ret.name} : older (local={ret.local_version} < latest={ret.latest_version})"
)
elif cfg.action == Action.build:
log.info("Building unpublished packages")
for package in cfg.packages.values():
pkg_path = os.path.normpath(os.path.join(hydra_root, package.path))
ret = get_package_info(pkg_path)
if ret.local_version > ret.latest_version:
build_package(cfg, pkg_path, build_dir)
elif cfg.action == Action.bump:
log.info("Bumping version of published packages")
for package in cfg.packages.values():
pkg_path = os.path.normpath(os.path.join(hydra_root, package.path))
ret = get_package_info(pkg_path)
if ret.local_version == ret.latest_version:
bump_version(cfg, package, hydra_root)
else:
raise ValueError("Unexpected action type")