From d1fbd1b54f978cadf6696a385478f93f27fdee11 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Sun, 2 Nov 2014 15:17:23 +0100 Subject: [PATCH 1/3] Ensuring that all tests are running for attribution generation --- about_code_tool/about.py | 1 - about_code_tool/tests/test_about.py | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/about_code_tool/about.py b/about_code_tool/about.py index 0584572b..9e168921 100644 --- a/about_code_tool/about.py +++ b/about_code_tool/about.py @@ -1267,7 +1267,6 @@ def generate_attribution(self, template_path=None, limit_to=None): limit_to = limit_to or [] about_object_fields = [] - about_content_dict = {} license_dict = {} not_process_components = list(limit_to) diff --git a/about_code_tool/tests/test_about.py b/about_code_tool/tests/test_about.py index 9d41fd5e..c42af756 100644 --- a/about_code_tool/tests/test_about.py +++ b/about_code_tool/tests/test_about.py @@ -606,8 +606,7 @@ def test_remove_blank_lines_and_no_colon_fields(self): self.assertEqual(expected_warnings[i][0], w.code) self.assertEqual(expected_warnings[i][1], w.field_value) - # FIXME: This is failing because there is no component list provided - def FAILING_test_generate_attribution_with_custom_template(self): + def test_generate_attribution_with_custom_template(self): expected = (u'notice_text:' 'version:2.4.3' 'about_resource:httpd-2.4.3.tar.gz' @@ -615,16 +614,15 @@ def FAILING_test_generate_attribution_with_custom_template(self): test_file = join(TESTDATA_DIR, 'attrib/attrib.ABOUT') collector = about.Collector(test_file) template = join(TESTDATA_DIR, 'attrib/test.template') - result = collector.generate_attribution(template) + result = collector.generate_attribution(template,limit_to=['']) self.assertEqual(expected, result) - # FIXME: This is failing because there is no component list provided - def FAILING_test_generate_attribution_with_default_template(self): + def test_generate_attribution_with_default_template(self): f = open(join(TESTDATA_DIR, 'attrib/attrib.html')) expected = f.read() test_file = join(TESTDATA_DIR, 'attrib/attrib.ABOUT') collector = about.Collector(test_file) - result = collector.generate_attribution() + result = collector.generate_attribution(limit_to=['']) # Strip all the white spaces self.assertEqual(re.sub(r'\s+', '', expected), re.sub(r'\s+', '', result)) From 369db9e6a28564421731f789f93e23995c35cff6 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Sun, 2 Nov 2014 15:18:02 +0100 Subject: [PATCH 2/3] Removing debug print statements --- about_code_tool/about.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/about_code_tool/about.py b/about_code_tool/about.py index 9e168921..dd8989fe 100644 --- a/about_code_tool/about.py +++ b/about_code_tool/about.py @@ -968,8 +968,6 @@ def get_custom_field_keys(self): return custom_key def get_row_data(self, updated_path, custom_keys): - print(updated_path) - print(custom_keys) """ Create a csv compatible row of data for this object. """ From c03b9d0ae4aed161f9b6fc44fb7bb5b3ae995ca3 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Mon, 3 Nov 2014 16:06:35 +0100 Subject: [PATCH 3/3] Bumped version to 1.0.1 --- about.ABOUT | 3 ++- about_code_tool/about.py | 4 ++-- about_code_tool/genabout.py | 8 +++----- about_code_tool/genattrib.py | 4 ++-- about_code_tool/tests/test_about.py | 8 ++++---- docs/CHANGELOG.rst | 6 ++++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/about.ABOUT b/about.ABOUT index 5d8558b3..9070c74c 100644 --- a/about.ABOUT +++ b/about.ABOUT @@ -1,7 +1,8 @@ about_resource: . name: AboutCode -version: 0.9.0 +version: 1.0.1 + owner: nexB Inc. author: Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez diff --git a/about_code_tool/about.py b/about_code_tool/about.py index dd8989fe..b7528e81 100644 --- a/about_code_tool/about.py +++ b/about_code_tool/about.py @@ -46,7 +46,7 @@ import ntpath -__version__ = '0.9.0' +__version__ = '1.0.1' # See http://dejacode.org __about_spec_version__ = '1.0' @@ -1325,7 +1325,7 @@ def generate_attribution(self, template_path=None, limit_to=None): # However, this is a temp fix for the license summarization feature. rendered = template.render(about_objects=about_object_fields, license_keys=license_key, - license_texts = license_text_list, + license_texts=license_text_list, common_licenses=COMMON_LICENSES) return rendered diff --git a/about_code_tool/genabout.py b/about_code_tool/genabout.py index 0492b911..4717913b 100644 --- a/about_code_tool/genabout.py +++ b/about_code_tool/genabout.py @@ -40,7 +40,7 @@ import about -__version__ = '0.9.0' +__version__ = '1.0.1' __copyright__ = """ Copyright (c) 2013-2014 nexB Inc. All rights reserved. @@ -391,8 +391,6 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens # update/overwrite the 'license_text_file' with # 'dje_license_key' if line['license_text_file']: - file_value = [] - license_file_list = [] file_location = line['about_file'] about_parent_dir = dirname(file_location) license_text_file = line['license_text_file'] @@ -544,7 +542,7 @@ def update_about_resource(self, line, about_file_exist): about_resource = line['about_file'] if about_resource.endswith('/'): line['about_resource'] = '.' - else: # 'about_resource' key present with no value + else: # 'about_resource' key present with no value about_resource = line['about_file'] if about_resource.endswith('/'): line['about_resource'] = '.' @@ -701,7 +699,7 @@ def main(parser, options, args): handler.setLevel(logging.WARNING) valid_actions = 0, 1, 2, 3 - if action: + if action: if action in valid_actions: action_num = action else: diff --git a/about_code_tool/genattrib.py b/about_code_tool/genattrib.py index 84f9e76c..abf7e1d8 100644 --- a/about_code_tool/genattrib.py +++ b/about_code_tool/genattrib.py @@ -43,9 +43,9 @@ logger.addHandler(handler) file_logger = logging.getLogger(__name__ + '_file') -__version__ = '0.9.0' +__version__ = '1.0.1' -__about_spec_version__ = '0.8.0' # See http://dejacode.org +__about_spec_version__ = '1.0.0' # See http://dejacode.org __copyright__ = """ Copyright (c) 2013-2014 nexB Inc. All rights reserved. diff --git a/about_code_tool/tests/test_about.py b/about_code_tool/tests/test_about.py index c42af756..8f507c6b 100644 --- a/about_code_tool/tests/test_about.py +++ b/about_code_tool/tests/test_about.py @@ -116,7 +116,7 @@ def test_header_row_in_csv_output(self): 'checksum_sha256,dje_component,dje_license,dje_organization,' 'dje_license_name,scm_branch,scm_repository,signature_gpg_file,' 'redistribute_sources,about_format,usage,' - 'license_text,notice,' # These two are not supported and thus treat as custom keys + 'license_text,notice,' # These two are not supported and thus treat as custom keys 'scm_path,scm_tool,scm_rev,scm_tag,organization,' 'warnings,errors') @@ -614,7 +614,7 @@ def test_generate_attribution_with_custom_template(self): test_file = join(TESTDATA_DIR, 'attrib/attrib.ABOUT') collector = about.Collector(test_file) template = join(TESTDATA_DIR, 'attrib/test.template') - result = collector.generate_attribution(template,limit_to=['']) + result = collector.generate_attribution(template, limit_to=['']) self.assertEqual(expected, result) def test_generate_attribution_with_default_template(self): @@ -623,7 +623,7 @@ def test_generate_attribution_with_default_template(self): test_file = join(TESTDATA_DIR, 'attrib/attrib.ABOUT') collector = about.Collector(test_file) result = collector.generate_attribution(limit_to=['']) - # Strip all the white spaces + # Strip all the white spaces self.assertEqual(re.sub(r'\s+', '', expected), re.sub(r'\s+', '', result)) def test_license_text_extracted_from_license_text_file(self): @@ -696,4 +696,4 @@ def test_get_about_name(self): def test_get_dje_license_name(self): about_file = about.AboutFile(join(TESTDATA_DIR, 'basic/simple.about')) result = about_file.get_dje_license_name() - self.assertEqual(result, 'Apache License 2.0') \ No newline at end of file + self.assertEqual(result, 'Apache License 2.0') diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 67196c99..f0cf23e2 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -1,6 +1,8 @@ +Release 1.0.1: + 2013-11-03: Minor bug fixes, such as extraneous debug printouts. -Release next: - +Release 1.0.0: + 2013-10-31: Making 1.0: some changes in the spec, such as supporting only text in external files. Several refinements including common licenses. Release 0.8.1: 2013-06-24: Initial release with minimal capabilities to read and validate ABOUT files format 0.8.0 and output a CSV inventory.