From b0dd13e0ba9ae8b30f08ffc86b5fc25a9d86f662 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Mon, 30 Nov 2020 13:43:58 +0100 Subject: [PATCH] Support LICENSE in spacy package If present, include the file `input_dir/LICENSE` at the top level of the packaged model. --- spacy/cli/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/cli/package.py b/spacy/cli/package.py index 49a0ab75d..203163be9 100644 --- a/spacy/cli/package.py +++ b/spacy/cli/package.py @@ -103,6 +103,9 @@ def package( ) Path.mkdir(package_path, parents=True) shutil.copytree(str(input_dir), str(package_path / model_name_v)) + license_path = package_path / model_name_v / "LICENSE" + if license_path.exists(): + shutil.move(str(license_path), str(main_path)) create_file(main_path / "meta.json", srsly.json_dumps(meta, indent=2)) create_file(main_path / "setup.py", TEMPLATE_SETUP) create_file(main_path / "MANIFEST.in", TEMPLATE_MANIFEST) @@ -239,6 +242,7 @@ if __name__ == '__main__': TEMPLATE_MANIFEST = """ include meta.json include config.cfg +include LICENSE """.strip()