aboutcode-org / license-expression

Utility library to parse, normalize and compare License expressions for Python using a boolean logic engine. For expressions using SPDX or any other license id scheme.
http://aboutcode.org
Other
56 stars 23 forks source link

Deduplicate license expressions correctly #49 #53

Closed chinyeungli closed 3 years ago

chinyeungli commented 3 years ago

Instead of using the simplify() from boolean.py (as it over simplifies the expression and the order cannot be kept), implement a new function Licensing.dedup(expression) to de-duplicate the license_expression and keep the order of the license key.

Signed-off-by: Chin Yeung Li tli@nexb.com

chinyeungli commented 3 years ago

@pombredanne do we want to support python27? Note that the code contains str which doesn't work with python27 and, I believe, that's the reason why many tests are failing.

pombredanne commented 3 years ago

@pombredanne do we want to support python27? Note that the code contains str which doesn't work with python27 and, I believe, that's the reason why many tests are failing.

@chinyeungli time to drop Python 2 support alright! Just make sure this is advertized as a major version and documented in your changelog

AyanSinhaMahapatra commented 3 years ago

@pombredanne ping, since it's required in https://github.com/nexB/scancode.io/issues/103#issuecomment-815665295 section 3-> Incorrect license simplification.

pombredanne commented 3 years ago

do we want to support python27? Note that the code contains str which doesn't work with python27 and, I believe, that's the reason why many tests are failing.

Nope, we want to drop it alright

pombredanne commented 3 years ago

All tests are passing on Appveyor and Travis. Azure is clogged so we will ignore it.