This script updates all instances of version in the tensorflow directory. Requirements: version: The version tag OR nightly: Create a nightly tag with current date Raises: RuntimeError: If the script is not being run from tf source dir
()
| 263 | |
| 264 | |
| 265 | def main(): |
| 266 | """This script updates all instances of version in the tensorflow directory. |
| 267 | |
| 268 | Requirements: |
| 269 | version: The version tag |
| 270 | OR |
| 271 | nightly: Create a nightly tag with current date |
| 272 | |
| 273 | Raises: |
| 274 | RuntimeError: If the script is not being run from tf source dir |
| 275 | """ |
| 276 | |
| 277 | parser = argparse.ArgumentParser(description="Cherry picking automation.") |
| 278 | |
| 279 | # Arg information |
| 280 | parser.add_argument("--version", |
| 281 | help="<new_major_ver>.<new_minor_ver>.<new_patch_ver>", |
| 282 | default="") |
| 283 | parser.add_argument("--nightly", |
| 284 | help="disable the service provisioning step", |
| 285 | action="store_true") |
| 286 | |
| 287 | args = parser.parse_args() |
| 288 | |
| 289 | check_all_files() |
| 290 | old_version = get_current_semver_version() |
| 291 | |
| 292 | if args.nightly: |
| 293 | if args.version: |
| 294 | new_version = Version.parse_from_string(args.version, NIGHTLY_VERSION) |
| 295 | new_version.set_identifier_string("-dev" + time.strftime("%Y%m%d")) |
| 296 | else: |
| 297 | # Dev minor version is one ahead of official. |
| 298 | nightly_minor_ver = int(old_version.minor) + 1 |
| 299 | new_version = Version(old_version.major, |
| 300 | str(nightly_minor_ver), |
| 301 | old_version.patch, |
| 302 | "-dev" + time.strftime("%Y%m%d"), |
| 303 | NIGHTLY_VERSION) |
| 304 | else: |
| 305 | new_version = Version.parse_from_string(args.version, REGULAR_VERSION) |
| 306 | |
| 307 | update_version_h(old_version, new_version) |
| 308 | update_setup_dot_py(old_version, new_version) |
| 309 | update_readme(old_version, new_version) |
| 310 | update_tensorflow_bzl(old_version, new_version) |
| 311 | |
| 312 | # Print transition details. |
| 313 | print("Major: %s -> %s" % (old_version.major, new_version.major)) |
| 314 | print("Minor: %s -> %s" % (old_version.minor, new_version.minor)) |
| 315 | print("Patch: %s -> %s\n" % (old_version.patch, new_version.patch)) |
| 316 | |
| 317 | check_for_old_version(old_version, new_version) |
| 318 | |
| 319 | |
| 320 | if __name__ == "__main__": |
no test coverage detected