Skip to content

Update boolean.py library#41

Merged
pombredanne merged 3 commits intomasterfrom
32-update-boolean.py
Oct 16, 2019
Merged

Update boolean.py library#41
pombredanne merged 3 commits intomasterfrom
32-update-boolean.py

Conversation

@steven-esser
Copy link
Contributor

  • Bump boolean.py library to v3.7, which adds the ability to sort OR
    leave boolean expressions unsorted.
  • Add test case for simplify() sorting

Addresses: #32

Signed-off-by: Steven Esser sesser@nexb.com

@steven-esser steven-esser force-pushed the 32-update-boolean.py branch 2 times, most recently from a44c4ab to f8a0c93 Compare October 14, 2019 16:14
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!. See my comment inline


expr = licensing.parse('gpl-2.0 OR apache-2.0 OR gpl-2.0')

self.assertEqual(expr.simplify(), expr.simplify(sort=False))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with gpl-2.0 OR apache-2.0 OR gpl-2.0 I would expect the simplification to be gpl-2.0 OR apache-2.0 ... would you?

Also a small nitpicking: may be we do not need so many empty lines?

Copy link
Contributor Author

@steven-esser steven-esser Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is checking to make sure the expressions themselves are equal, even if the "sort" of the expression is different.

For instance mit OR gpl-2.0 === gpl-2.0 OR mit. These expressions are technically the same data-wise and interpretation-wise. The only difference between the two expressions is the ordering, which the following test on line 560 handles.

The test itself is actually not super clear as to what is going on, so I will update this.

Copy link
Contributor Author

@steven-esser steven-esser Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pombredanne and we probably do not need so many lines, I will fix this :)

* Bump boolean.py library to v3.7, which adds the ability to sort OR
  leave boolean expressions unsorted.
* Add test case for simplify() sorting

Addresses: #32

Signed-off-by: Steven Esser <sesser@nexb.com>
* Update test case code for clarity
* Remove un-needed blank lines
* Update Windows azure pipeline to use python3.7.4

Addresses: #32

Signed-off-by: Steven Esser <sesser@nexb.com>
@steven-esser
Copy link
Contributor Author

@pombredanne ping

the travis builds are timing-out for some unknown reason.

@pombredanne
Copy link
Member

I have restarted the builds

@steven-esser
Copy link
Contributor Author

steven-esser commented Oct 15, 2019

there might be something wrong with the following lines in travis on osx that are causing it to hang:

if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
        rm -rf ~/.pyenv
        git clone https://github.com/pyenv/pyenv.git ~/.pyenv
        echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
        echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
        echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
        exec "$SHELL"
    fi

Do we need to use pyenv for these?:

@pombredanne
Copy link
Member

Do we need to use pyenv for these?

No. Anything works and if you look at the latest travis from scancode, this is quite different now
https://github.com/nexB/scancode-toolkit/blob/develop/.travis.yml

Signed-off-by: Steven Esser <sesser@nexb.com>
@steven-esser
Copy link
Contributor Author

@pombredanne Everything is working now.

@pombredanne
Copy link
Member

Thank you! LGTM... merging.

@pombredanne pombredanne merged commit b483f1d into master Oct 16, 2019
@pombredanne pombredanne deleted the 32-update-boolean.py branch October 16, 2019 12:43
@pombredanne
Copy link
Member

@MaJuRG what is you Pypi username? I will grant you access to make a release

pombredanne pushed a commit that referenced this pull request May 10, 2022
Signed-off-by: Chin Yeung Li <tli@nexb.com>
pombredanne pushed a commit that referenced this pull request May 10, 2022
Fixed #41 - Handled encoding issue when generating ABOUT files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants