File: artifactname.py

package info (click to toggle)
python-pysam 0.23.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,468 kB
  • sloc: ansic: 158,936; python: 8,604; sh: 338; makefile: 264; perl: 41
file content (25 lines) | stat: -rwxr-xr-x 530 bytes parent folder | download
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
#!/usr/bin/env python3

import os
import re
import sys

pattern = re.compile(r'-cp([^-]*)-cp[^-]*-([^_]*)[0-9_]*_([^.]*)')
vers = set()
plats = set()
arches = set()

for fname in sys.argv[1:]:
    m = pattern.search(fname)
    vers.add(int(m[1]))
    plats.add(m[2])
    arches.add(m[3])

plat = '-'.join(sorted(plats))
arch = '-'.join(sorted(arches))
ver  = '-'.join(map(str, sorted(vers)))

tag = os.environ.get('NAMETAG', 'none')
tag = f'-{tag}' if tag != 'none' else ''

print(f'artifactname=wheels-{plat}-{arch}-{ver}{tag}')