|
21 | 21 | "replace the latest binary in the S3 location. Note that"
|
22 | 22 | "this also requires you to pass --upload",
|
23 | 23 | )
|
| 24 | +parser.add_argument("--s3-prefix", default="s3://tornasole-bugbash-1113/binaries") |
24 | 25 | args = parser.parse_args()
|
25 | 26 | exec(open("smdebug/_version.py").read())
|
26 | 27 |
|
|
30 | 31 | for b in BINARIES:
|
31 | 32 | if b == "rules":
|
32 | 33 | env_var = "ONLY_RULES"
|
| 34 | + path = "smdebug" |
33 | 35 | else:
|
34 | 36 | env_var = "SMDEBUG_WITH_" + b.upper()
|
| 37 | + path = f"smdebug_{b}" |
35 | 38 | env = dict(os.environ)
|
36 | 39 | env[env_var] = "1"
|
37 | 40 | subprocess.check_call([sys.executable, "setup.py", "bdist_wheel", "--universal"], env=env)
|
|
42 | 45 | "s3",
|
43 | 46 | "cp",
|
44 | 47 | "dist/smdebug-{}-py2.py3-none-any.whl".format(VERSION),
|
45 |
| - "s3://tornasole-bugbash-1113/binaries/smdebug_{}/".format(b), |
| 48 | + os.path.join(args.s3_prefix, path, ""), |
46 | 49 | ]
|
47 | 50 | )
|
48 | 51 |
|
|
53 | 56 | "aws",
|
54 | 57 | "s3",
|
55 | 58 | "cp",
|
56 |
| - "s3://tornasole-bugbash-1113/binaries/smdebug_{}/smdebug-{}-py2.py3-none-any.whl".format( |
57 |
| - b, VERSION |
58 |
| - ), |
59 |
| - "s3://tornasole-bugbash-1113/binaries/smdebug_{}/latest/".format(b), |
| 59 | + os.path.join(args.s3_prefix, path, f"smdebug-{VERSION}-py2.py3-none-any.whl"), |
| 60 | + os.path.join(args.s3_prefix, path, "latest", ""), |
60 | 61 | ]
|
61 | 62 | )
|
62 | 63 | # remove other versions
|
|
67 | 68 | "rm",
|
68 | 69 | "--recursive",
|
69 | 70 | "--exclude",
|
70 |
| - "smdebug-{}*".format(VERSION), |
71 |
| - "s3://tornasole-bugbash-1113/binaries/smdebug_{}/latest/".format(b), |
| 71 | + f"smdebug-{VERSION}*", |
| 72 | + os.path.join(args.s3_prefix, path, "latest"), |
72 | 73 | ]
|
73 | 74 | )
|
74 | 75 | subprocess.check_call(["rm", "-rf", "dist", "build", "*.egg-info", ".eggs"])
|
0 commit comments