File tree 5 files changed +47
-0
lines changed 5 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 30
30
run : |
31
31
python -m pip install cibuildwheel==1.5.5
32
32
33
+ - name : Copy setup.cfg to configure wheel
34
+ run : |
35
+ cp setup.cfg.template setup.cfg
36
+
33
37
- name : Build wheels for CPython
34
38
run : |
35
39
python -m cibuildwheel --output-dir dist
65
69
startsWith(github.ref, 'refs/heads/v3.3') ||
66
70
startsWith(github.ref, 'refs/tags/v3.3') )
67
71
72
+ - name : Validate that LICENSE files are included in wheels
73
+ run : |
74
+ python ./ci/check_wheel_licenses.py
75
+
68
76
- uses : actions/upload-artifact@v2
69
77
with :
70
78
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 1
1
# Rename this file to setup.cfg to modify Matplotlib's build options.
2
2
3
+ [metadata]
4
+ license_files = LICENSE/*
5
+
3
6
[egg_info]
4
7
5
8
[libs]
You can’t perform that action at this time.
0 commit comments