Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ jobs:
- name: Check package
run: twine check dist/*

- name: Check LICENSE is packaged
shell: python
run: |
import glob, sys, tarfile, zipfile

missing = []
for whl in glob.glob("dist/*.whl"):
if not any(n.endswith(".dist-info/licenses/LICENSE") for n in zipfile.ZipFile(whl).namelist()):
missing.append(whl)
for sdist in glob.glob("dist/*.tar.gz"):
if not any(n.count("/") == 1 and n.endswith("/LICENSE") for n in tarfile.open(sdist).getnames()):
missing.append(sdist)
for path in missing:
print(f"::error::{path} does not include LICENSE")
sys.exit(1 if missing else 0)

- name: Verify tag matches version
if: github.event_name == 'push'
run: |
Expand Down
Loading