bump_patch_version.py 689 B

12345678910111213141516171819202122
  1. # Copyright (c) Microsoft Corporation.
  2. # SPDX-License-Identifier: Apache-2.0
  3. # DeepSpeed Team
  4. import argparse
  5. from packaging import version as pkg_version
  6. parser = argparse.ArgumentParser()
  7. parser.add_argument("--current_version",
  8. type=str,
  9. help="The current version being published to help set the next version.")
  10. args = parser.parse_args()
  11. current_version = pkg_version.parse(args.current_version)
  12. with open('./version.txt', 'w') as fd:
  13. fd.write(f'{current_version.major}.{current_version.minor}.{current_version.micro + 1}\n')
  14. print(f'{current_version} -> {current_version.major}.{current_version.minor}.{current_version.micro + 1}')