Skip to content

Commit 1b7ff3a

Browse files
committed
only allow manylinux on linux
1 parent a3a203c commit 1b7ff3a

File tree

5 files changed

+146
-609
lines changed

5 files changed

+146
-609
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ please open an issue.
5858
### manylinux
5959

6060
`riscv64` is now supported by `manylinux`.
61-
Since 2024-09 on linux only `manylinux`able wheels will be provided.
61+
Since 2024-09 on linux only `manylinux`able wheels will be provided.
62+
All previous wheels that miss the requirements will be removed.

src/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'pytorch-riscv64',
1111
]
1212

13-
if os.name == 'nt':
13+
if os.path.isfile('conf.py'):
1414
WORKDIR = '..'
1515
else:
1616
WORKDIR = '.'

src/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from gen_whl import gen_html
21
from gen_index import gen_index
32
from col_whl import get_all_repo_data
43
from tools import get_saved_hash, get_assets
4+
from gen_whl import gen_html, get_local_whl, extend_hash_dict, save_hash
55

66

77
if __name__ == '__main__':
@@ -10,5 +10,9 @@
1010
hash_dict = get_saved_hash()
1111
wheels = get_assets(hash_dict)
1212

13+
local_whl = get_local_whl()
14+
hash_dict = extend_hash_dict(hash_dict, local_whl)
15+
save_hash(hash_dict)
16+
1317
gen_html(hash_dict)
1418
gen_index(wheels)

src/no_many_remover.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from col_whl import *
2+
3+
4+
def is_bad_asset(name: str):
5+
return (
6+
name.endswith('.whl') and
7+
'linux' in name and
8+
(
9+
'manylinux' not in name and
10+
'musllinux' not in name
11+
)
12+
)
13+
14+
15+
def del_bad_assets():
16+
releases = [f for f in os.listdir(f'{WORKDIR}\\whl\\data') if '_' in f]
17+
18+
for release in releases:
19+
repo = release.split('_')[0]
20+
tag = release.split('_')[1].replace('.json', '')
21+
22+
with open(f'{WORKDIR}\\whl\\data\\{release}', 'r', encoding='utf-8') as json_file:
23+
assets = json.load(json_file)
24+
25+
print(f'\nChecking {repo} {tag}\n')
26+
pbar = tqdm(assets)
27+
for asset in pbar:
28+
name = asset['name']
29+
if is_bad_asset(name):
30+
# delete bad asset using gh
31+
pbar.set_description(f' Deleting {name}')
32+
subprocess.run(
33+
f'gh release delete-asset --repo KumaTea/{repo} {tag} {name} -y',
34+
shell=True
35+
)
36+
37+
38+
if __name__ == '__main__':
39+
if input('update? (Y/n) ').lower() != 'n':
40+
get_all_repo_data()
41+
del_bad_assets()

0 commit comments

Comments
 (0)