generated from pybind/cmake_example
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce56a67
commit 8d4da65
Showing
4 changed files
with
62 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,50 @@ | ||
import os | ||
import time | ||
|
||
from github import Github | ||
import datetime | ||
|
||
# Authentication is defined via github.Auth | ||
from github import Auth | ||
|
||
# using an access token | ||
auth = Auth.Token("Personal access tokens (classic)") | ||
auth = Auth.Token(os.environ["GITHUB_API_TOKEN"]) | ||
|
||
twomonthsago = datetime.date.today() - datetime.timedelta(days=30) | ||
|
||
# First create a Github instance: | ||
|
||
# Public Web Github | ||
g = Github(auth=auth) | ||
|
||
repo = g.get_repo("makslevental/wheels") | ||
release = repo.get_release(113028511) | ||
assets = release.get_assets() | ||
for ass in assets: | ||
if "18.0.0.20230907" in ass.name: | ||
print(ass.name) | ||
assert ass.delete_asset() | ||
|
||
|
||
repo = g.get_repo("makslevental/mlir-wheels") | ||
release = repo.get_release(111725799) | ||
assets = release.get_assets() | ||
for ass in assets: | ||
if "18.0.0.20230907" in ass.name: | ||
print(ass.name) | ||
assert ass.delete_asset() | ||
n_deleted = 0 | ||
for _ in range(100): | ||
n_deleted = 0 | ||
repo = g.get_repo("makslevental/wheels") | ||
release = repo.get_release(113028511) | ||
assets = release.get_assets() | ||
for ass in assets: | ||
if "35ca6498" in ass.name: | ||
continue | ||
if ass.created_at.date() < twomonthsago: | ||
print(ass.name) | ||
assert ass.delete_asset() | ||
n_deleted += 1 | ||
|
||
repo = g.get_repo("makslevental/mlir-wheels") | ||
release = repo.get_release(111725799) | ||
assets = release.get_assets() | ||
for ass in assets: | ||
if "35ca6498" in ass.name: | ||
continue | ||
if ass.created_at.date() < twomonthsago: | ||
print(ass.name) | ||
assert ass.delete_asset() | ||
n_deleted += 1 | ||
|
||
if n_deleted == 0: | ||
break | ||
time.sleep(5) | ||
|
||
if n_deleted > 0: | ||
raise Exception("missed some") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters