Skip to content
代码片段 群组 项目
未验证 提交 65db744d 编辑于 作者: Hannah Jiang's avatar Hannah Jiang 提交者: GitHub
浏览文件

[BEAM-9136]Add licenses for dependencies for Python (#11067)

* python scripts

* PreCommit_Python_DockerBuild

* fix comments

* fix comments 2

* fix comments 3

* add license for singledispatch for py2
上级 e6b37c44
No related branches found
No related tags found
无相关合并请求
显示
365 个添加3 个删除
...@@ -36,6 +36,7 @@ Beam Jenkins overview page: [link](https://builds.apache.org/view/A-D/view/Beam/ ...@@ -36,6 +36,7 @@ Beam Jenkins overview page: [link](https://builds.apache.org/view/A-D/view/Beam/
| beam_PreCommit_Portable_Python | [commit](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Phrase/) | `Run Portable_Python PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron) | | beam_PreCommit_Portable_Python | [commit](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Phrase/) | `Run Portable_Python PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron) |
| beam_PreCommit_PythonLint | [commit](https://builds.apache.org/job/beam_PreCommit_PythonLint_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_PythonLint_Phrase/) | `Run PythonLint PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron) | | beam_PreCommit_PythonLint | [commit](https://builds.apache.org/job/beam_PreCommit_PythonLint_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_PythonLint_Phrase/) | `Run PythonLint PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_PythonLint_Cron) |
| beam_PreCommit_Python | [commit](https://builds.apache.org/job/beam_PreCommit_Python_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Python_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Python_Phrase/) | `Run Python PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python_Cron) | | beam_PreCommit_Python | [commit](https://builds.apache.org/job/beam_PreCommit_Python_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Python_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Python_Phrase/) | `Run Python PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python_Cron) |
| beam_PreCommit_Python_DockerBuild | [phrase](https://builds.apache.org/job/beam_PreCommit_Python_DockerBuild_Phrase/) | `Run Python DockerBuild PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python_DockerBuild_Phrase/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python_DockerBuild_Phrase) |
| beam_PreCommit_Python2_PVR_Flink | [commit](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Phrase/) | `Run Python2_PVR_Flink PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron) | | beam_PreCommit_Python2_PVR_Flink | [commit](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Phrase/) | `Run Python2_PVR_Flink PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Python2_PVR_Flink_Cron) |
| beam_PreCommit_RAT | [commit](https://builds.apache.org/job/beam_PreCommit_RAT_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_RAT_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_RAT_Phrase/) | `Run RAT PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_RAT_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_RAT_Cron) | | beam_PreCommit_RAT | [commit](https://builds.apache.org/job/beam_PreCommit_RAT_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_RAT_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_RAT_Phrase/) | `Run RAT PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_RAT_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_RAT_Cron) |
| beam_PreCommit_Spotless | [commit](https://builds.apache.org/job/beam_PreCommit_Spotless_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Spotless_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Spotless_Phrase/) | `Run Spotless PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Spotless_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Spotless_Cron) | | beam_PreCommit_Spotless | [commit](https://builds.apache.org/job/beam_PreCommit_Spotless_Commit/), [cron](https://builds.apache.org/job/beam_PreCommit_Spotless_Cron/), [phrase](https://builds.apache.org/job/beam_PreCommit_Spotless_Phrase/) | `Run Spotless PreCommit` | [![Build Status](https://builds.apache.org/job/beam_PreCommit_Spotless_Cron/badge/icon)](https://builds.apache.org/job/beam_PreCommit_Spotless_Cron) |
......
/*
* 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 PrecommitJobBuilder
PrecommitJobBuilder builder = new PrecommitJobBuilder(
scope: this,
nameBase: 'PythonDocker',
gradleTask: ':pythonDockerBuildPreCommit',
gradleSwitches: ['--info'],
timeoutMins: 30,
triggerPathPatterns: [
'^model/.*$',
'^sdks/python/.*$',
'^release/.*$',
]
)
builder.build()
...@@ -214,6 +214,13 @@ task pythonPreCommit() { ...@@ -214,6 +214,13 @@ task pythonPreCommit() {
// have caught. Note that the same tests will still run in postcommit. // have caught. Note that the same tests will still run in postcommit.
} }
task pythonDockerBuildPreCommit() {
dependsOn ":sdks:python:container:py2:docker"
dependsOn ":sdks:python:container:py35:docker"
dependsOn ":sdks:python:container:py36:docker"
dependsOn ":sdks:python:container:py37:docker"
}
task pythonLintPreCommit() { task pythonLintPreCommit() {
dependsOn ":sdks:python:test-suites:tox:py2:lint" dependsOn ":sdks:python:test-suites:tox:py2:lint"
dependsOn ":sdks:python:test-suites:tox:py37:lint" dependsOn ":sdks:python:test-suites:tox:py37:lint"
......
...@@ -70,6 +70,7 @@ JOB_TRIGGER_PHRASES=( ...@@ -70,6 +70,7 @@ JOB_TRIGGER_PHRASES=(
"Run Portable_Python PreCommit" "Run Portable_Python PreCommit"
"Run PythonLint PreCommit" "Run PythonLint PreCommit"
"Run Python PreCommit" "Run Python PreCommit"
"Run Python DockerBuild PreCommit"
) )
......
...@@ -51,16 +51,20 @@ RUN ln -s /usr/bin/ccache /usr/local/bin/gcc ...@@ -51,16 +51,20 @@ RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
RUN ccache --set-config=sloppiness=file_macro && ccache --set-config=hash_dir=false RUN ccache --set-config=sloppiness=file_macro && ccache --set-config=hash_dir=false
COPY target/apache-beam.tar.gz /opt/apache/beam/tars/ COPY target/apache-beam.tar.gz /opt/apache/beam/tars/
COPY target/license_scripts /tmp/license_scripts/
RUN pip install -v /opt/apache/beam/tars/apache-beam.tar.gz[gcp] && \ RUN pip install -v /opt/apache/beam/tars/apache-beam.tar.gz[gcp] && \
pip install 'pip-licenses<3.0.0;python_version>="3.5"' && \
pip install 'pip-licenses==1.18.0;python_version<="2.7"' && \
python /tmp/license_scripts/pull_licenses_py.py && \
pip uninstall -y pip-licenses && \
# Remove pip cache. # Remove pip cache.
rm -rf /root/.cache/pip rm -rf /root/.cache/pip
# Log complete list of what exact packages and versions are installed. # Log complete list of what exact packages and versions are installed.
RUN pip freeze --all RUN pip freeze --all
ADD target/launcher/linux_amd64/boot /opt/apache/beam/
COPY target/LICENSE /opt/apache/beam/ COPY target/LICENSE /opt/apache/beam/
COPY target/NOTICE /opt/apache/beam/ COPY target/NOTICE /opt/apache/beam/
ADD target/launcher/linux_amd64/boot /opt/apache/beam/
ENTRYPOINT ["/opt/apache/beam/boot"] ENTRYPOINT ["/opt/apache/beam/boot"]
#
# 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.
#
pip_dependencies:
# This is a list of packages whose license files cannot be pulled with pip-licenses tool.
# pip-licenses scans site-packages/ directory to get a list of packages installed and their licenses.
# For packages that do not include licenses in their distribution, we need to manually
# provide license files in ./manual_licences/, or provide a url where they can be downloaded from.
# We need to manually configure licenses for a dependency if pip-licenses fails to retrieve
# the license file under any Python version we support.
# template:
# dependency_name:
# license: url_to_license or "skip"
# # skip: don't add license for the dependency
# # url_to_license: a url to source code (https://...) or a local file (file://...)
# notice: it's optional, url_to_notice
apache-beam:
license: "skip" # don't include self dependency.
# TODO(BEAM-8371): License for this dependency cannot be automatically retrieved on Python 2.
appdirs:
license: "https://raw.githubusercontent.com/ActiveState/appdirs/master/LICENSE.txt"
avro:
license: "https://raw.githubusercontent.com/apache/avro/master/LICENSE.txt"
notice: "https://raw.githubusercontent.com/apache/avro/master/NOTICE.txt"
avro-python3:
license: "https://raw.githubusercontent.com/apache/avro/master/LICENSE.txt"
notice: "https://raw.githubusercontent.com/apache/avro/master/NOTICE.txt"
backports.weakref:
license: "https://raw.githubusercontent.com/PiDelport/backports.weakref/master/LICENSE"
chardet:
license: "https://raw.githubusercontent.com/chardet/chardet/master/LICENSE"
certifi:
license: "https://raw.githubusercontent.com/certifi/python-certifi/master/LICENSE"
cython:
license: "https://raw.githubusercontent.com/cython/cython/master/LICENSE.txt"
enum34:
license: "https://bitbucket.org/stoneleaf/enum34/raw/c208549a93b71b948ff7bbdfd29dce8f85527916/enum/LICENSE"
fastavro:
license: "https://raw.githubusercontent.com/fastavro/fastavro/master/LICENSE"
notice: "https://raw.githubusercontent.com/fastavro/fastavro/master/NOTICE.txt"
funcsigs:
license: "https://raw.githubusercontent.com/aliles/funcsigs/master/LICENSE"
futures:
license: "https://raw.githubusercontent.com/agronholm/pythonfutures/master/LICENSE"
google-apitools:
license: "https://raw.githubusercontent.com/google/apitools/master/LICENSE"
googledatastore:
license: "https://raw.githubusercontent.com/GoogleCloudPlatform/google-cloud-datastore/master/LICENSE"
grpcio:
license: "https://raw.githubusercontent.com/grpc/grpc/master/LICENSE"
notice: "https://raw.githubusercontent.com/grpc/grpc/master/NOTICE.txt"
grpcio-gcp:
license: "https://raw.githubusercontent.com/GoogleCloudPlatform/grpc-gcp-python/master/LICENSE"
guppy:
license: "https://raw.githubusercontent.com/joshwcomeau/guppy/master/LICENSE.md"
guppy3:
license: "https://raw.githubusercontent.com/zhuyifei1999/guppy3/master/LICENSE"
h5py:
license: "https://raw.githubusercontent.com/h5py/h5py/master/LICENSE"
hdfs:
license: "https://raw.githubusercontent.com/mtth/hdfs/master/LICENSE"
httplib2:
license: "https://raw.githubusercontent.com/httplib2/httplib2/master/LICENSE"
mock:
license: "https://raw.githubusercontent.com/testing-cabal/mock/master/LICENSE.txt"
monotonic:
license: "https://raw.githubusercontent.com/atdt/monotonic/master/LICENSE"
nose:
license: "https://raw.githubusercontent.com/nose-devs/nose/master/lgpl.txt"
numpy:
license: "https://raw.githubusercontent.com/numpy/numpy/master/LICENSE.txt"
oauth2client:
license: "https://raw.githubusercontent.com/googleapis/oauth2client/master/LICENSE"
pandas:
license: "https://raw.githubusercontent.com/pandas-dev/pandas/master/LICENSE"
pathlib2:
license: "https://raw.githubusercontent.com/mcmtroffaes/pathlib2/develop/LICENSE.rst"
protobuf:
license: "https://raw.githubusercontent.com/protocolbuffers/protobuf/master/LICENSE"
protorpc:
license: "https://raw.githubusercontent.com/google/protorpc/master/LICENSE"
pyarrow:
license: "https://raw.githubusercontent.com/apache/arrow/master/LICENSE.txt"
notice: "https://raw.githubusercontent.com/apache/arrow/master/NOTICE.txt"
pyhamcrest:
license: "https://raw.githubusercontent.com/hamcrest/PyHamcrest/master/LICENSE.txt"
pymongo:
license: "https://raw.githubusercontent.com/mongodb/mongo-python-driver/master/LICENSE"
python-gflags:
license: "https://raw.githubusercontent.com/google/python-gflags/master/COPYING"
pyvcf:
license: "https://raw.githubusercontent.com/jamescasbon/PyVCF/master/LICENSE"
singledispatch:
license: "file:///tmp/license_scripts/manual_licenses/singledispatch/LICENSE"
scipy:
license: "https://raw.githubusercontent.com/scipy/scipy/master/LICENSE.txt"
termcolor:
license: "file:///tmp/license_scripts/manual_licenses/termcolor/LICENSE"
tensorflow:
license: "https://raw.githubusercontent.com/tensorflow/tensorflow/master/LICENSE"
tensorflow-estimator:
license: "https://raw.githubusercontent.com/tensorflow/estimator/master/LICENSE"
timeloop:
license: "https://raw.githubusercontent.com/sankalpjonn/timeloop/master/LICENSE"
wget:
license: "https://raw.githubusercontent.com/mirror/wget/master/COPYING"
\ No newline at end of file
Copyright (C) 2013 by Łukasz Langa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
Copyright (c) 2008-2011 Volvox Development Team
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
#
# 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.
#
"""
A script to pull licenses for Python.
The script is executed within Docker.
"""
import json
import os
import shutil
import subprocess
import sys
import tempfile
import traceback
import yaml
from future.moves.urllib.request import urlopen
from tenacity import retry
from tenacity import stop_after_attempt
from tenacity import wait_exponential
LICENSE_DIR = '/opt/apache/beam/third_party_licenses'
def run_bash_command(command):
return subprocess.check_output(command.split()).decode('utf-8')
def run_pip_licenses():
command = 'pip-licenses --with-license-file --format=json'
dependencies = run_bash_command(command)
return json.loads(dependencies)
@retry(stop=stop_after_attempt(3))
def copy_license_files(dep):
source_license_file = dep['LicenseFile']
if source_license_file.lower() == 'unknown':
return False
name = dep['Name'].lower()
dest_dir = '/'.join([LICENSE_DIR, name])
try:
os.mkdir(dest_dir)
shutil.copy(source_license_file, dest_dir + '/LICENSE')
print(
'Successfully pulled license for {dep} with pip-licenses.'.format(
dep=name))
return True
except Exception as e:
print(
'Failed to copy from {source} to {dest}'.format(
source=source_license_file, dest=dest_dir + '/LICENSE'))
traceback.print_exc()
raise
@retry(
reraise=True,
wait=wait_exponential(multiplier=2),
stop=stop_after_attempt(5))
def pull_from_url(dep, configs):
'''
:param dep: name of a dependency
:param configs: a dict from dep_urls_py.yaml
:return: boolean
It downloads files form urls to a temp directory first in order to avoid
to deal with any temp files. It helps keep clean final directory.
'''
if dep in configs:
config = configs[dep]
dest_dir = '/'.join([LICENSE_DIR, dep])
cur_temp_dir = tempfile.mkdtemp()
try:
if config['license'] == 'skip':
print('Skip pulling license for ', dep)
else:
url_read = urlopen(config['license'])
with open(cur_temp_dir + '/LICENSE', 'wb') as temp_write:
shutil.copyfileobj(url_read, temp_write)
print(
'Successfully pulled license for {dep} from {url}.'.format(
dep=dep, url=config['license']))
# notice is optional.
if 'notice' in config:
url_read = urlopen(config['notice'])
with open(cur_temp_dir + '/NOTICE', 'wb') as temp_write:
shutil.copyfileobj(url_read, temp_write)
shutil.copytree(cur_temp_dir, dest_dir)
return True
except Exception as e:
print(
'Error occurred when pull license for {dep} from {url}.'.format(
dep=dep, url=config))
traceback.print_exc()
raise
finally:
shutil.rmtree(cur_temp_dir)
if __name__ == "__main__":
os.makedirs(LICENSE_DIR)
no_licenses = []
with open('/tmp/license_scripts/dep_urls_py.yaml') as file:
dep_config = yaml.full_load(file)
dependencies = run_pip_licenses()
# add licenses for pip installed packages.
# try to pull licenses with pip-licenses tool first, if no license pulled,
# then pull from URLs.
for dep in dependencies:
if not (copy_license_files(dep) or
pull_from_url(dep['Name'].lower(), dep_config['pip_dependencies'])):
no_licenses.append(dep['Name'].lower())
if no_licenses:
py_ver = '%d.%d' % (sys.version_info[0], sys.version_info[1])
how_to = 'These licenses were not able to be pulled automatically. ' \
'Please search code source of the dependencies on the internet ' \
'and add urls to RAW license file at sdks/python/container/' \
'license_scripts/dep_urls_py.yaml for each missing license ' \
'and rerun the test. If no such urls can be found, you need ' \
'to manually add LICENSE and NOTICE (if available) files at ' \
'sdks/python/container/license_scripts/manual_licenses/{dep}/ ' \
'and add entries to sdks/python/container/license_scripts/' \
'dep_urls_py.yaml.'
raise RuntimeError(
'Could not retrieve licences for packages [{license_list}] in '
'Python{py_ver} environment. \n {how_to}'.format(
py_ver=py_ver, license_list=','.join(no_licenses), how_to=how_to))
...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) { ...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) {
} }
} }
task copyLicenseScrips(type: Copy){
from ("../license_scripts")
into "build/target/license_scripts"
}
task copyLauncherDependencies(type: Copy) { task copyLauncherDependencies(type: Copy) {
from configurations.sdkHarnessLauncher from configurations.sdkHarnessLauncher
into "build/target/launcher" into "build/target/launcher"
...@@ -65,3 +70,4 @@ docker { ...@@ -65,3 +70,4 @@ docker {
dockerPrepare.dependsOn copyLauncherDependencies dockerPrepare.dependsOn copyLauncherDependencies
dockerPrepare.dependsOn copyDockerfileDependencies dockerPrepare.dependsOn copyDockerfileDependencies
dockerPrepare.dependsOn copyLicenseScrips
...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) { ...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) {
} }
} }
task copyLicenseScrips(type: Copy){
from ("../license_scripts")
into "build/target/license_scripts"
}
task copyLauncherDependencies(type: Copy) { task copyLauncherDependencies(type: Copy) {
from configurations.sdkHarnessLauncher from configurations.sdkHarnessLauncher
into "build/target/launcher" into "build/target/launcher"
...@@ -65,3 +70,4 @@ docker { ...@@ -65,3 +70,4 @@ docker {
dockerPrepare.dependsOn copyLauncherDependencies dockerPrepare.dependsOn copyLauncherDependencies
dockerPrepare.dependsOn copyDockerfileDependencies dockerPrepare.dependsOn copyDockerfileDependencies
dockerPrepare.dependsOn copyLicenseScrips
...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) { ...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) {
} }
} }
task copyLicenseScrips(type: Copy){
from ("../license_scripts")
into "build/target/license_scripts"
}
task copyLauncherDependencies(type: Copy) { task copyLauncherDependencies(type: Copy) {
from configurations.sdkHarnessLauncher from configurations.sdkHarnessLauncher
into "build/target/launcher" into "build/target/launcher"
...@@ -65,3 +70,4 @@ docker { ...@@ -65,3 +70,4 @@ docker {
dockerPrepare.dependsOn copyLauncherDependencies dockerPrepare.dependsOn copyLauncherDependencies
dockerPrepare.dependsOn copyDockerfileDependencies dockerPrepare.dependsOn copyDockerfileDependencies
dockerPrepare.dependsOn copyLicenseScrips
...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) { ...@@ -43,6 +43,11 @@ task copyDockerfileDependencies(type: Copy) {
} }
} }
task copyLicenseScrips(type: Copy){
from ("../license_scripts")
into "build/target/license_scripts"
}
task copyLauncherDependencies(type: Copy) { task copyLauncherDependencies(type: Copy) {
from configurations.sdkHarnessLauncher from configurations.sdkHarnessLauncher
into "build/target/launcher" into "build/target/launcher"
...@@ -63,6 +68,6 @@ docker { ...@@ -63,6 +68,6 @@ docker {
buildArgs(['py_version': "3.7"]) buildArgs(['py_version': "3.7"])
} }
dockerPrepare.dependsOn copyLauncherDependencies dockerPrepare.dependsOn copyLauncherDependencies
dockerPrepare.dependsOn copyDockerfileDependencies dockerPrepare.dependsOn copyDockerfileDependencies
dockerPrepare.dependsOn copyLicenseScrips
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册