Skip to content

Commit be00d90

Browse files
committed
Merge branch 'develop' into 417_json_transform
* Heavily modified `transform` code and tests
2 parents df525be + b458406 commit be00d90

23 files changed

+225
-3161
lines changed

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013-2019 nexB Inc. http://www.nexb.com/ - All rights reserved.
1+
Copyright (c) 2013-2020 nexB Inc. http://www.nexb.com/ - All rights reserved.
22
Licensed under the Apache License, Version 2.0 (the "License");
33
you may not use this file except in compliance with the License.
44
You may obtain a copy of the License at

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ third-party software components that you use in your project.
1010
You start by storing ABOUT files (a small YAML formatted text file with field/value pairs)
1111
side-by-side with each of the third-party software components you use.
1212
Each ABOUT file documents origin and license for one software.
13-
For more information on the ABOUT file format, visit http://www.dejacode.org
1413
There are many examples of ABOUT files (valid or invalid) in the testdata/
1514
directory of the whole repository.
1615

REFERENCE.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ Options
8383
$ about attrib --vartext "title=Attribution Notice" --vartext "header=Product 101" LOCATION OUTPUT
8484

8585
Users can use the following in the template to get the vartext:
86-
{{ vartext_dict['title'] }}
87-
{{ vartext_dict['header'] }}
86+
{{ variables['title'] }}
87+
{{ variables['header'] }}
8888

8989
--verbose
9090

about.ABOUT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
about_resource: .
22
name: AboutCode-toolkit
3-
version: 4.0.1
3+
version: 5.0.0
44
author: Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez
5-
copyright: Copyright (c) 2013-2019 nexB Inc.
5+
copyright: Copyright (c) 2013-2020 nexB Inc.
66
description: |
77
AboutCode Toolkit is a tool to process ABOUT files. An ABOUT file
88
provides a simple way to document the provenance (origin and license)

docs/CHANGELOG.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
2019-xx-xx
1+
2020-xx-xx
2+
Release 5.0.0
3+
4+
* Update transform code (See #427 and #428)
5+
6+
2020-05-05
27
Release 4.0.2
38

49
* Upgrade license-expression library to v1.2
5-
* Enhance the `transform` to also work with JSON file
10+
* Fix the missing `multi_sort` filter for Jinja2
11+
* Update help text for `--vartext`
612

713

814
2019-10-17

docs/UsingAboutCodetoDocumentYourSoftwareAssets.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ For instance with this configuration the columns "Directory/Location" will be
253253
renamed to "about_resource" and "foo" to "bar":
254254

255255
field_renamings:
256-
'Directory/Location' : about_resource
257-
foo : bar
256+
about_resource : 'Directory/Location'
257+
bar : foo
258258

259259
The renaming is always applied first before other transforms and checks. All
260260
other column names referenced below are these that exist AFTER the renaming
@@ -296,6 +296,7 @@ transformed target CSV/JSON.
296296

297297
For instance with this configuration the target CSV/JSON will not contain the "type"
298298
and "temp" fields:
299+
299300
exclude_fields:
300301
- type
301302
- temp
-4.05 KB
Binary file not shown.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def read(*names, **kwargs):
2424

2525
setup(
2626
name='aboutcode-toolkit',
27-
version='4.0.1',
27+
version='5.0.0',
2828
license='Apache-2.0',
2929
description=(
3030
'AboutCode-toolkit is a tool to document the provenance (origin and license) of '

src/attributecode/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf8 -*-
33

44
# ============================================================================
5-
# Copyright (c) 2013-2019 nexB Inc. http://www.nexb.com/ - All rights reserved.
5+
# Copyright (c) 2013-2020 nexB Inc. http://www.nexb.com/ - All rights reserved.
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
88
# You may obtain a copy of the License at
@@ -31,12 +31,12 @@
3131

3232
import saneyaml
3333

34-
__version__ = '4.0.1'
34+
__version__ = '5.0.0'
3535

3636
__about_spec_version__ = '3.1.4'
3737

3838
__copyright__ = """
39-
Copyright (c) 2013-2019 nexB Inc. All rights reserved. http://dejacode.org
39+
Copyright (c) 2013-2020 nexB Inc. All rights reserved. http://dejacode.org
4040
Licensed under the Apache License, Version 2.0 (the "License");
4141
you may not use this file except in compliance with the License.
4242
You may obtain a copy of the License at

src/attributecode/attrib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf8 -*-
33

44
# ============================================================================
5-
# Copyright (c) 2013-2019 nexB Inc. http://www.nexb.com/ - All rights reserved.
5+
# Copyright (c) 2013-2020 nexB Inc. http://www.nexb.com/ - All rights reserved.
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
88
# You may obtain a copy of the License at
@@ -32,6 +32,7 @@
3232
from attributecode.licenses import COMMON_LICENSES
3333
from attributecode.model import parse_license_expression
3434
from attributecode.util import add_unc
35+
from attributecode.attrib_util import multi_sort
3536

3637

3738
DEFAULT_TEMPLATE_FILE = os.path.join(
@@ -145,6 +146,7 @@ def check_template(template_string):
145146
message) if the template is invalid or None if it is valid.
146147
"""
147148
try:
149+
jinja2.filters.FILTERS['multi_sort'] = multi_sort
148150
jinja2.Template(template_string)
149151
except (jinja2.TemplateSyntaxError, jinja2.TemplateAssertionError) as e:
150152
return e.lineno, e.message

0 commit comments

Comments
 (0)