Include licenses in Windows bundles

This commit is contained in:
Salad Dais
2021-05-03 23:58:23 +00:00
parent 0f35cc00d5
commit d9084c3332
2 changed files with 9 additions and 4 deletions

View File

@@ -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

View File

@@ -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,
}
)