udim commented on a change in pull request #11428: [BEAM-9764] multi threading 
& check urls instead of pulling
URL: https://github.com/apache/beam/pull/11428#discussion_r410411341
 
 

 ##########
 File path: sdks/java/container/license_scripts/pull_licenses_java.py
 ##########
 @@ -108,89 +244,27 @@ def write_to_csv(csv_dict):
 
     maven_url_temp = 'https://repo1.maven.org/maven2/{module}/{version}'
 
-    for dep in dependencies['dependencies']:
-        '''
-        An example of a Json blob.
-        {
-            "moduleName": "antlr:antlr",
-            "moduleUrl": "http://www.antlr.org/";,
-            "moduleVersion": "2.7.7",
-            "moduleLicense": "BSD License",
-            "moduleLicenseUrl": "http://www.antlr.org/license.html";
-        }
-        '''
-        name = dep['moduleName'].split(':')[1].lower()
-        version = dep['moduleVersion']
-        name_version = name + '-' + version
-        dir_name = '{license_dir}/{name_version}.jar'.format(
-            license_dir=LICENSE_DIR, name_version=name_version)
-        # if auto pulled, directory is existing at {license_dir}
-        if not os.path.isdir(dir_name):
-            # skip self dependencies
-            if dep['moduleName'].startswith('beam'):
-                print('Skippig', name + '-' + version)
-                continue
-            os.mkdir(dir_name)
-            # pull license
-            try:
-                license_url = dep_config[name][version]['license']
-            except:
-                license_url = dep['moduleLicenseUrl']
-            pull_from_url(dir_name + '/LICENSE', license_url, name_version,
-                          no_licenses)
-            # pull notice
-            try:
-                notice_url = dep_config[name][version]['notice']
-                pull_from_url(dir_name + '/NOTICE', notice_url, name_version,
-                              no_licenses)
-            except:
-                notice_url = None
-        else:
-            try:
-                license_url = dep['moduleLicenseUrl']
-            except:
-                license_url = ''
-            print(
-                'License/notice for {name_version} were pulled automatically.'.
-                format(name_version=name_version))
-
-        # get license_type to decide if pull source code.
-        try:
-            license_type = dep['moduleLicense']
-        except:
-            try:
-                license_type = dep_config[name][version]['type']
-            except:
-                no_license_type.add(name_version)
-                license_type = ''
-                continue
+    csv_list = []
 
 Review comment:
   These lists need to have synchronized access if they are to be modified by 
different threads.
   
https://stackoverflow.com/questions/2227169/are-python-built-in-containers-thread-safe

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to