forked from Unstructured-IO/unstructured
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: check dependency licenses in CI (Unstructured-IO#3349)
### Summary Adds a CI check to ensure that packages added as dependencies are appropriately licensed. All of the `.txt` files in the `requirements` directory are checked with the exception of: - `constraints.txt`, since those are not installed and are instead conditions on the other dependency files - `dev.txt`, since those are for local development and not shipped as part of the `unstructured` package - `extra-pdf-image.txt` - the `extra-pdf-image.in` since checking `extra-pdf-image.txt` pulls in NVIDIA GPU related packages with an `Other/Proprietary` license type, and there's not a good way to exclude those without adding `Other/Proprietary` to the allowed licenses list. ### Testing The new `check-licenses` job should pass in CI.
- Loading branch information
1 parent
3d6e30a
commit ee2b247
Showing
21 changed files
with
158 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Authorized and unauthorized licenses in LOWER CASE | ||
[Licenses] | ||
authorized_licenses: | ||
###################### | ||
# Permissive Licenses | ||
###################### | ||
|
||
# Apache-2.0 | ||
apache | ||
apache 2.0 | ||
apache-2.0 | ||
apache software license | ||
apache software | ||
apache license v2.0 | ||
apache license 2.0 | ||
apache license, version 2.0 | ||
|
||
# BSD | ||
bsd | ||
new bsd | ||
bsd license | ||
new bsd license | ||
simplified bsd | ||
3-clause bsd | ||
freebsd | ||
bsd 3-clause | ||
|
||
# MIT | ||
mit | ||
mit license | ||
|
||
# ISC | ||
isc license | ||
isc license (iscl) | ||
|
||
# The Unlicense | ||
the unlicense (unlicense) | ||
|
||
# HPND | ||
historical permission notice and disclaimer (hpnd) | ||
|
||
######################### | ||
# Weak Copy Left Licenses | ||
######################### | ||
|
||
# MPL-2.0 | ||
mozilla public license 2.0 (mpl 2.0) | ||
|
||
# LGPL | ||
gnu lesser general public license v2 or later (lgplv2+) | ||
gnu lgpl | ||
lgpl with exceptions or zpl | ||
gnu library or lesser general public license (lgpl) | ||
gnu lesser general public license v3 (lgplv3) | ||
gnu general public license v2 (gplv2) | ||
|
||
# PSF-2.0 | ||
python software foundation | ||
python software foundation license | ||
|
||
|
||
unauthorized_licenses: | ||
########################### | ||
# Strong Copy Left Licenses | ||
########################### | ||
gpl v3 | ||
|
||
[Authorized Packages] | ||
# Apache-2.0 https://github.com/chroma-core/hnswlib#Apache-2.0-1-ov-file | ||
chroma-hnswlib: >=0.7.3 | ||
# MIT https://github.com/facebookresearch/iopath?tab=MIT-1-ov-file#readme | ||
iopath: >=0.1.10 | ||
# BSD https://github.com/PDFium/PDFium?tab=BSD-3-Clause-1-ov-file#readme | ||
pypdfium2: >=4.30.0 | ||
# MIT https://github.com/voyage-ai/voyageai-python?tab=MIT-1-ov-file#readme | ||
voyageai: >=0.2.3 | ||
# OpenLDAP Public License, which is a permissive BSD style license | ||
# https://github.com/jnwatson/py-lmdb/?tab=License-1-ov-file#readme | ||
lmdb: >=1.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
# | ||
# pip-compile ./ingest/kafka.in | ||
# | ||
confluent-kafka==2.4.0 | ||
confluent-kafka==2.5.0 | ||
# via -r ./ingest/kafka.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ types-tabulate | |
vcrpy | ||
grpcio | ||
autoflake | ||
liccheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
REQUIREMENTS_FILES=$(find requirements -type f -name "*.txt" \ | ||
-name "extra-pdf-image.in" \ | ||
! -name "extra-pdf-image.txt" \ | ||
! -name "constraints.txt" \ | ||
! -name "dev.txt") | ||
|
||
for REQUIREMENTS_FILE in $REQUIREMENTS_FILES; do | ||
echo "Checking $REQUIREMENTS_FILE" | ||
liccheck -r "$REQUIREMENTS_FILE" | ||
EXIT_CODE=$? | ||
if [ "$EXIT_CODE" -eq 0 ]; then | ||
echo "All dependencies have authorized licenses." | ||
else | ||
echo "There are dependencies with unauthorized or unknown licenses." | ||
exit 1 | ||
fi | ||
done | ||
|
||
exit 0 |