diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 881dda180..22c95bd8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,34 @@ on: workflow_dispatch: jobs: + LicenseChecks: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Install Dependencies + # TODO: fix errors so that we can run `make dev` instead + run: | + # Setup Virtual Environment + python3 -m venv ./.venv + source .venv/bin/activate + poetry install + + - name: Check license + run: | + source .venv/bin/activate + .venv/bin/pip install greenlet + .venv/bin/liccheck Linting: runs-on: ubuntu-latest strategy: diff --git a/poetry.lock b/poetry.lock index e4df2a28d..96e3daa99 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2852,13 +2852,9 @@ jsonschema-specifications = ">=2023.03.6" referencing = ">=0.28.4" rfc3339-validator = {version = "*", optional = true, markers = "extra == \"format-nongpl\""} rfc3986-validator = {version = ">0.1.0", optional = true, markers = "extra == \"format-nongpl\""} -rfc3987 = {version = "*", optional = true, markers = "extra == \"format\""} rpds-py = ">=0.7.1" uri-template = {version = "*", optional = true, markers = "extra == \"format-nongpl\""} -webcolors = [ - {version = ">=1.11", optional = true, markers = "extra == \"format\""}, - {version = ">=24.6.0", optional = true, markers = "extra == \"format-nongpl\""}, -] +webcolors = {version = ">=24.6.0", optional = true, markers = "extra == \"format-nongpl\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] @@ -3368,6 +3364,21 @@ pydantic = [ requests = ">=2,<3" requests-toolbelt = ">=1.0.0,<2.0.0" +[[package]] +name = "liccheck" +version = "0.9.2" +description = "Check python packages from requirement.txt and report issues" +optional = false +python-versions = ">=3.5" +files = [ + {file = "liccheck-0.9.2-py2.py3-none-any.whl", hash = "sha256:15cbedd042515945fe9d58b62e0a5af2f2a7795def216f163bb35b3016a16637"}, + {file = "liccheck-0.9.2.tar.gz", hash = "sha256:bdc2190f8e95af3c8f9c19edb784ba7d41ecb2bf9189422eae6112bf84c08cd5"}, +] + +[package.dependencies] +semantic-version = ">=2.7.0" +toml = "*" + [[package]] name = "litellm" version = "1.50.1" @@ -6927,24 +6938,13 @@ idna2008 = ["idna"] name = "rfc3986-validator" version = "0.1.1" description = "Pure python rfc3986 validator" -optional = true +optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ {file = "rfc3986_validator-0.1.1-py2.py3-none-any.whl", hash = "sha256:2f235c432ef459970b4306369336b9d5dbdda31b510ca1e327636e01f528bfa9"}, {file = "rfc3986_validator-0.1.1.tar.gz", hash = "sha256:3d44bde7921b3b9ec3ae4e3adca370438eccebc676456449b145d533b240d055"}, ] -[[package]] -name = "rfc3987" -version = "1.3.8" -description = "Parsing and validation of URIs (RFC 3986) and IRIs (RFC 3987)" -optional = false -python-versions = "*" -files = [ - {file = "rfc3987-1.3.8-py2.py3-none-any.whl", hash = "sha256:10702b1e51e5658843460b189b185c0366d2cf4cff716f13111b0ea9fd2dce53"}, - {file = "rfc3987-1.3.8.tar.gz", hash = "sha256:d3c4d257a560d544e9826b38bc81db676890c79ab9d7ac92b39c7a253d5ca733"}, -] - [[package]] name = "rich" version = "13.9.2" @@ -7384,6 +7384,21 @@ files = [ cryptography = ">=2.0" jeepney = ">=0.6" +[[package]] +name = "semantic-version" +version = "2.10.0" +description = "A library implementing the 'SemVer' scheme." +optional = false +python-versions = ">=2.7" +files = [ + {file = "semantic_version-2.10.0-py2.py3-none-any.whl", hash = "sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177"}, + {file = "semantic_version-2.10.0.tar.gz", hash = "sha256:bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c"}, +] + +[package.extras] +dev = ["Django (>=1.11)", "check-manifest", "colorama (<=0.4.1)", "coverage", "flake8", "nose2", "readme-renderer (<25.0)", "tox", "wheel", "zest.releaser[recommended]"] +doc = ["Sphinx", "sphinx-rtd-theme"] + [[package]] name = "semver" version = "3.0.2" @@ -8094,6 +8109,17 @@ dev = ["tokenizers[testing]"] docs = ["setuptools-rust", "sphinx", "sphinx-rtd-theme"] testing = ["black (==22.3)", "datasets", "numpy", "pytest", "requests", "ruff"] +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + [[package]] name = "tomli" version = "2.0.2" @@ -9050,4 +9076,4 @@ vectordb = ["faiss-cpu", "numpy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "8aca97beee32617c22bb953722ff36173e8895e009892b22e0c130081cbebc72" +content-hash = "0d7414c61f9bc3d5ca506b5ca6affc72f54377470d390b0e00777eed9d6b630c" diff --git a/pyproject.toml b/pyproject.toml index 9ee323de7..b244ccdea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "guardrails-ai" -version = "0.6.4" +version = "0.6.5" description = "Adding guardrails to large language models." authors = ["Guardrails AI "] license = "Apache License 2.0" @@ -46,7 +46,7 @@ requests = "^2.31.0" faker = "^25.2.0" jsonref = "^1.1.0" jsonformer = {version = "0.12.0", optional = true} -jsonschema = {version = "^4.22.0", extras = ["format"]} +jsonschema = {version = "^4.22.0", extras = ["format-nongpl"]} pip = ">=22" pyjwt = "^2.8.0" opentelemetry-sdk = "^1.24.0" @@ -87,6 +87,8 @@ pypdfium2 = "^4.23.1" pyright = "1.1.334" lxml-stubs = "^0.4.0" ruff = ">=0.4.1" +liccheck = "^0.9.2" + [tool.poetry.group.api] optional = true @@ -132,3 +134,42 @@ markers = [ [pytest] log_cli = "True" log_cli_level = "DEBUG" + + +[tool.liccheck] +authorized_licenses = [ + "3-clause bsd", + "bsd", + "new bsd", + "bsd license", + "new bsd license", + "simplified bsd", + "academic free license (afl)", + "apache", + "apache 2.0", + "apache software", + "apache software license", + "gnu lgpl", + "lgpl with exceptions or zpl", + "gnu library or lesser general public license (lgpl)", + "isc", + "isc license", + "isc license (iscl)", + "mit", + "mit license", + "mozilla public license 2.0 (mpl 2.0)", + "the unlicense (unlicense)", + "python software foundation", + "python software foundation license", + "zpl 2.1", +] +unauthorized_licenses = [ + "gpl v3", +] +level = "Paranoid" +dependencies = true # to load [tool.poetry.dependencies] + +[tool.liccheck.authorized_packages] +aiocache = "0.12.3" # BSD 3-Clause +aiohappyeyeballs = "2.4.3" # Python Software Foundation +guardrails-api = "*" # Modified ELSSTIC \ No newline at end of file