Skip to content

Commit 032e0e9

Browse files
committed
chore: more testing of tooling
1 parent 486ac57 commit 032e0e9

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.github/workflows/cibuildwheel.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ jobs:
4444

4545
- name: Nuclear testing
4646
run: |
47-
echo ${{ github.event_name }}
48-
echo ${{ github.event_name == 'release' }}
49-
echo ${{ github.ref }}
47+
tools/check_dist.py -d dist/ -r ${{ github.ref }} -t ${{ github.event_name }}
5048
python -c '0/0'
5149
5250
build-wheels:

tools/check_dist.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
DIST = HERE.parent / 'dist'
99

1010

11-
def check_dist(dist):
11+
def check_dist(dist, git_ref):
1212
sdist = None
1313
versions = set()
1414
wheels = []
1515

16+
if git_ref:
17+
git_ref = git_ref.split('/')[-1].lower()
18+
1619
for path in dist.iterdir():
1720
if not path.is_file():
1821
continue
@@ -33,6 +36,12 @@ def check_dist(dist):
3336
assert falcon == 'falcon', 'Unexpected package name: {path.name}'
3437
versions.add(version)
3538

39+
if git_ref and version != git_ref:
40+
sys.stderr.write(
41+
f'Unexpected version: {path.name} ({version} != {git_ref})\n'
42+
)
43+
sys.exit(1)
44+
3645
if not versions:
3746
sys.stderr.write('No artifacts collected!\n')
3847
sys.exit(1)
@@ -61,9 +70,20 @@ def main():
6170
default=str(DIST),
6271
help='dist directory to check (default: %(default)s)',
6372
)
73+
parser.add_argument(
74+
'-r',
75+
'--git-ref',
76+
help='git branch/tag ref, only checked for the "release" build type',
77+
)
78+
parser.add_argument(
79+
'-t',
80+
'--build-type',
81+
help='build type, e.g., "release", "tag"',
82+
)
6483

6584
args = parser.parse_args()
66-
check_dist(pathlib.Path(args.dist_dir))
85+
git_ref = args.git_ref if args.build_type == 'release' else None
86+
check_dist(pathlib.Path(args.dist_dir), git_ref)
6787

6888

6989
if __name__ == '__main__':

0 commit comments

Comments
 (0)