| 1 |
|
| 2 |
|
| 3 |
import os |
| 4 |
import re |
| 5 |
import sys |
| 6 |
|
| 7 |
pattern = re.compile(r'-cp([^-]*)-cp[^-]*-([^_]*)[0-9_]*_([^.]*)') |
| 8 |
vers = set() |
| 9 |
plats = set() |
| 10 |
arches = set() |
| 11 |
|
| 12 |
for fname in sys.argv[1:]: |
| 13 |
m = pattern.search(fname) |
| 14 |
vers.add(int(m[1])) |
| 15 |
plats.add(m[2]) |
| 16 |
arches.add(m[3]) |
| 17 |
|
| 18 |
plat = '-'.join(sorted(plats)) |
| 19 |
arch = '-'.join(sorted(arches)) |
| 20 |
ver = '-'.join(map(str, sorted(vers))) |
| 21 |
|
| 22 |
tag = os.environ.get('NAMETAG', 'none') |
| 23 |
tag = f'-{tag}' if tag != 'none' else '' |
| 24 |
|
| 25 |
print(f'artifactname=wheels-{plat}-{arch}-{ver}{tag}') |