zhongjiajie commented on a change in pull request #1210: URL: https://github.com/apache/incubator-seatunnel/pull/1210#discussion_r807495550
########## File path: docs/en/developement/NewLicenseGuide.md ########## @@ -2,9 +2,19 @@ If you have any new Jar binary package adding in you PR, you need to follow the steps below to notice license -1. declared in `tools/dependencies/konw-dependencies.txt`, -2. Add the corresponding License file under `seatunnel-dist/release-docs/licenses`, if it is a standard Apache License, it does not need to be added. +1. declared in `tools/dependencies/konw-dependencies.txt` + +2. Add the corresponding License file under `seatunnel-dist/release-docs/licenses`, if it is a standard Apache License, it does not need to be added + 3. Add the corresponding statement in `seatunnel-dist/release-docs/LICENSE` + + ```bash + # At the same time, you can also use the script to assist the inspection. + # Because it only uses the Python native APIs and does not depend on any third-party libraries, it can run using the original Python environment. + # Please refer to the documentation if you do not have a Python env: https://www.python.org/downloads/ + python3 bin/license.py seatunnel-dist/target/THIRD-PARTY.txt seatunnel-dist/release-docs/LICENSE true Review comment: I don't know much about the license, but what is it file `seatunnel-dist/target/THIRD-PARTY.txt` look like and how it generated ########## File path: bin/license.py ########## @@ -0,0 +1,376 @@ +#!/usr/bin/env python3 Review comment: The best practices is not point to a specific version of python, and check the version in the code ```suggestion #!/usr/bin/env python ``` ########## File path: bin/license.py ########## @@ -0,0 +1,376 @@ +#!/usr/bin/env python3 + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys + +if len(sys.argv) - 1 != 3: + print("The length of arguments should be 2!") + print("The first argument should be the path to the THIRD-PARTY.txt file.") + print("The second argument should be the path to the LICENSE file.") + print("The third argument should be a flag that controls whether to print the diff or change the LICENSE file.") + exit(-1) + +third_party = sys.argv[1] +license = sys.argv[2] +print_diff = sys.argv[3] + +with open(third_party, "r") as f: + licenses = f.readlines() + +licenses_keyword_map = { + "Apache 2.0 License": ["Apache", "APL2"], + "MIT License": ["MIT"], + "BSD License": ["BSD"], + "CC0-1.0 License": ["CC0"], + "CDDL License": ["CDDL"], + "Eclipse Public License": ["Eclipse"], + "Public Domain License": ["Public Domain"], + "Mozilla Public License Version 2.0": ["Mozilla Public License"], + "Go License": ["The Go license"], + "Unicode License": ["Unicode/ICU License"] +} +unknown_licenses_map = { + "commons-beanutils:commons-beanutils:1.7.0": "(Apache License, Version 2.0) Apache Commons BeanUtils (commons-beanutils:commons-beanutils:1.7.0 - https://commons.apache.org/proper/commons-beanutils/)", + "commons-pool:commons-pool:1.5.4": "(The Apache Software License, Version 2.0) Commons Pool (commons-pool:commons-pool:1.5.4 - http://commons.apache.org/pool/)", + "org.antlr:antlr-runtime:3.4": "(BSD licence) ANTLR 3 Runtime (org.antlr:antlr-runtime:3.4 - http://www.antlr.org)", + "javax.transaction:jta:1.1": "(CDDL + GPLv2 with classpath exception) Java Transaction API (javax.transaction:jta:1.1 - http://java.sun.com/products/jta)", + "javax.servlet.jsp:jsp-api:2.1": "(CDDL + GPLv2 with classpath exception) Java Servlet API (javax.servlet.jsp:jsp-api:2.1 - https://javaee.github.io/javaee-jsp-api)", + "javax.servlet:servlet-api:2.5": "(CDDL + GPLv2 with classpath exception) Java Servlet API (javax.servlet:servlet-api:2.5 - http://servlet-spec.java.net)", + "oro:oro:2.0.8": "(Apache License, Version 1.1) ORO (oro:oro:2.0.8 - https://mvnrepository.com/artifact/oro/oro)", + "org.hyperic:sigar:1.6.5.132": "(Apache License, Version 2.0) Sigar (org.hyperic:sigar:1.6.5.132 - https://github.com/hyperic/sigar)" +} +licenses_describe_map = { + "Apache 2.0 License": + """The following components are provided under the Apache License. See project link for details. +The text of each license is the standard Apache 2.0 license. +""", + "MIT License": """The following components are provided under the MIT License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "BSD License": """The following components are provided under a BSD license. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "CC0-1.0 License": """The following components are provided under the CC0-1.0 License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "CDDL License": """The following components are provided under the CDDL License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "Eclipse Public License": """The following components are provided under the Eclipse Public License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "Public Domain License": """The following components are provided under the Public Domain License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "Mozilla Public License Version 2.0": """The following components are provided under the Mozilla Public License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "Unicode License": """The following components are provided under the Unicode License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "Go License": """The following components are provided under the Go License. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""", + "Other License": """The following components are provided under some minority Licenses. See project link for details. +The text of each license is also included at licenses/LICENSE-[project].txt. +""" +} +licenses_map = { + "Apache 2.0 License": [], + "MIT License": [], + "BSD License": [], + "CC0-1.0 License": [], + "CDDL License": [], + "Eclipse Public License": [], + "Public Domain License": [], + "Mozilla Public License Version 2.0": [], + "Unicode License": [], + "Go License": [], + "Other License": [] +} + +for _ in licenses: Review comment: Due to we use this variable in the next, I think we better named it for easier to maintain ```suggestion for license in licenses: ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
