Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
26ddd65
Merge branch 'develop'
pombredanne May 5, 2015
96b2372
Updated configure scripts and basic documentation.
pombredanne Jun 8, 2015
601e40e
Update README instruction from v2.0.0 to v2.0.1
chinyeungli Jun 8, 2015
822939d
Update backslash symbol from '\' to '\\'
chinyeungli Jun 8, 2015
179a287
Update the build icon (Travis-CI) target from develop branch to master
chinyeungli Jun 9, 2015
ebb6edd
Replaced badges in the README.rst by their svg version
tdruez Jun 9, 2015
e24ce42
Fixed indentation and linebreaks for proper render in README.rst
tdruez Jun 9, 2015
9cd6c5c
Update the README file to be the same as the one in Master.
chinyeungli Jun 22, 2015
24d8c4d
Update gitignore file.
chinyeungli Jun 22, 2015
4954cd4
Update gitignore file
chinyeungli Jun 22, 2015
9cedb6d
Add test cases file for long path testing
chinyeungli Jun 24, 2015
e0bcbf4
Update version to 2.0.2
chinyeungli Jun 24, 2015
c7df1da
Not support Python26
chinyeungli Jun 25, 2015
a0b6e48
Fix tests
chinyeungli Jun 25, 2015
39025a5
Update copyright date.
chinyeungli Jun 25, 2015
4cfa771
The os.path.abspath(location) is needed when inserting the UNC_PREFIX
chinyeungli Jun 25, 2015
5608055
Strip trailing whitespace to avoid creating invalid file such as
chinyeungli Jun 25, 2015
f8d3529
#195 force the code to use the generated dje_license_key instead of the
chinyeungli Jun 25, 2015
d688079
Fix the test as the os.path.abspath(None) will cause error in linux
chinyeungli Jun 25, 2015
5182b56
Remove the UNC_PREFIX in the path for windows system in the error.log
chinyeungli Jun 25, 2015
5a5b639
#198
chinyeungli Jun 29, 2015
f7f24de
Unify the value in the dictionary list to work with unicode.
chinyeungli Jun 30, 2015
e981f3d
the unified_dict_list is not working. restore the code base.
chinyeungli Jun 30, 2015
6ff8deb
Add code to handle encoding issue.
chinyeungli Jul 6, 2015
55bb878
Update README instruction reference from 2.0.1 to 2.0.2
chinyeungli Jul 6, 2015
0370c66
Update changelog.
chinyeungli Jul 6, 2015
b324135
Update CHANGELOG date.
chinyeungli Jul 6, 2015
8f484c4
Release 2.0.2
chinyeungli Jul 6, 2015
b2de07f
The 'about_relative_path' was not converted to posix path which is
chinyeungli Jul 31, 2015
7c8271d
Merge branch 'v2x_maintenance'
chinyeungli Jul 31, 2015
9491dc5
Update Changelog
chinyeungli Jul 31, 2015
739e24c
Update Changelog
chinyeungli Jul 31, 2015
36e20fc
Update version to 2.0.3
chinyeungli Jul 31, 2015
1ced1c8
Add test code for generate attribtuion function
chinyeungli Jul 31, 2015
6377465
Add test code for generate attribtuion function
chinyeungli Jul 31, 2015
1bca3a5
Update changelog wording
chinyeungli Jul 31, 2015
ad83520
New example files updated.
chinyeungli Aug 10, 2015
03feb76
Update UsingAboutCodetoDocumentYourSoftwareAssets.pdf
chinyeungli Aug 10, 2015
5669839
#210 Added support to run genattrib with a zip file and tests
pombredanne Sep 28, 2015
1c00a29
#210 reverting to old style asserts since we run tests with setuptools
pombredanne Sep 28, 2015
210b4a6
#210 using simpler assrteions that will pass on all OSes
pombredanne Sep 28, 2015
6757e3e
Merge branch '210-zipped-abouts'
chinyeungli Sep 28, 2015
a3126c4
Fixed #217 - add the "Completed" word once the generation is completed.
chinyeungli Sep 28, 2015
2465a7b
Create a test for genattrib to read a zip file with a filter list.
chinyeungli Sep 28, 2015
16e0835
Ignore py.test cache
pombredanne Sep 29, 2015
e632a46
Tests for #218
pombredanne Sep 29, 2015
3efea26
Merge pull request #222 from dejacode/218-root-dir-attrib
chinyeungli Oct 8, 2015
4f28ea4
#221 test zip file with very deep path tree
pombredanne Oct 8, 2015
1a183c4
Code refactoring
chinyeungli Oct 8, 2015
3b3bd59
#221
chinyeungli Oct 8, 2015
1f0f2d7
Fixed #221
chinyeungli Oct 8, 2015
851ed46
Bump to version 2.1.0
chinyeungli Oct 8, 2015
cdf4001
Refactorings and code simplifications
pombredanne Oct 9, 2015
05fef35
Improved CLI error messages
pombredanne Oct 9, 2015
5f2a8f2
Fixed the filtering of dicts with empty values.
pombredanne Oct 9, 2015
2dd08c4
Refined help texts
pombredanne Oct 9, 2015
436796c
Ensured that configure also installs self.
pombredanne Oct 9, 2015
5be7346
Fixed #223 tests
pombredanne Oct 12, 2015
937e570
Updated configure script
pombredanne Oct 12, 2015
8395d0c
#224 appveyor config
pombredanne Oct 12, 2015
d96f4c3
#224 appveyor config
pombredanne Oct 12, 2015
a6f3b4e
Relaxed required dependency verions
pombredanne Oct 12, 2015
1512821
Fixed #220
chinyeungli Oct 15, 2015
1126761
Merge branch 'master' into v2x_maintenance
chinyeungli Oct 15, 2015
b44364e
Merge branch 'absolute_imports' into v2x_maintenance
chinyeungli Oct 16, 2015
153ae67
Fixed #219
chinyeungli Oct 22, 2015
6aecc6c
Update changelog
chinyeungli Oct 22, 2015
da211cc
Update the version in about.ABOUT
chinyeungli Oct 22, 2015
c1204f1
Fixed #230
chinyeungli Oct 30, 2015
fb1fb65
Merge pull request #234 from dejacode/master
pombredanne Nov 26, 2015
29341d1
- Updated the copyright date and version number
chinyeungli Jan 13, 2016
09ba9a2
Update code to support non-html genattrib output file
chinyeungli Jan 13, 2016
44b0e44
Updated test code for #235
chinyeungli Jan 13, 2016
ea8e89a
Add test for apply mappings with same name #235
chinyeungli Jan 13, 2016
c7e80d0
Fix the test for "test_update_about_resource_no_about_file_field_exist"
chinyeungli Feb 16, 2016
2b2b2f4
Update the copyright date.
chinyeungli Feb 16, 2016
b0c8535
Add comments for the "FIXME" comments
chinyeungli Feb 23, 2016
9d2d6b1
Fix test cases
chinyeungli Feb 23, 2016
0871355
Fixed #236
chinyeungli Feb 23, 2016
d6a10e2
#233: Update genabout.py to work with DejaCode API v2
tdruez Feb 24, 2016
b536c64
Fixed #199
chinyeungli Feb 25, 2016
2735d12
Remove .Python file, added in .gitignore
tdruez Feb 29, 2016
38058ea
Merge remote-tracking branch 'origin/v2x_maintenance'
pombredanne Mar 28, 2016
69f4a20
Bumped version to 2.3.1
pombredanne Mar 28, 2016
3ce7dff
Update the UsingAboutCodetoDocumentYourSoftwareAssets.pdf
chinyeungli Jun 26, 2016
54966e0
Bumped version to 2.3.2
chinyeungli Jun 26, 2016
53641d2
Update README.rst
chinyeungli Jun 27, 2016
a480b35
Bump to version 2.3.3
chinyeungli Sep 8, 2016
abe8e85
Linux Installation - Directory name
Oct 20, 2016
22c95b7
Merge pull request #266 from UShan89/master
pombredanne Oct 20, 2016
1f3d62f
Merge branch 'master' of https://github.com/nexB/attributecode.git
chinyeungli Nov 29, 2016
0148638
Add the `json_template.template` under the templates/
chinyeungli Nov 29, 2016
d12818c
#267 Modify MAPPING.CONFIG check by prepending directory of genabout.…
JonoYang Nov 30, 2016
244b9f9
Merge pull request #268 from nexB/267-MAPPING.CONFIG-not-detected
steven-esser Nov 30, 2016
c87c1ff
#270 Look for MAPPING.CONFIG in the same directory as genattrib.py by…
JonoYang Dec 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.py[cod]
.Python

/build
/bin
Expand All @@ -9,6 +10,7 @@ lib64
/Lib
/Scripts
/include
/local

# Installer logs
pip-log.txt
Expand All @@ -29,4 +31,6 @@ nosetests.xml

# PyCharm project
.idea/
/about_code_tool.egg_info

/*.egg-info/
/.cache/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python

python:
- "2.6"
- "2.7"
install:
- source configure etc/conf
Expand Down
208 changes: 134 additions & 74 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ABOUT tool
==========
AboutCode tool
==============

.. image:: https://api.travis-ci.org/dejacode/about-code-tool.png?branch=develop
:target: https://travis-ci.org/dejacode/about-code-tool
.. image:: https://travis-ci.org/dejacode/about-code-tool.svg?branch=master
:target: https://travis-ci.org/dejacode/about-code-tool

.. image:: https://coveralls.io/repos/dejacode/about-code-tool/badge.png?branch=develop
:target: https://coveralls.io/r/dejacode/about-code-tool?branch=develop
.. image:: https://coveralls.io/repos/dejacode/about-code-tool/badge.svg?branch=master
:target: https://coveralls.io/r/dejacode/about-code-tool?branch=master


The ABOUT tool and ABOUT files provide a simple way to document the
The AboutCode tool and ABOUT files provide a simple way to document the
(origin and license) and other important or interesting information about
third-party software components that you use in your project.

Expand All @@ -19,66 +19,108 @@ For more information on the ABOUT file format, visit http://www.dejacode.org
There are many examples of ABOUT files (valid or invalid) in the testdata/
directory of the whole repository.

The current version of the ABOUT tool can read these ABOUT files so that you
The current version of AboutCode can read these ABOUT files so that you
can collect and validate the inventory of third-party components that you use.

In future versions, this tool will be able to generate attribution notices and
collect redistributable source code used in your project to help you comply
with open source licenses requirements.
This version of AboutCode follows the ABOUT specification version 1.0.0 at:
https://github.com/dejacode/about-code-tool/blob/master/SPEC

This version of the ABOUT tool follows the ABOUT specification version 0.8.1 at:
http://www.dejacode.org/about_spec_v0.8.1.html

License
-------
AboutCode is released under the Apache 2.0 license.
See (of course) the about.ABOUT file for details.

REQUIREMENTS

Requirements
------------
The ABOUT tool is tested with Python 2.6 or 2.7 on Linux, Mac and Windows.
You will need to install a Python interpreter if you do not have one already
installed.
The AboutCode tool requires an installation Python 2.7 on Linux, Mac and Windows.
You need to install Python if you do not have one already installed.

On Linux and Mac, Python is typically pre-installed. To verify which
version may be pre-installed, open a terminal and type::

python --version
python2.6 --version
python2.7 --version

On Windows or Mac, you can download the latest Python 2.7.x here:
https://www.python.org/downloads/
On Linux, Python2.7 may be available from your distro package manager.

On Windows and Mac if version 2.7 is not installed, you can download the latest
Python 2.7.x here https://www.python.org/downloads/ :

Download the .msi installer for Windows or the .dmg archive for Mac.
Open and run the installer using all the default options.
* Download the .msi installer for Windows or the .dmg archive for Mac.
* Open and run the installer using all the default options.
* On Windows, make sure you install Python in the default c:\\Python27 and not
on another drive.


INSTALLATION
Installation
------------
Checkout or download and extract the AboutCode tool from:
https://github.com/dejacode/about-code-tool/
Download the AboutCode tool from a released version at:
https://github.com/dejacode/about-code-tool/releases

Extract the archive to a directory and open a command prompt or shell in this
directory. Then on Linux or Mac run::

source configure

And on Windows::

To install all the needed dependencies in a virtualenv, run (on posix)::
source configure
or on windows::
configure


TESTS
-----
To verify that everything works fine you can run the test suite with::
python setup.py test
For instance on Linux the whole installation would be like this::

$ wget https://github.com/dejacode/about-code-tool/archive/v2.3.2.zip
$ unzip v2.3.2.zip
$ cd attributecode-2.3.2/
$ source configure

On Windows, the whole installation would be like this:

* Download and extract https://github.com/dejacode/about-code-tool/archive/v2.3.2.zip
* open a command prompt and cd to the directory where the zip extraction directory
* run configure

USAGE

Later on, if opening a new shell or command prompt on an already installed
AboutCode you need to **activate** this installation.

On Linux or Mac, run this::

source bin/activate

On Windows, run this::

bin\\activate


Usage
-----
The ABOUT tool command syntax is:
Once installed, the AboutCode tool is used from the command line.
There are three scripts: about.py, genabout.py and genattrib.py.
Once you have installed or activated AboutCode, the scripts are invoked from a
shell or command prompt in this way::

$ python about_code_tool/about.py <options ....>


See docs/UsingAboutCodetoDocumentYourSoftwareAssets.pdf for a detailed
documentation and tutorial or read on the quick instructions below.


**Using the about.py script**

**about.py**
The about.py script is used to collect existing ABOUT files, validate that
they are correct and collect inventories of the documented components in a CSV
file.

::

Usage: about.py [options] input_path output_path

Input can be a file or directory.
Output must be a file with a .csv extension.
input_path can be a file or directory containing .ABOUT files.
output_path is a file with a .csv extension.

Options:
-h, --help Display help
Expand All @@ -92,20 +134,26 @@ The ABOUT tool command syntax is:

Example::

$ python about.py ./thirdparty_code/ thirdparty_about.csv
$ python about_code_tool/about.py ./thirdparty/ thirdparty_about.csv

In this example, the .ABOUT files in the directory /thirdparty_code/ will

In this example, the .ABOUT files in the directory thirdparty/ will
be parsed and validated to collect the data they contain. The collected
information will be saved to the CSV file named "thirdparty_about.csv".

**genabout.py**


**Using the genabout.py script**

The genabout.py script is used to generate new ABOUT files by using a CSV file
as an input.

::

Usage: genabout.py [options] input_path output_path

Input must be a CSV file
Output must be a directory location where the ABOUT files should be generated
input_path is a CSV file using the same format as the CSV created with about.py
output_path is a directory where the new .ABOUT files are generated


Options:
Expand All @@ -131,39 +179,44 @@ information will be saved to the CSV file named "thirdparty_about.csv".
Copy the 'license_text_file' from the directory to the generated location
License path - License text files path

--mapping Configure the mapping key from the MAPPING.CONFIG
--mapping Use the mapping between columns names in your CSV and the ABOUT field
names as defined in the MAPPING.CONFIG mapping configuration file.

--extract_license=EXTRACT_LICENSE
--extract_license
Extract License text and create <license_key>.LICENSE side-by-side
with the .ABOUT from DJE License Library.
api_url - URL to the DJE License Library
api_username - The regular DJE username
api_key - Hash attached to your username which is used to authenticate
yourself in the API. Contact us to get the hash key.

with the generated .ABOUT file using data fetched from a DejaCode License Library.
The following additional options are required:
--api_url - URL to the DejaCode License Library API endpoint
--api_key - DejaCode API key

Example syntax:
genabout.py --extract_license --api_url='api_url' --api_username='api_username' --api_key='api_key'
python about_code_tool/genabout.py --extract_license --api_url='api_url' --api_key='api_key'


Example::

$ python genabout.py thirdparty_code.csv /tmp/thirdparty_about/
$ mkdir tmp
$ python about_code_tool/genabout.py thirdparty_code.csv tmp/thirdparty_about

In this example, the tool will use the list in the "thirdparty_code.csv" file
and generate .ABOUT files in a directory tmp/thirdparty_about/

In this example, the tool will look at the "thirdparty_code.csv" and generate
the .ABOUT files in the directory /tmp/thirdparty_about/.

**Using the genattrib.py script**

**genattrib.py**
The genattrib.py script is used to generate a credit and license attribution
documentation in HTML from a directory containing .ABOUT files.

::

Usage: genattrib.py [options] input_path output_path component_list

Input can be a file or directory.
Output of rendered template must be a file (e.g. .html).
Component List must be a .csv file which has at least an "about_file" column.



input can be a file or directory.
output of rendered template must be a file (e.g. .html).
component_list is an optional .csv file with an "about_file" column.
It is used to limit the attribution generation to the subset of
ABOUT files listed here.

Options:
-h, --help Display help
-v, --version Display current version, license notice, and copyright notice
Expand All @@ -181,7 +234,7 @@ the .ABOUT files in the directory /tmp/thirdparty_about/.

Example::

$ python genattrib.py /tmp/thirdparty_about/ /tmp/thirdparty_attribution/attribution.html thirdparty_code.csv
$ python about_code_tool/genattrib.py tmp/thirdparty_about/ tmp/attribution.html thirdparty_code.csv

In this example, the tool will look at the .ABOUT files listed in the "thirdparty_code.csv"
from the /tmp/thirdparty_about/ and then generate the attribution output to
Expand All @@ -190,7 +243,9 @@ from the /tmp/thirdparty_about/ and then generate the attribution output to

(See USAGE for a details explaining of each scripts and options.)

HELP and SUPPORT


Help and Support
----------------
If you have a question or find a bug, enter a ticket at:

Expand All @@ -201,19 +256,24 @@ For issues, you can use:
https://github.com/dejacode/about-code-tool/issues


SOURCE CODE
-----------
AboutCode is available through GitHub. For the latest version visit:
Hacking, tests and source code
------------------------------
For the latest stable version visit::

https://github.com/dejacode/about-code-tool

The development takes places in the develop branch. We use the git flow
branching model.

HACKING
-------
We accept pull requests provided under the same license as this tool.
You agree to the http://developercertificate.org/
**Tests**

You can run the test suite with::

LICENSE
-------
AboutCode is released under the Apache 2.0 license.
See (of course) the about.ABOUT file for details.
python setup.py test


**Contributing**

We accept bugs, patches and pull requests for code and documentation provided
under the same license (Apache-2.0) as this tool.
When contributing, you are agreeing to the http://developercertificate.org/
14 changes: 6 additions & 8 deletions USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ genabout.py
Extract License text and create <license_key>.LICENSE side-by-side
with the .ABOUT from DJE License Library.
api_url - URL to the DJE License Library
api_username - The regular DJE username
api_key - Hash attached to your username which is used to authenticate
yourself in the API. Contact us to get the hash key.
api_key - Hash which is used to authenticate yourself in the API.
Contact us to get the hash key.

Example syntax:
genabout.py --extract_license --api_url='api_url' --api_username='api_username' --api_key='api_key'
genabout.py --extract_license --api_url='api_url' --api_key='api_key'

Purpose
-------
Expand Down Expand Up @@ -177,12 +176,11 @@ Options

This option requires 3 parameters:
api_url - URL to the DJE License Library
api_username - The regular DJE username
api_key - Hash attached to your username which is used to authenticate
yourself in the API.
api_key - Hash which is used to authenticate yourself in the API.
Contact us to get the hash key.
(Please contact us to get the api_* value to use this feature)

$ python genabout.py --extract_license --api_url='api_url' --api_username='api_username' --api_key='api_key' <input path> <output path>
$ python genabout.py --extract_license --api_url='api_url' --api_key='api_key' <input path> <output path>


genattrib.py
Expand Down
4 changes: 2 additions & 2 deletions about.ABOUT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
about_resource: .

name: AboutCode
version: 2.0.0
version: 2.3.3


owner: nexB Inc.
Expand All @@ -21,6 +21,6 @@ description: AboutCode is a tool to process ABOUT files. An ABOUT file
dje_license: apache-2.0
license_text_file: apache-2.0.LICENSE
license_spdx: Apache-2.0
copyright: Copyright (c) 2013-2015 nexB Inc.
copyright: Copyright (c) 2013-2016 nexB Inc.

notice_file: NOTICE
Loading