Include licenses in Windows bundles
This commit is contained in:
4
.github/workflows/bundle_windows.yml
vendored
4
.github/workflows/bundle_windows.yml
vendored
@@ -35,7 +35,9 @@ jobs:
|
||||
- name: Bundle with cx_Freeze
|
||||
run: |
|
||||
python setup_cxfreeze.py build_exe
|
||||
python setup_cxfreeze.py cleanse_cxfreeze
|
||||
pip install pip-licenses
|
||||
pip-licenses --format=plain-vertical --with-license-file --no-license-path --output-file=lib_licenses.txt
|
||||
python setup_cxfreeze.py finalize_cxfreeze
|
||||
python setup_cxfreeze.py build_zip
|
||||
|
||||
- name: Upload the artifact
|
||||
|
||||
@@ -50,8 +50,8 @@ TO_DELETE = [
|
||||
BASE_DIR = Path(__file__).parent.absolute()
|
||||
|
||||
|
||||
class CleanseCXFreezeCommand(Command):
|
||||
description = "Get rid of unwanted files pulled in by cx_Freeze"
|
||||
class FinalizeCXFreezeCommand(Command):
|
||||
description = "Prepare cx_Freeze build dirs for zipping"
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self) -> None:
|
||||
@@ -70,6 +70,9 @@ class CleanseCXFreezeCommand(Command):
|
||||
os.unlink(cleanse_path)
|
||||
except:
|
||||
pass
|
||||
# Must have been generated with pip-licenses before. Many dependencies
|
||||
# require their license to be distributed with their binaries.
|
||||
shutil.copy(BASE_DIR / "lib_licenses.txt", path / "lib_licenses.txt")
|
||||
|
||||
|
||||
class BuildZipArchiveCommand(Command):
|
||||
@@ -120,7 +123,7 @@ setup(
|
||||
options=options,
|
||||
executables=executables,
|
||||
cmdclass={
|
||||
"cleanse_cxfreeze": CleanseCXFreezeCommand,
|
||||
"finalize_cxfreeze": FinalizeCXFreezeCommand,
|
||||
"build_zip": BuildZipArchiveCommand,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user