Closed adriangonz closed 4 years ago
@adamchainz Thanks for the report and suggestions.
I will be using the glob.glob()
results sorted in the next release to provide consistent output.
This issue is addressed in version 2.2.1. https://pypi.org/project/pip-licenses/2.2.1/
If your problem is resolved, please close this issue.
@raimon49 thanks for the fix! That was really quick!!
I can confirm that the issue is now resolved in 2.2.1
.
The way that
pip-licenses
finds license objects in a repo, is by globbingLICENSE*
,LICENCE*
andCOPYING*
. However, the output ofglob.glob
in Python seems to be dependant on the environment.https://github.com/raimon49/pip-licenses/blob/9c8325920eb3c3e77e0c7e9304c48b7ea9f91c56/piplicenses.py#L131-L151
This becomes an issue in repositories like
cryptography
, where you have 3 different license files:LICENSE.APACHE
,LICENSE.BSD
andLICENSE.PSF
. Therefore, depending on the environment,pip-licenses
will choose one or another.Suggested solution
One way to fix this would be to sort the output of
glob.glob()
, so that it's consistent regardless of the environment.