File tree Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 3030 run : |
3131 python -m pip install cibuildwheel==1.5.5
3232
33+ - name : Copy setup.cfg to configure wheel
34+ run : |
35+ cp setup.cfg.template setup.cfg
36+
3337 - name : Build wheels for CPython
3438 run : |
3539 python -m cibuildwheel --output-dir dist
6569 startsWith(github.ref, 'refs/heads/v3.3') ||
6670 startsWith(github.ref, 'refs/tags/v3.3') )
6771
72+ - name : Validate that LICENSE files are included in wheels
73+ run : |
74+ python ./ci/check_wheel_licenses.py
75+
6876 - uses : actions/upload-artifact@v2
6977 with :
7078 name : wheels
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ """
4+ Check that all .whl files in the dist folder have the correct LICENSE files
5+ included.
6+
7+ To run:
8+ $ cp setup.cfg.template setup.cfg
9+ $ python3 setup.py bdist_wheel
10+ $ ./ci/check_wheel_licenses.py
11+ """
12+
13+ from pathlib import Path
14+ import sys
15+ import zipfile
16+
17+ EXIT_SUCCESS = 0
18+ EXIT_FAILURE = 1
19+
20+ project_dir = Path (__file__ ).parent .resolve ().parent
21+ dist_dir = project_dir / 'dist'
22+ license_dir = project_dir / 'LICENSE'
23+
24+ license_file_names = [path .name for path in sorted (license_dir .glob ('*' ))]
25+ for wheel in dist_dir .glob ('*.whl' ):
26+ print (f'Checking LICENSE files in: { wheel } ' )
27+ with zipfile .ZipFile (wheel ) as f :
28+ wheel_license_file_names = [Path (path ).name
29+ for path in sorted (f .namelist ())
30+ if '.dist-info/LICENSE' in path ]
31+ if wheel_license_file_names != license_file_names :
32+ print (f'LICENSE file(s) missing:\n '
33+ f'{ wheel_license_file_names } !=\n '
34+ f'{ license_file_names } ' )
35+ sys .exit (EXIT_FAILURE )
36+ sys .exit (EXIT_SUCCESS )
Original file line number Diff line number Diff line change 11# Rename this file to setup.cfg to modify Matplotlib's build options.
22
3+ [metadata]
4+ license_files = LICENSE/*
5+
36[egg_info]
47
58[libs]
You can’t perform that action at this time.
0 commit comments