Skip to content

Commit

Permalink
Fixed the development branch configuration
Browse files Browse the repository at this point in the history
 * fixed the setup.cfg
 * updated to use the latest configure script
  • Loading branch information
pombredanne committed Oct 23, 2015
1 parent 69d794b commit 3978cd8
Show file tree
Hide file tree
Showing 62 changed files with 185 additions and 227 deletions.
37 changes: 24 additions & 13 deletions .gitignore
@@ -1,35 +1,46 @@
*.py[cod]

# virtualenv and other misc bits
*.egg-info
/dist
/build
/bin
/var
/lib
lib64
/Include
/Lib
/scripts
/Scripts
/Lib
/pip-selfcheck.json
/tmp
.Python
/include
/Include
/local

# Installer logs
pip-log.txt

# Unit test / coverage reports
.cache
.coverage
.tox
.coverage.*
nosetests.xml
htmlcov

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
# IDEs
.project
.pydevproject
/.settings
.idea

# PyCharm project
.idea/
/aboutcode.egg_info
AboutCode.egg-info
/dist
# Sphinx
docs/_build

.DS_Store
*~
.*.sw[po]
.build
.ve
*.bak
/.cache/
138 changes: 10 additions & 128 deletions README.rst
Expand Up @@ -40,7 +40,6 @@ 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:
Expand All @@ -61,134 +60,17 @@ or on windows::
configure


TESTS
-----
TESTS and DEVLOPMENT
--------------------
To install all the needed development dependencies, run (on posix)::
source configure etc/conf/dev
or on windows::
configure etc/conf/dev

To verify that everything works fine you can run the test suite with::
python setup.py test


USAGE
-----
The ABOUT tool command syntax is:

**about.py**

::

Usage: about.py [options] input_path output_path

Input can be a file or directory.
Output must be a file with a .csv extension.

Options:
-h, --help Display help
--version Display current version, license notice, and copyright notice
--overwrite Overwrites the output file if it exists
--verbosity=VERBOSITY
Print more or fewer verbose messages while processing ABOUT files
0 - Do not print any warning or error messages, just a total count (default)
1 - Print error messages
2 - Print error and warning messages

Example::

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

In this example, the .ABOUT files in the directory /thirdparty_code/ 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**

::

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
Options:
-h, --help Display help
--version Display current version, license notice, and copyright notice
--verbosity=VERBOSITY
Print more or fewer verbose messages while processing ABOUT files
0 - Do not print any warning or error messages, just a total count (default)
1 - Print error messages
2 - Print error and warning messages
--action=ACTION Handle different behaviors if ABOUT files already existed
0 - Do nothing if ABOUT file existed (default)
1 - Overwrites the current ABOUT field value if existed
2 - Keep the current field value and only add the "new" field and field value
3 - Replace the ABOUT file with the current generation

--copy_files=COPY_FILES
Copy the '*_file' from the project to the generated location
Project path - Project path

--license_text_location=LICENSE_TEXT_LOCATION
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
--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.
Example syntax:
genabout.py --extract_license --api_url='api_url' --api_username='api_username' --api_key='api_key'


Example::

$ python genabout.py thirdparty_code.csv /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/.


**genattrib.py**

::

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.
Options:
-h, --help Display help
-v, --version Display current version, license notice, and copyright notice
--overwrite Overwrites the output file if it exists
--verbosity=VERBOSITY
Print more or fewer verbose messages while processing ABOUT files
0 - Do not print any warning or error messages, just a total count (default)
1 - Print error messages
2 - Print error and warning messages

--template_location=TEMPLATE_LOCATION
Use the custom template for the Attribution Generation

--mapping Configure the mapping key from the MAPPING.CONFIG

Example::

$ python genattrib.py /tmp/thirdparty_about/ /tmp/thirdparty_attribution/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
/tmp/thirdparty_attribution/attribution.html


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



HELP and SUPPORT
----------------
Expand Down
2 changes: 1 addition & 1 deletion about2.ABOUT
@@ -1,7 +1,7 @@
about_resource: .

name: AboutCode
version: 2.0.0.dev2
version: 3.0.0-dev

owner: nexB Inc.
author: Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez
Expand Down
12 changes: 8 additions & 4 deletions configure
Expand Up @@ -6,7 +6,9 @@
# change these variables to customize this script locally
################################
# you can define one or more thirdparty dirs, each prefixed with TPP_DIR
export TPP_DIR="thirdparty"
export TPP_DIR_BASE="thirdparty/base"
export TPP_DIR_PROD="thirdparty/prod"
export TPP_DIR_DEV="thirdparty/dev"

# default configurations
CONF_DEFAULT="etc/conf"
Expand All @@ -23,7 +25,9 @@ if [ "$1" == "" ]; then
CFG_CMD_LINE_ARGS=$CONF_DEFAULT
fi

python2.7 etc/configure.py $CFG_CMD_LINE_ARGS
if [ -f "bin/activate" ]; then
source bin/activate
CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

python2.7 $CONFIGURE_ROOT_DIR/etc/configure.py $CFG_CMD_LINE_ARGS
if [ -f "$CONFIGURE_ROOT_DIR/bin/activate" ]; then
source $CONFIGURE_ROOT_DIR/bin/activate
fi
39 changes: 27 additions & 12 deletions configure.bat
Expand Up @@ -6,40 +6,55 @@
@rem # change these variables to customize this script locally
@rem ################################
@rem # you can define one or more thirdparty dirs, each prefixed with TPP_DIR
set TPP_DIR=thirdparty
set TPP_DIR_BASE=thirdparty/base
set TPP_DIR_PROD=thirdparty/prod
set TPP_DIR_DEV=thirdparty/dev


@rem # default configurations
set CONF_DEFAULT="etc/conf"
@rem #################################

set CFG_CMD_LINE_ARGS=
set ABOUT_ROOT_DIR=%~dp0
set ABOUT_CLI_ARGS=
@rem Collect/Slurp all command line arguments in a variable
:collectarg
if ""%1""=="""" (
goto continue
)
call set CFG_CMD_LINE_ARGS=%CFG_CMD_LINE_ARGS% %1
call set ABOUT_CLI_ARGS=%ABOUT_CLI_ARGS% %1
shift
goto collectarg

:continue

@rem default configuration when no args are passed
if "%CFG_CMD_LINE_ARGS%"==" " (
set CFG_CMD_LINE_ARGS="%CONF_DEFAULT%"
if "%ABOUT_CLI_ARGS%"==" " (
set ABOUT_CLI_ARGS="%CONF_DEFAULT%"
goto configure
)

if "%CFG_CMD_LINE_ARGS%"==" --init" (
set CFG_CMD_LINE_ARGS="%CONF_INIT%"
goto configure
:configure
if not exist "c:\python27\python.exe" (
echo(
echo On Windows, AboutCode requires Python 2.7.x 32 bits to be installed first.
echo(
echo Please download and install Python 2.7 ^(Windows x86 MSI installer^) version 2.7.10.
echo Install Python on the c: drive and use all default installer options.
echo Do NOT install Python v3 or any 64 bits edition.
echo Instead download Python from this url and see the README.rst file for more details:
echo(
echo https://www.python.org/ftp/python/2.7.10/python-2.7.10.msi
echo(
exit /b 1
)

:configure
call c:\Python27\python.exe etc/configure.py %CFG_CMD_LINE_ARGS%
if exist bin\activate (
bin\activate
call c:\python27\python.exe %ABOUT_ROOT_DIR%etc\configure.py %ABOUT_CLI_ARGS%
if %errorlevel% neq 0 (
exit /b %errorlevel%
)
if exist %SCANCODE_ROOT_DIR%bin\activate (
%SCANCODE_ROOT_DIR%bin\activate
)
goto EOS

Expand Down
21 changes: 9 additions & 12 deletions etc/conf/base.txt
@@ -1,20 +1,14 @@
# Base
certifi==14.05.14
setuptools==7.0
wheel==0.24.0
pip==1.5.6
# Base configuration tools
certifi
setuptools
wheel
pip
wincertstore

# used for templating
jinja2==2.7.3
MarkupSafe==0.23


unicodecsv==0.9.4

pytest==2.6.1
colorama==0.3.1
py==1.4.23

click==3.3

schematics==1.0-0
Expand All @@ -23,4 +17,7 @@ six

pyyaml==3.11


unicodecsv==0.9.4

-e .
5 changes: 5 additions & 0 deletions etc/conf/dev/base.txt
@@ -0,0 +1,5 @@
# for tests
pytest==2.6.1
colorama==0.3.1
py==1.4.23

0 comments on commit 3978cd8

Please sign in to comment.