From: Sinacam Date: Thu, 27 Oct 2022 16:23:52 +0000 (+0800) Subject: updated setup.py for license X-Git-Tag: v246~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f64b37a3bd03097996f4aae7ff0a4cd151ddfb26;p=liblinear updated setup.py for license --- diff --git a/python/setup.py b/python/setup.py index 9a4c1fa..e1c2575 100644 --- a/python/setup.py +++ b/python/setup.py @@ -38,6 +38,11 @@ headers = [ "linear.def", ] +# license parameters +license_source = path.join("..", "COPYRIGHT") +license_file = "LICENSE" +license_name = "BSD-3-Clause" + kwargs_for_extension = { "sources": [path.join(cpp_dir, f) for f in source_codes], "depends": [path.join(cpp_dir, f) for f in headers], @@ -67,7 +72,7 @@ def create_cpp_source(): class CleanCommand(clean_cmd): def run(self): clean_cmd.run(self) - to_be_removed = ["build/", "dist/", "MANIFEST", cpp_dir, "{}.egg-info".format(PACKAGE_NAME)] + to_be_removed = ["build/", "dist/", "MANIFEST", cpp_dir, "{}.egg-info".format(PACKAGE_NAME), license_file] to_be_removed += glob("./{}/{}.*".format(PACKAGE_DIR, dynamic_lib_name)) for root, dirs, files in os.walk(os.curdir, topdown=False): if "__pycache__" in dirs: @@ -87,6 +92,9 @@ def main(): if not path.exists(cpp_dir): create_cpp_source() + if not path.exists(license_file): + copyfile(license_source, license_file) + with open("README") as f: long_description = f.read() @@ -100,6 +108,7 @@ def main(): author="ML group @ National Taiwan University", author_email="cjlin@csie.ntu.edu.tw", url="https://www.csie.ntu.edu.tw/~cjlin/liblinear", + license=license_name, install_requires=["scipy"], ext_modules=[ Extension(