Skip to content

Commit 7ffab9d

Browse files
authored
Merge pull request #31 from nexB/29-parse-spaces
Parse expressions with nested license names and spaces
2 parents 62a59d5 + 872d97b commit 7ffab9d

19 files changed

Lines changed: 1761 additions & 1116 deletions

.travis.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,48 @@
1-
# This deliberately is not "python" as a work-around to support
2-
# multi-os builds with custom Python versions in Travis CI.
3-
language: cpp
4-
5-
os:
6-
- osx
7-
- linux
1+
language: generic
82

93
env:
104
matrix:
11-
- PYTHON_EXE="`pyenv install -s 2.7.13 && pyenv local 2.7.13`"
12-
- PYTHON_EXE="`pyenv install -s 3.5.3 && pyenv local 3.5.3`"
5+
- PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
136
- PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"
147

8+
9+
# Travis does not offer OSX with arbitrary python versions (like 2.7.13 above)
10+
# So, you cannot simply have the following section in your build matrix:
11+
# os:
12+
# - linux
13+
# - osx
14+
# Instead, you have to include OSX entries into the build matrix manually.
15+
# In particular, this means specifying the environment variables again.
16+
17+
# The following was adapted from here:
18+
# https://docs.travis-ci.com/user/multi-os/
19+
# Set `language: generic` to clear `language: python` from above
20+
# Set `python:` (to empty) to clear it from the travis-ci web interface
21+
# Set `osx_image: xcode7.3` to pin OSX version see here:
22+
# https://docs.travis-ci.com/user/osx-ci-environment/
23+
24+
matrix:
25+
include:
26+
- os: osx
27+
language: generic
28+
python:
29+
osx_image: xcode7.3
30+
env: PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
31+
- os: osx
32+
language: generic
33+
python:
34+
osx_image: xcode7.3
35+
env: PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"
36+
37+
1538
install:
1639
- pyenv install --list
40+
- echo $PYTHON_EXE
41+
- python --version
1742
- ./configure
1843

1944
before_script:
20-
- bin/pip install aboutcode-toolkit
21-
- bin/about-code check --show-all .
45+
- bin/about-code check --verbose .
2246

2347
script:
2448
- "bin/py.test -vvs"
@@ -32,4 +56,4 @@ notifications:
3256
use_notice: true
3357
skip_join: true
3458
template:
35-
- "%{repository_slug}#%{build_number} (%{branch} - %{commit} : %{author}): %{message} : %{build_url}"
59+
- "%{repository_slug}#%{build_number} (%{branch}-%{commit}:%{author})-%{message}- %{build_url}"

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ And expression can be simplified:
104104
105105
>>> expression2 = ' GPL-2.0 or (mit and LGPL 2.1) or bsd Or GPL-2.0 or (mit and LGPL 2.1)'
106106
>>> parsed2 = licensing.parse(expression2)
107+
>>> str(parsed2)
108+
'GPL-2.0 OR (mit AND LGPL 2.1) OR BSD OR GPL-2.0 OR (mit AND LGPL 2.1)'
107109
>>> assert str(parsed2.simplify()) == 'BSD OR GPL-2.0 OR (LGPL 2.1 AND mit)'
108110
109111
Two expressions can be compared for equivalence and containment:

configure

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,15 @@ CONF_DEFAULT="etc/conf/dev"
1616

1717
CFG_CMD_LINE_ARGS="$@"
1818

19-
if [ "$1" == "--init" ]; then
20-
CFG_CMD_LINE_ARGS=$CONF_INIT
21-
fi
22-
23-
if [ "$1" == "" ]; then
19+
if [[ "$1" == "" ]]; then
2420
# default for dev conf if not argument is provided
2521
CFG_CMD_LINE_ARGS=$CONF_DEFAULT
2622
fi
2723

28-
if [ "$PYTHON_EXE" == "" ]; then
24+
CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25+
26+
if [[ "$PYTHON_EXE" == "" ]]; then
2927
PYTHON_EXE=python
3028
fi
3129

32-
$PYTHON_EXE etc/configure.py $CFG_CMD_LINE_ARGS
30+
$PYTHON_EXE "$CONFIGURE_ROOT_DIR/etc/configure.py" $CFG_CMD_LINE_ARGS

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='license-expression',
20-
version='0.98',
20+
version='0.99',
2121
license='apache-2.0',
2222
description=desc,
2323
long_description=desc,
@@ -30,7 +30,7 @@
3030
include_package_data=True,
3131
zip_safe=False,
3232
classifiers=[
33-
'Development Status :: 4 - Beta',
33+
'Development Status :: 5 - Production/Stable',
3434
'License :: OSI Approved :: Apache Software License',
3535
'Intended Audience :: Developers',
3636
'Operating System :: OS Independent',
@@ -48,6 +48,6 @@
4848
'licence'
4949
],
5050
install_requires=[
51-
'boolean.py >= 3.5, < 4.0.0',
51+
'boolean.py >= 3.6, < 4.0.0',
5252
]
5353
)

0 commit comments

Comments
 (0)