diff --git a/NOTICE b/NOTICE index cb5e8c8f..1080f713 100644 --- a/NOTICE +++ b/NOTICE @@ -1,4 +1,4 @@ - Copyright (c) 2013-2017 nexB Inc. http://www.nexb.com/ - All rights reserved. + Copyright (c) 2013-2018 nexB Inc. and others http://www.nexb.com/ - All rights reserved. Licensed 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 diff --git a/about b/aboutcode similarity index 91% rename from about rename to aboutcode index d81323a5..8dcba3ea 100755 --- a/about +++ b/aboutcode @@ -16,4 +16,4 @@ fi source $ABOUT_ROOT_DIR/bin/activate -$ABOUT_ROOT_DIR/bin/about-code "$@" +$ABOUT_ROOT_DIR/bin/aboutcode "$@" diff --git a/about.ABOUT b/aboutcode.ABOUT similarity index 69% rename from about.ABOUT rename to aboutcode.ABOUT index cbf32d12..ba8bd2a3 100644 --- a/about.ABOUT +++ b/aboutcode.ABOUT @@ -1,15 +1,15 @@ about_resource: . name: AboutCode-toolkit -version: 3.0.0.dev6 +version: 3.1.0 owner: nexB Inc. -author: Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez +author: Chin Yeung Li, Philippe Ombredanne, Thomas Druez, Jillian Daguil and others homepage_url: https://aboutcode.org vcs_tool: git -vcs_repository: https://github.com/dejacode/about-code-tool.git +vcs_repository: https://github.com/nexB/aboutcode-toolkit.git description: AboutCode Toolkit is a tool to process ABOUT files. An ABOUT file provides a simple way to document the provenance (origin and license) @@ -20,6 +20,6 @@ description: AboutCode Toolkit is a tool to process ABOUT files. An ABOUT file license: apache-2.0 license_name: Apache 2.0 license_file: apache-2.0.LICENSE -copyright: Copyright (c) 2013-2017 nexB Inc. +copyright: Copyright (c) 2013-2018 nexB Inc. and others notice_file: NOTICE diff --git a/about.bat b/aboutcode.bat similarity index 82% rename from about.bat rename to aboutcode.bat index d301cad5..7035ffd6 100644 --- a/about.bat +++ b/aboutcode.bat @@ -29,7 +29,7 @@ goto about :about call %ABOUT_ROOT_DIR%\Scripts\activate -echo %ABOUT_ROOT_DIR%\bin\about-code %CMD_LINE_ARGS% -%ABOUT_ROOT_DIR%\bin\about-code %CMD_LINE_ARGS% +echo %ABOUT_ROOT_DIR%\bin\aboutcode %CMD_LINE_ARGS% +%ABOUT_ROOT_DIR%\bin\aboutcode %CMD_LINE_ARGS% :EOS diff --git a/about.cfg b/aboutcode.cfg similarity index 95% rename from about.cfg rename to aboutcode.cfg index cbcdfd61..aa7d7e86 100644 --- a/about.cfg +++ b/aboutcode.cfg @@ -1,4 +1,4 @@ -# AboutCode configuration file +# AboutCode toolkit configuration file [mappings] # When you generate ABOUT files from a CSV inventory, use this section to map diff --git a/docs/UsingAboutCodetoDocumentYourSoftwareAssets.md b/docs/UsingAboutCodetoDocumentYourSoftwareAssets.md index 926daa01..f3a96928 100644 --- a/docs/UsingAboutCodetoDocumentYourSoftwareAssets.md +++ b/docs/UsingAboutCodetoDocumentYourSoftwareAssets.md @@ -225,7 +225,7 @@ among multiple licenses. ## Optionally Define Custom Fields for gen with MAPPING.CONFIG -Optionally, you can control the generated label names and contents in your .ABOUT files using a MAPPING.CONFIG file. You can start with the default version provided at [https://github.com/nexB/aboutcode-toolkit/blob/develop/src/attributecode/mapping.config](https://github.com/nexB/aboutcode-toolkit/blob/develop/src/attributecode/mapping.config) and you can customize a copy of that file to map the software provenance information that is important to you. When you are ready to run gen, you will want to specify the --mapping option to tell it to look for the MAPPING.CONFIG file and use it. +Optionally, you can control the generated label names and contents in your .ABOUT files using a MAPPING.CONFIG file. You can start with the default version provided at [https://github.com/nexB/aboutcode-toolkit/blob/develop/src/aboutcode/mapping.config](https://github.com/nexB/aboutcode-toolkit/blob/develop/src/aboutcode/mapping.config) and you can customize a copy of that file to map the software provenance information that is important to you. When you are ready to run gen, you will want to specify the --mapping option to tell it to look for the MAPPING.CONFIG file and use it. You can customize your copy of MAPPING.CONFIG to recognize your own software inventory column names in order to map them to ABOUT File contents. This is especially useful if you prefer not to change some of the actual column names in your software inventory before running gen. Note that the name on the right side (for example "Directory/Filename") is the name of the field in your software inventory spreadsheet, and the name on the left, followed by a colon, is the field label to go into the .ABOUT file. Here is an example: @@ -297,7 +297,7 @@ You should prepare a filtered version of your software inventory (the one that y You can run attrib using the default_html.template (or default_json.template if want JSON output) provided with the AboutCode Toolkit tools: -[https://github.com/nexB/aboutcode-toolkit/blob/develop/src/attributecode/templates/default_html.template](https://github.com/nexB/aboutcode-toolkit/blob/develop/src/attributecode/templates/default_html.template) +[https://github.com/nexB/aboutcode-toolkit/blob/develop/src/aboutcode/templates/default_html.template](https://github.com/nexB/aboutcode-toolkit/blob/develop/src/aboutcode/templates/default_html.template) If you choose to do that, you will most likely want to edit the generated .html file to provide header information about your own organization and product. diff --git a/etc/scripts/irc-notify.py b/etc/scripts/irc-notify.py index 8b8376f2..48125481 100644 --- a/etc/scripts/irc-notify.py +++ b/etc/scripts/irc-notify.py @@ -32,7 +32,7 @@ Example: export APPVEYOR_URL=https://ci.appveyor.com -export APPVEYOR_PROJECT_NAME=attributecode +export APPVEYOR_PROJECT_NAME=aboutcode-toolkit export APPVEYOR_REPO_COMMIT_AUTHOR=pombredanne export APPVEYOR_REPO_COMMIT_TIMESTAMP=2016-10-31 export APPVEYOR_REPO_PROVIDER=gihub @@ -43,7 +43,7 @@ export APPVEYOR_REPO_COMMIT_MESSAGE="some IRC test" export APPVEYOR_ACCOUNT_NAME=nexB export APPVEYOR_PULL_REQUEST_NUMBER=pull_request_number -export APPVEYOR_REPO_NAME=nexB/attributecode +export APPVEYOR_REPO_NAME=nexB/aboutcode-toolkit python etc/scripts/irc-notify.py aboutcode '[{project_name}:{branch}] {short_commit}: "{message}" ({author}) {color_red}Succeeded','Details: {build_url} | Commit: {commit_url}' See also https://github.com/gridsync/gridsync/blob/master/appveyor.yml for examples diff --git a/setup.py b/setup.py index 44d5faaa..51f14b29 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def read(*names, **kwargs): setup( name='aboutcode-toolkit', - version='3.0.2', + version='3.1.0', license='Apache-2.0', description=( 'AboutCode-toolkit is a tool to document the provenance (origin and license) of ' @@ -32,7 +32,7 @@ def read(*names, **kwargs): 'Collect inventories, generate attribution documentation.' ), long_description=( - 'AttributeCode provides a simple way to document the' + 'AboutCode-toolkit provides a simple way to document the' 'provenance (i.e. origin and license) of software components that' 'you use in your project. This documentation is stored in *.ABOUT' 'files, side-by-side with the documented code.' @@ -79,7 +79,9 @@ def read(*names, **kwargs): }, entry_points={ 'console_scripts': [ - 'about-code=attributecode.cmd:cli', + 'aboutcode=aboutcode.cmd:cli', + # TODO deprecate me: this is kept for compatibility + 'about-code=aboutcode.cmd:cli', ] }, ) diff --git a/src/attributecode/__init__.py b/src/aboutcode/__init__.py similarity index 99% rename from src/attributecode/__init__.py rename to src/aboutcode/__init__.py index fca28123..d36bce49 100644 --- a/src/attributecode/__init__.py +++ b/src/aboutcode/__init__.py @@ -27,7 +27,7 @@ basestring = str # Python 3 -__version__ = '3.0.2' +__version__ = '3.1.0' __about_spec_version__ = '3.0.0' diff --git a/src/attributecode/api.py b/src/aboutcode/api.py similarity index 98% rename from src/attributecode/api.py rename to src/aboutcode/api.py index 32a7dea3..b81c3fdf 100644 --- a/src/attributecode/api.py +++ b/src/aboutcode/api.py @@ -28,8 +28,8 @@ from urllib.request import urlopen, Request from urllib.error import HTTPError, URLError -from attributecode import ERROR -from attributecode import Error +from aboutcode import ERROR +from aboutcode import Error """ diff --git a/src/attributecode/attrib.py b/src/aboutcode/attrib.py similarity index 97% rename from src/attributecode/attrib.py rename to src/aboutcode/attrib.py index b0ce1044..c6f45e60 100644 --- a/src/attributecode/attrib.py +++ b/src/aboutcode/attrib.py @@ -28,12 +28,12 @@ import jinja2 -import attributecode -from attributecode import ERROR -from attributecode import Error -from attributecode.licenses import COMMON_LICENSES -from attributecode.model import parse_license_expression -from attributecode.util import add_unc +import aboutcode +from aboutcode import ERROR +from aboutcode import Error +from aboutcode.licenses import COMMON_LICENSES +from aboutcode.model import parse_license_expression +from aboutcode.util import add_unc def generate(abouts, template_string=None): @@ -177,7 +177,7 @@ def generate_and_save(abouts, output_location, use_mapping=False, try: # Return a list which contains only the about file path - about_list = attributecode.util.get_about_file_path( + about_list = aboutcode.util.get_about_file_path( inventory_location, use_mapping=use_mapping) # FIXME: why catching all exceptions? except Exception: diff --git a/src/attributecode/cmd.py b/src/aboutcode/cmd.py similarity index 97% rename from src/attributecode/cmd.py rename to src/aboutcode/cmd.py index 1cc2eea0..07760cf0 100644 --- a/src/attributecode/cmd.py +++ b/src/aboutcode/cmd.py @@ -28,15 +28,15 @@ # silence unicode literals warnings click.disable_unicode_literals_warning = True -from attributecode import __about_spec_version__ -from attributecode import __version__ -from attributecode.attrib import generate_and_save as attrib_generate_and_save -from attributecode.gen import generate as gen_generate -from attributecode import model -from attributecode import severities -from attributecode.util import extract_zip -from attributecode.util import ignore_about_resource_path_not_exist_error -from attributecode.util import to_posix +from aboutcode import __about_spec_version__ +from aboutcode import __version__ +from aboutcode.attrib import generate_and_save as attrib_generate_and_save +from aboutcode.gen import generate as gen_generate +from aboutcode import model +from aboutcode import severities +from aboutcode.util import extract_zip +from aboutcode.util import ignore_about_resource_path_not_exist_error +from aboutcode.util import to_posix __copyright__ = """ diff --git a/src/attributecode/gen.py b/src/aboutcode/gen.py similarity index 97% rename from src/attributecode/gen.py rename to src/aboutcode/gen.py index a2e531f5..a80ab383 100644 --- a/src/attributecode/gen.py +++ b/src/aboutcode/gen.py @@ -31,15 +31,15 @@ # Python 3 import csv -from attributecode import ERROR -from attributecode import CRITICAL -from attributecode import Error -from attributecode import model -from attributecode.model import check_file_field_exist -from attributecode import util -from attributecode.util import add_unc -from attributecode.util import to_posix -from attributecode.util import UNC_PREFIX_POSIX +from aboutcode import ERROR +from aboutcode import CRITICAL +from aboutcode import Error +from aboutcode import model +from aboutcode.model import check_file_field_exist +from aboutcode import util +from aboutcode.util import add_unc +from aboutcode.util import to_posix +from aboutcode.util import UNC_PREFIX_POSIX LOG_FILENAME = 'error.log' diff --git a/src/attributecode/licenses.py b/src/aboutcode/licenses.py similarity index 100% rename from src/attributecode/licenses.py rename to src/aboutcode/licenses.py diff --git a/src/attributecode/mapping.config b/src/aboutcode/mapping.config similarity index 97% rename from src/attributecode/mapping.config rename to src/aboutcode/mapping.config index 47fa9f1a..b9f79668 100644 --- a/src/attributecode/mapping.config +++ b/src/aboutcode/mapping.config @@ -11,7 +11,7 @@ # * name # # Syntax: -# : +# : # # Example: # Assuming your input have columns "Resource", "Component", "Confirmed Version", "Confirmed Copyright", "Confirmed License" diff --git a/src/attributecode/model.py b/src/aboutcode/model.py similarity index 99% rename from src/attributecode/model.py rename to src/aboutcode/model.py index a6c631f1..2b885ce9 100644 --- a/src/attributecode/model.py +++ b/src/aboutcode/model.py @@ -50,19 +50,19 @@ from license_expression import Licensing -from attributecode import CRITICAL -from attributecode import ERROR -from attributecode import INFO -from attributecode import WARNING -from attributecode import api -from attributecode import Error -from attributecode import saneyaml -from attributecode import util -from attributecode.util import add_unc -from attributecode.util import copy_license_notice_files -from attributecode.util import on_windows -from attributecode.util import UNC_PREFIX -from attributecode.util import UNC_PREFIX_POSIX +from aboutcode import CRITICAL +from aboutcode import ERROR +from aboutcode import INFO +from aboutcode import WARNING +from aboutcode import api +from aboutcode import Error +from aboutcode import saneyaml +from aboutcode import util +from aboutcode.util import add_unc +from aboutcode.util import copy_license_notice_files +from aboutcode.util import on_windows +from aboutcode.util import UNC_PREFIX +from aboutcode.util import UNC_PREFIX_POSIX class Field(object): diff --git a/src/attributecode/saneyaml.py b/src/aboutcode/saneyaml.py similarity index 100% rename from src/attributecode/saneyaml.py rename to src/aboutcode/saneyaml.py diff --git a/src/attributecode/templates/default_html.template b/src/aboutcode/templates/default_html.template similarity index 100% rename from src/attributecode/templates/default_html.template rename to src/aboutcode/templates/default_html.template diff --git a/src/attributecode/templates/default_json.template b/src/aboutcode/templates/default_json.template similarity index 100% rename from src/attributecode/templates/default_json.template rename to src/aboutcode/templates/default_json.template diff --git a/src/attributecode/templates/list.csv b/src/aboutcode/templates/list.csv similarity index 100% rename from src/attributecode/templates/list.csv rename to src/aboutcode/templates/list.csv diff --git a/src/attributecode/util.py b/src/aboutcode/util.py similarity index 99% rename from src/attributecode/util.py rename to src/aboutcode/util.py index 0ee8d358..4dc5bd7d 100644 --- a/src/attributecode/util.py +++ b/src/aboutcode/util.py @@ -46,8 +46,8 @@ # Python 3 import http.client as httplib -from attributecode import CRITICAL -from attributecode import Error +from aboutcode import CRITICAL +from aboutcode import Error on_windows = 'win32' in sys.platform @@ -201,7 +201,7 @@ def norm(p): else: relative = path[len(base) + 1:] # We don't want to keep the first segment of the root of the returned path. - # See https://github.com/nexB/attributecode/issues/276 + # See https://github.com/nexB/aboutcode/issues/276 # relative = posixpath.join(base_name, relative) return relative diff --git a/src/attributecode/__main__.py b/src/attributecode/__main__.py deleted file mode 100644 index 977d906f..00000000 --- a/src/attributecode/__main__.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf8 -*- - -# ============================================================================ -# Copyright (c) 2013-2017 nexB Inc. http://www.nexb.com/ - All rights reserved. -# Licensed 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. -# ============================================================================ - -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - - -if __name__ == '__main__': - from attributecode import cmd - cmd.cli() diff --git a/tests/test_api.py b/tests/test_api.py index 502170b3..f5eb9e85 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -22,9 +22,9 @@ import mock -from attributecode import api -from attributecode import ERROR -from attributecode import Error +from aboutcode import api +from aboutcode import ERROR +from aboutcode import Error from testing_utils import FakeResponse diff --git a/tests/test_attrib.py b/tests/test_attrib.py index 154dccc0..e62db0c4 100644 --- a/tests/test_attrib.py +++ b/tests/test_attrib.py @@ -22,8 +22,8 @@ from testing_utils import get_test_loc -from attributecode import attrib -from attributecode import model +from aboutcode import attrib +from aboutcode import model class AttribTest(unittest.TestCase): diff --git a/tests/test_cmd.py b/tests/test_cmd.py index 66020dbb..af9b9270 100644 --- a/tests/test_cmd.py +++ b/tests/test_cmd.py @@ -18,14 +18,14 @@ from __future__ import print_function from __future__ import unicode_literals -from attributecode import CRITICAL -from attributecode import DEBUG -from attributecode import ERROR -from attributecode import INFO -from attributecode import NOTSET -from attributecode import WARNING -from attributecode import cmd -from attributecode import Error +from aboutcode import CRITICAL +from aboutcode import DEBUG +from aboutcode import ERROR +from aboutcode import INFO +from aboutcode import NOTSET +from aboutcode import WARNING +from aboutcode import cmd +from aboutcode import Error # NB: these tests depends on py.test stdout/err capture capabilities diff --git a/tests/test_gen.py b/tests/test_gen.py index 077a4fb7..14bc38ba 100644 --- a/tests/test_gen.py +++ b/tests/test_gen.py @@ -24,11 +24,11 @@ from testing_utils import get_temp_dir from testing_utils import get_test_loc -from attributecode import ERROR -from attributecode import INFO -from attributecode import CRITICAL -from attributecode import Error -from attributecode import gen +from aboutcode import ERROR +from aboutcode import INFO +from aboutcode import CRITICAL +from aboutcode import Error +from aboutcode import gen class GenTest(unittest.TestCase): diff --git a/tests/test_model.py b/tests/test_model.py index 19634837..b1a21589 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -27,16 +27,16 @@ import mock -import attributecode -from attributecode import CRITICAL -from attributecode import ERROR -from attributecode import INFO -from attributecode import WARNING -from attributecode import Error -from attributecode import model -from attributecode import util -from attributecode.util import add_unc -from attributecode.util import load_csv +import aboutcode +from aboutcode import CRITICAL +from aboutcode import ERROR +from aboutcode import INFO +from aboutcode import WARNING +from aboutcode import Error +from aboutcode import model +from aboutcode import util +from aboutcode.util import add_unc +from aboutcode.util import load_csv from testing_utils import extract_test_loc from testing_utils import get_temp_file from testing_utils import get_test_loc @@ -1133,7 +1133,7 @@ def test_collect_inventory_return_no_warnings(self): test_loc = get_test_loc('allAboutInOneDir') errors, _abouts = model.collect_inventory(test_loc) expected_errors = [] - result = [(level, e) for level, e in errors if level > attributecode.INFO] + result = [(level, e) for level, e in errors if level > aboutcode.INFO] assert expected_errors == result def test_collect_inventory_populate_about_file_path(self): @@ -1192,7 +1192,7 @@ def test_parse_license_expression_with_special_chara(self): assert expected_spec_char == spec_char def test_collect_inventory_works_with_relative_paths(self): - # FIXME: This test need to be run under src/attributecode/ + # FIXME: This test need to be run under src/aboutcode/ # or otherwise it will fail as the test depends on the launching # location test_loc = get_test_loc('parse/complete') @@ -1339,8 +1339,8 @@ def test_valid_api_url(self, mock_data): mock_data.return_value = '' assert model.valid_api_url('non_valid_url') is False - @mock.patch('attributecode.util.have_network_connection') - @mock.patch('attributecode.model.valid_api_url') + @mock.patch('aboutcode.util.have_network_connection') + @mock.patch('aboutcode.model.valid_api_url') def test_pre_process_and_fetch_license_dict(self, have_network_connection, valid_api_url): have_network_connection.return_value = True diff --git a/tests/test_util.py b/tests/test_util.py index 29549dc7..c5a474aa 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -28,10 +28,10 @@ from testing_utils import on_posix from testing_utils import on_windows -from attributecode import CRITICAL -from attributecode import ERROR -from attributecode import Error -from attributecode import util +from aboutcode import CRITICAL +from aboutcode import ERROR +from aboutcode import Error +from aboutcode import util class UtilsTest(unittest.TestCase): diff --git a/tests/testing_utils.py b/tests/testing_utils.py index ff60e16b..4544bf0e 100644 --- a/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -28,8 +28,8 @@ import tempfile import zipfile -from attributecode.util import add_unc -from attributecode.util import to_posix +from aboutcode.util import add_unc +from aboutcode.util import to_posix logger = logging.getLogger(__name__) @@ -83,7 +83,7 @@ def create_dir(location): | stat.S_IROTH | stat.S_IXOTH) -def build_temp_dir(prefix='test-attributecode-'): +def build_temp_dir(prefix='test-aboutcode-'): """ Create and return a new unique empty directory created in base_dir. """ @@ -92,7 +92,7 @@ def build_temp_dir(prefix='test-attributecode-'): return location -def get_temp_file(file_name='test-attributecode-tempfile'): +def get_temp_file(file_name='test-aboutcode-tempfile'): """ Return a unique new temporary file location to a non-existing temporary file that can safely be created without a risk of name