|
30 | 30 |
|
31 | 31 | def get_version():
|
32 | 32 | version_txt = os.path.join(cwd, "version.txt")
|
33 |
| - with open(version_txt, "r") as f: |
| 33 | + with open(version_txt) as f: |
34 | 34 | version = f.readline().strip()
|
35 | 35 | if os.getenv("TORCHRL_BUILD_VERSION"):
|
36 | 36 | version = os.getenv("TORCHRL_BUILD_VERSION")
|
@@ -64,8 +64,8 @@ def parse_args(argv: List[str]) -> argparse.Namespace:
|
64 | 64 | def write_version_file(version):
|
65 | 65 | version_path = os.path.join(cwd, "torchrl", "version.py")
|
66 | 66 | with open(version_path, "w") as f:
|
67 |
| - f.write("__version__ = '{}'\n".format(version)) |
68 |
| - f.write("git_version = {}\n".format(repr(sha))) |
| 67 | + f.write(f"__version__ = '{version}'\n") |
| 68 | + f.write(f"git_version = {repr(sha)}\n") |
69 | 69 |
|
70 | 70 |
|
71 | 71 | def _get_pytorch_version(is_nightly, is_local):
|
@@ -185,7 +185,7 @@ def _main(argv):
|
185 | 185 | version = get_version()
|
186 | 186 | write_version_file(version)
|
187 | 187 | TORCHRL_BUILD_VERSION = os.getenv("TORCHRL_BUILD_VERSION")
|
188 |
| - logging.info("Building wheel {}-{}".format(package_name, version)) |
| 188 | + logging.info(f"Building wheel {package_name}-{version}") |
189 | 189 | logging.info(f"TORCHRL_BUILD_VERSION is {TORCHRL_BUILD_VERSION}")
|
190 | 190 |
|
191 | 191 | is_local = TORCHRL_BUILD_VERSION is None
|
|
0 commit comments