-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpick_release_name.py
776 lines (761 loc) · 15 KB
/
pick_release_name.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
#!/usr/bin/env python3
# ruff: noqa: S311
import subprocess
from functools import cache
from pathlib import Path
from random import Random
UNIQUE_ITEM_NAMES = [
"9-Volt",
"AAA",
"ASMD",
"AUTOMAGIC.exe",
"Acid Burn",
"Afterburner",
"Agonizer 1500",
"Alchemist",
"All-in",
"Amalgam",
"Amazing Grace",
"Amber Management",
"Anarchy",
"Anchor",
"Ancient Deity",
"Antifreeze",
"Antique Greatbow",
"Apex",
"Arcane Bolt",
"Armor That Sucks",
"Asclepius",
"Ashen Beast",
"Atlas Replay",
"AutoAimè",
"Baby Maker",
"Back Ham",
"Backburner",
"Bad Egg",
"Band of Sitorak",
"Bangarang",
"Banshee Claw",
"Barboload",
"Barrage",
"Barrelmaker",
"Beacon",
"Bear Trooper",
"Bearcat",
"Bekah",
"Beskar",
"Big Boom Blaster",
"Binary Operator",
"Bird of Prey",
"Birthright",
"Bitch",
"Black Flame",
"Black Hole",
"Blade Fury",
"Blank Slate",
"Blast Master",
"Blaze Of Glory",
"Blazing Volley",
"Blind Bandit",
"Blind Sage",
"Blood-Starved Beast",
"Bloodletter",
"Bloom",
"Blue Cake",
"Body Rune",
"Body Spray",
"Boltlash",
"Bone Shredder",
"Boniface's Soul",
"Boogeyman",
"Boomer",
"Borea's Breath",
"Bounty Hunter",
"Brad Luck",
"Bradluck",
"Brainstormer",
"Brashi's Dedication",
"Breaker",
"Breath of the Dying",
"Breeder",
"Brightside",
"Bronco Buster",
"Brutal Stampede",
"Bubble Blaster",
"Buffmeister",
"Burning Summit",
"Butterboom",
"Buttplug",
"Calamity",
"Cannonballer",
"Cape of Tides",
"Carrier",
"Carrouser",
"Catatumbo",
"Championship Ring",
"Chandelier",
"Cheap Tips",
"Cheddar Shredder",
"Chocolate Thunder",
"Chomper",
"Chupa's Organ",
"Circuitous Gyre",
"Clairvoyance",
"Class Ring",
"Claw",
"Cloud Kill",
"Cmdl3t",
"Cocky Bastard",
"Cold Shoulder",
"Cold Warrior",
"Commander Planetoid",
"Company Man",
"Complex Root",
"Conductor",
"Conference Call",
"Contained Blast",
"Convergence",
"Core Buster",
"Corrupted Platemail",
"Cosmic Crater",
"Cosmic Stalker",
"Counterfeint",
"Crader's EM-P5",
"Craps",
"Creamer",
"Creeping Corruption",
"Creeping Death",
"Crit",
"Critical Mass",
"Critical Thug",
"Crossblade",
"Crossbolt Generator",
"Crossroad",
"Crying Apple",
"Curse of Malice",
"Cursed Wit",
"Cutsman",
"D.N.A.",
"DE4DEYE",
"Daemon Blight",
"Dakota",
"Damned",
"Dark Army",
"Dazzler",
"Dead Chamber",
"Death's Blessings",
"Deathless",
"Deathless Mantle",
"Deathrattle",
"Deluxe Badass Combustor",
"Destructo Spinner",
"Devastator",
"Devils Foursum",
"Devoted",
"Diamond Butt Bomb",
"Diamond Gauntlets",
"Diamondguard Sword",
"Die-Vergent",
"Digby's Smooth Tube",
"Doc Hina's Miracle Bomb",
"Donkey",
"Double Downer",
"Dowsing Rod",
"Dragon",
"Dreadlord's Finest",
"Driftwood",
"Dry'l's Fury",
"Dry'l's Legacy",
"Dusa's Visage",
"Dynamo",
"E-Gone",
"ECHO-2",
"EMP",
"Earworm",
"Echo",
"Echoing Phoenix",
"Eight Piece",
"Elder Wyvern's Ring",
"Electric Banjo",
"Elementalist",
"Ember's Blaze",
"Ember's Purge",
"Embrace the Pain",
"Envy",
"Epicenter",
"Eridian Fabricator",
"Eternal Flame",
"Executor",
"Exterminator",
"Extreme Hangin' Chadd",
"Face-puncher",
"Faisor",
"Fastball",
"Fatebreaker",
"Faulty Star",
"Fealty Oath",
"Fearmonger",
"Finger Ward",
"Fingerbiter",
"Fingertip Pulse Oximeter",
"Firecracker",
"Firefly",
"Firestorm",
"Firewall",
"Fish Slap",
"Flakker",
"Flama Diddle",
"Flare",
"Flipper",
"Fragment Rain",
"Free Radical",
"Freeman",
"Frenzied Wrath",
"Frequency",
"Friend-Bot",
"Front Loader",
"Frostbite",
"Frostburn",
"Frozen Devil",
"Frozen Heart",
"Frozen Orb",
"Frying Pan",
"Full Battery",
"Fungus Among Us",
"Gargoyle",
"Garlic Breath",
"Gas Mask",
"Gatling Gun",
"Gelatinous Cube",
"Gettleburger",
"Ghast Call",
"Girth Blaster Elite",
"Glacial Cascade",
"Globetrottr",
"Gluttony",
"Goblin Pickaxe",
"Goblin Repellant",
"Goblin's Bane",
"Gold Rush",
"Golden Rule",
"Golden Touch",
"Good Juju",
"Grave",
"Grease Trap",
"Great Wake",
"Greatest Spell Ever",
"Greed Warden",
"Green Monster",
"Guardian 4N631",
"Guilty Spark",
"Gunerang",
"HOT Spring",
"Hail",
"Hammer and Anvil",
"Hand of Glory",
"Handsome Jackhammer",
"Harbinger",
"Harmonious Dingledangle",
"Hawkins' Wrath",
"Head of the Snake",
"Headcanon",
"Headsplosion",
"Heart Breaker",
"Heat Exchanger",
"Heckwader",
"Hellfire",
"Hellshock",
"Hellwalker",
"Hex",
"High Tolerance",
"Hive",
"Holey Spell-nade",
"Holy Grail",
"Hornet",
"Hot Drop",
"Hotfoot Teddy",
"Hunter-Seeker",
"Hustler",
"Hydrafrost",
"Hyper-Hydrator",
"Hyperfocus XZ41",
"ION CANNON",
"ION LASER",
"Icebreaker",
"Iceburger",
"Impaler",
"Infernal Wish",
"Infiltrator",
"Infinity",
"Inflammation",
"Initiative",
"Insider",
"Insight Ring",
"Ionic Disruptor",
"Ironsides",
"It's Piss",
"Jericho",
"Joint Training",
"Juliet's Dazzle",
"Just Kaus",
"Kaleidoscope",
"Kao Khan",
"Kaos",
"Kaoson",
"Kensei",
"Kenulox",
"Kevin's Chilly",
"Kickcharger",
"Kill-o'-the-Wisp",
"Kinetic Friction",
"King's Call",
"Krakatoa",
"Kyb's Worth",
"L0V3M4CH1N3",
"La Varlope",
"Laser-Sploder",
"Laserhand",
"Last Gasp",
"Last Rites",
"Launch Pad",
"LeChance's Last Leg",
"Lead Sprinkler",
"Lethal Catch",
"Lich's Augur",
"Light Show",
"Lightspeed",
"Likable Rascal",
"Lil K's Bread Slicer",
"Limit Break",
"Linc",
"Linoge",
"Liquid Cooling",
"Little Yeeti",
"Live Wire",
"Loaded Dice",
"Long Musket",
"Loop of 4N631",
"Lovable Rogue",
"Love Drill",
"Love Leopard",
"Lovestruck Beau",
"Lucian's Call",
"Lucky 7",
"Lunacy",
"Lyuda",
"MSRC Auto-Dispensary",
"Maced Wardu",
"Madcap",
"Mage Staff",
"Maggie",
"Magnificent",
"Major Kong",
"Malak's Bane",
"Mana Well",
"Manual Transmission",
"Marshmallow",
"Master Rune",
"Masterwork Crossbow",
"Masterwork Handbow",
"Mechanic",
"Melt Facer",
"Mendel's Multivitamin",
"Merlin's Razor",
"Mesmer",
"Message",
"Messy Breakup",
"Metal Lute",
"Miasmic Mail",
"Mind Rune",
"Mind Sweeper",
"Mind-Killer",
"Minor Kong",
"Miscreant",
"Mistrial",
"Moleman",
"Mongol",
"Monocle",
"Mood Ring",
"Moonfire",
"Mosquito's Mantle",
"Mother Too",
"Moxxi's Bouncing Pair",
"Moxxi's Embrace",
"Moxxi's Endowment",
"Mr Caffeine",
"Multi-tap",
"Muse",
"Mutant",
"Mysterious Artifact",
"NOG Potion #9",
"Nagata",
"Narp",
"Needle Gun",
"Negotiator",
"Nemesis",
"Night Flyer",
"Night Hawkin",
"Nimble Jack",
"Nimbus",
"NoPewPew",
"Nothingness",
"Nova Berner",
"Nukem",
"Null Pointer",
"O.P.Q. System",
"Occultist",
"Ogre",
"Oil and Spice",
"Old God",
"Oldridian",
"Omniloader",
"One Pump Chump",
"Otto Idol",
"Overflow Bloodbag",
"P.A.T. Mk. II",
"P.A.T. Mk. III",
"Pa's Rifle",
"Pain is Power",
"Paladin's Sword",
"Pandemecium",
"Peacemonger",
"Peashooter",
"Peg Leg",
"Perceiver",
"Peregrine",
"Pestilence",
"Petty Tantrum",
"Phasezerker",
"Phebert",
"Phoenix Tears",
"Pincushion",
"Plaguebearer",
"Plasma Coil",
"Plumage",
"Plus Ultra",
"Polyaimourous",
"Polybius",
"Pookie's Chew Toy",
"Porcelain Pipe Bomb",
"Porta-Pooper 5000",
"Portable Sawmill",
"Precious Jamstone",
"Predatory Lending",
"Pricker",
"Projectile Recursion",
"Promise Ring",
"Prompt Critical",
"Proprietary License",
"Psycho Stabber",
"Pull Out Method",
"Pyroburst",
"Quad Bow",
"Quadomizer",
"Quasar",
"Queen's Call",
"Queen's Cry",
"Quickdraw",
"R.Y.N.A.H.",
"R4kk P4k",
"Rage Handle",
"Raging Bear",
"Ragnarok",
"Rainbolt",
"Rakk Commander",
"Re-Charge Berner",
"Re-Charger",
"Re-Router",
"Re-Volter",
"Rebel Yell",
"Rebound",
"Rectifier",
"Red Card",
"Red Card Re-Charger",
"Red Fang",
"Red Hellion",
"Red Queen",
"Red Suit",
"Redeye Rocket Pod",
"Redistributor",
"Redline",
"Reflux",
"Reign of Arrows",
"Res",
"Reunion",
"Revengenader",
"Reviver",
"Rico",
"Ringer",
"Ripper",
"Rivote's Amulet",
"Rivote's Shield",
"Road Warrior",
"Robin's Call",
"Robo-Melter",
"Rocket Boots",
"Rocketeer",
"Rogue Imp",
"Rogue-Sight",
"Roisen's Thorns",
"Roll Reversal",
"Rough Rider",
"Rowan's Call",
"Ruby's Spite",
"Ruby's Wrath",
"S3RV-80S-EXECUTE",
"SF Force",
"Sacrificial Lamb",
"Sacrificial Skeep",
"Safegaurd",
"Salt and Battery",
"Sand Hawk",
"Sapper",
"Satisfaction",
"Sawbar",
"Sawblades",
"Sawpenny",
"Scorpio",
"Scourge",
"Scoville",
"Scream of Terror",
"Seein' Dead",
"Seeryul Killur",
"Selective Amnesia",
"Sellout",
"Septimator",
"Septimator Prime",
"Seventh Sense",
"Shadowfire",
"Shamwai",
"Sharklescent Ring",
"Sharksbane",
"Shell Casing Ring",
"Shlooter",
"Shocker",
"Shockerator",
"Shooting Star",
"Short Stick",
"Shredifier",
"Shrieking Devil",
"Sickle",
"Sidewinder",
"Silicone Ring",
"Skeep Prod",
"SkekSil",
"Skullantir",
"Skullmasher",
"Slammin' Salmon",
"Sledge's Shotgun",
"Sleeping Giant",
"Slip 'n' Stun",
"Slow Hand",
"Sly Trivern",
"Smart Armor",
"Smart-Gun",
"Smithy's Ire",
"Smog",
"Snake Stick",
"Snowshoe",
"Soleki Protocol",
"Soulrender",
"Spade",
"Spellblade",
"Spirit Rune",
"Spiritual Driver",
"Splatter Gun",
"Splinter",
"Spy",
"St4ckbot",
"Stab-O-Matic",
"Stalker",
"Star Helix",
"Starkiller",
"Static Charge",
"Stauros' Burn",
"Steel Gauntlets",
"Stinger",
"Stone",
"Stonethrower",
"Stop-Gap",
"Storm",
"Storm Front",
"Storm Surge",
"Super Soldier",
"Superball",
"Superstreamer",
"Surge",
"Sweet Dreams",
"Sworderang",
"Swordsplosion",
"T.K's Wave",
"THE TWO TIME",
"TNTina",
"Tankman's Shield",
"Techspert",
"Ten Gallon",
"The Beast",
"The Big Succ",
"The Blanc",
"The Boo",
"The Boring Gun",
"The Butcher",
"The Chalice",
"The Companion",
"The Cure",
"The Dictator",
"The Duc",
"The Emperor's Condiment",
"The Flood",
"The Garcia",
"The Horizon",
"The Hunt(ed)",
"The Hunt(er)",
"The Hunt(ress)",
"The Ice Queen",
"The Killing Word",
"The Leech",
"The Lob",
"The Monarch",
"The Pearl of Ineffable Knowledge",
"The Protagonizer",
"The Shoddy",
"The Tidal Wave",
"The Transformer",
"Theurge",
"Threads of Fate",
"Throwable Hole",
"Thumb Cuffs",
"Thumper",
"Thunder Anima",
"Thunderball Fists",
"Tidebreaker",
"Tidesorrow",
"Tiggs' Boom",
"Time Skip",
"Tina's Hippity Hopper",
"Tizzy",
"Toboggan",
"Tootherator",
"Torch",
"Torrent",
"Tr4iner",
"Traitor's Death",
"Tran-fusion",
"Transistor",
"Trevonator",
"Trick Mirror",
"Trickshot",
"Troubleshooter",
"Try-Bolt",
"Tsunami",
"Tunguska",
"Twin Soul",
"Twisted Delugeon",
"Twister",
"Tyrant's Truth",
"Ultraball",
"Undead Pact",
"Unforgiven",
"Universal Soldier",
"Unkempt Harold",
"Unleash the Dragon",
"Unpaler",
"Unseen Threat",
"Vanquisher",
"Vault Hero",
"Vendetta",
"Vengeance",
"Version 0.m",
"Vibra-Pulse",
"Victory Rush",
"Void Rift",
"Vorcanar's Cog",
"Vosk's Deathgrip",
"Wagon Wheel",
"Wailing Banshee",
"Ward",
"Warlord",
"Warped Paradigm",
"Wattson",
"Web Slinger",
"Wedding Invitation",
"Westergun",
"Whiskey Tango Foxtrot",
"Whispering Ice",
"White Elephant",
"White Rider",
"Wicked Gossip",
"Widowmaker",
"Wizard's Pipe",
"Woodblocker",
"Yellowcake",
"Zheitsev's Eruption",
]
PREVIOUS_RELEASE_NAMES = [
"Major Kong",
"Rowan's Call",
"Hand of Glory",
"Lethal Catch",
"White Elephant",
"Time Skip",
"Reunion",
"Deathless Mantle",
]
@cache
def get_git_commit_hash(identifier: str = "HEAD") -> str:
"""
Gets the full commit hash of the current git repo.
Args:
identifier: The identifier of the commit to get.
Returns:
The commit hash.
"""
return subprocess.run(
["git", "rev-list", "-1", identifier],
cwd=Path(__file__).parent,
check=True,
stdout=subprocess.PIPE,
encoding="utf8",
).stdout.strip()
def pick_release_name(commit_hash: str, excludes: list[str] = PREVIOUS_RELEASE_NAMES) -> str:
"""
Picks the name to use for a release.
Args:
commit_hash: The commit hash to pick the name of.
excludes: The list of names to exclude.
Returns:
The release name.
"""
# Think it's better to rely on an int than the string's hash method
rng = Random(int(commit_hash, 16))
while (name := rng.choice(UNIQUE_ITEM_NAMES)) in excludes:
pass
return name
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description="Picks the friendly name to use for the current release.",
)
parser.add_argument(
"commit",
nargs="?",
default="HEAD",
help="The commit hash to base the name off of. Defaults to HEAD.",
)
parser.add_argument(
"--exclude",
metavar="NAME",
action="append",
default=[],
help="Excludes a name as if it were used in a previous release.",
)
parser.add_argument(
"--ignore-previous-releases",
action="store_true",
help="Ignores all names which have been used in previous releases.",
)
args = parser.parse_args()
commit_hash = get_git_commit_hash(args.commit)
excludes = [] if args.ignore_previous_releases else PREVIOUS_RELEASE_NAMES
excludes += args.exclude
print(pick_release_name(commit_hash, excludes))