Skip to content

Commit

Permalink
only allow manylinux on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
KumaTea committed Sep 16, 2024
1 parent a3a203c commit 1b7ff3a
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 609 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ please open an issue.
### manylinux

`riscv64` is now supported by `manylinux`.
Since 2024-09 on linux only `manylinux`able wheels will be provided.
Since 2024-09 on linux only `manylinux`able wheels will be provided.
All previous wheels that miss the requirements will be removed.
2 changes: 1 addition & 1 deletion src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'pytorch-riscv64',
]

if os.name == 'nt':
if os.path.isfile('conf.py'):
WORKDIR = '..'
else:
WORKDIR = '.'
Expand Down
6 changes: 5 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from gen_whl import gen_html
from gen_index import gen_index
from col_whl import get_all_repo_data
from tools import get_saved_hash, get_assets
from gen_whl import gen_html, get_local_whl, extend_hash_dict, save_hash


if __name__ == '__main__':
Expand All @@ -10,5 +10,9 @@
hash_dict = get_saved_hash()
wheels = get_assets(hash_dict)

local_whl = get_local_whl()
hash_dict = extend_hash_dict(hash_dict, local_whl)
save_hash(hash_dict)

gen_html(hash_dict)
gen_index(wheels)
41 changes: 41 additions & 0 deletions src/no_many_remover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from col_whl import *


def is_bad_asset(name: str):
return (
name.endswith('.whl') and
'linux' in name and
(
'manylinux' not in name and
'musllinux' not in name
)
)


def del_bad_assets():
releases = [f for f in os.listdir(f'{WORKDIR}\\whl\\data') if '_' in f]

for release in releases:
repo = release.split('_')[0]
tag = release.split('_')[1].replace('.json', '')

with open(f'{WORKDIR}\\whl\\data\\{release}', 'r', encoding='utf-8') as json_file:
assets = json.load(json_file)

print(f'\nChecking {repo} {tag}\n')
pbar = tqdm(assets)
for asset in pbar:
name = asset['name']
if is_bad_asset(name):
# delete bad asset using gh
pbar.set_description(f' Deleting {name}')
subprocess.run(
f'gh release delete-asset --repo KumaTea/{repo} {tag} {name} -y',
shell=True
)


if __name__ == '__main__':
if input('update? (Y/n) ').lower() != 'n':
get_all_repo_data()
del_bad_assets()
Loading

0 comments on commit 1b7ff3a

Please sign in to comment.