From 97a2ff0d3cda6039177e5e4ef6b8d38df4693559 Mon Sep 17 00:00:00 2001 From: Caleb Courier Date: Tue, 11 Mar 2025 13:11:00 -0500 Subject: [PATCH 1/5] remove unused deps --- poetry.lock | 49 ++----------------------------------------------- pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/poetry.lock b/poetry.lock index d17a51d9f..e4df2a28d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "aiocache" @@ -873,23 +873,6 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] -[[package]] -name = "coloredlogs" -version = "15.0.1" -description = "Colored terminal output for Python's logging module" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "coloredlogs-15.0.1-py2.py3-none-any.whl", hash = "sha256:612ee75c546f53e92e70049c9dbfcc18c935a2b9a53b66085ce9ef6a6e5c0934"}, - {file = "coloredlogs-15.0.1.tar.gz", hash = "sha256:7c991aa71a4577af2f82600d8f8f3a89f936baeaf9b50a9c197da014e5bf16b0"}, -] - -[package.dependencies] -humanfriendly = ">=9.1" - -[package.extras] -cron = ["capturer (>=2.4)"] - [[package]] name = "comm" version = "0.2.2" @@ -2367,20 +2350,6 @@ testing = ["InquirerPy (==0.3.4)", "Jinja2", "Pillow", "aiohttp", "fastapi", "gr torch = ["safetensors[torch]", "torch"] typing = ["types-PyYAML", "types-requests", "types-simplejson", "types-toml", "types-tqdm", "types-urllib3", "typing-extensions (>=4.8.0)"] -[[package]] -name = "humanfriendly" -version = "10.0" -description = "Human friendly output for text interfaces using Python" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "humanfriendly-10.0-py2.py3-none-any.whl", hash = "sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477"}, - {file = "humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc"}, -] - -[package.dependencies] -pyreadline3 = {version = "*", markers = "sys_platform == \"win32\" and python_version >= \"3.8\""} - [[package]] name = "identify" version = "2.6.1" @@ -6343,20 +6312,6 @@ files = [ {file = "pypdfium2-4.30.0.tar.gz", hash = "sha256:48b5b7e5566665bc1015b9d69c1ebabe21f6aee468b509531c3c8318eeee2e16"}, ] -[[package]] -name = "pyreadline3" -version = "3.5.4" -description = "A python implementation of GNU readline." -optional = false -python-versions = ">=3.8" -files = [ - {file = "pyreadline3-3.5.4-py3-none-any.whl", hash = "sha256:eaf8e6cc3c49bcccf145fc6067ba8643d1df34d604a1ec0eccbf7a18e6d3fae6"}, - {file = "pyreadline3-3.5.4.tar.gz", hash = "sha256:8d57d53039a1c75adba8e50dd3d992b28143480816187ea5efbd5c78e6c885b7"}, -] - -[package.extras] -dev = ["build", "flake8", "mypy", "pytest", "twine"] - [[package]] name = "pyright" version = "1.1.334" @@ -9095,4 +9050,4 @@ vectordb = ["faiss-cpu", "numpy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "56897ffe8ae1275825b1411837fa7d809625a453f22a231edf8cb0458a11529e" +content-hash = "8aca97beee32617c22bb953722ff36173e8895e009892b22e0c130081cbebc72" diff --git a/pyproject.toml b/pyproject.toml index 809243d38..b4b780271 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ lxml = "^4.9.3" openai = "^1.30.1" rich = "^13.6.0" pydantic = ">=2.0.0, <3.0" -typer = {extras = ["all"], version = ">=0.9.0,<0.16"} +typer = {version = ">=0.9.0,<0.16"} griffe = "^0.36.9" tenacity = ">=8.1.0" rstr = "^3.2.2" @@ -42,7 +42,6 @@ pydash = "^7.0.6" docspec_python = "2.2.1" pydoc-markdown = "4.8.2" langchain-core = ">=0.1,<0.4" -coloredlogs = "^15.0.1" requests = "^2.31.0" faker = "^25.2.0" jsonref = "^1.1.0" From 4a6496ad2b3fd1f0f20d17cc5de2541e60da29b2 Mon Sep 17 00:00:00 2001 From: Caleb Courier Date: Tue, 11 Mar 2025 15:19:32 -0500 Subject: [PATCH 2/5] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b4b780271..9ee323de7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "guardrails-ai" -version = "0.6.3" +version = "0.6.4" description = "Adding guardrails to large language models." authors = ["Guardrails AI "] license = "Apache License 2.0" From edf72194e16b029f90d8e2eecf7f6b94a3ee6b54 Mon Sep 17 00:00:00 2001 From: Caleb Courier Date: Tue, 11 Mar 2025 15:35:11 -0500 Subject: [PATCH 3/5] add faq about distutils issue --- docs/faq.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/faq.md b/docs/faq.md index 9cc32301c..9c93932e1 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -129,3 +129,25 @@ If your login issues persist, please check the contents of the ~/.guardrailsrc f If you're still encountering issues, please [open an issue](https://github.com/guardrails-ai/guardrails/issues/new) and we'll help you out! We're also available on [Discord](https://discord.gg/U9RKkZSBgx) if you want to chat with us directly. + +## I'm getting an error realted to distutils when installing validators. +This can happen on cuda enabled devices in python versions 3.11 and below when a validator indirectly depends on a package that imports distutils. `triton`, a dependency of pytorch, is one such example. + +If you see an error similar the one below: +```sh +Installing hub://guardrails/nsfw_text... +[ =] Running post-install setup +Device set to use cpu +/home/ubuntu/support/.venv/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils. + warnings.warn( +/home/ubuntu/support/.venv/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. + warnings.warn("Setuptools is replacing distutils.") +ERROR:guardrails-cli:Failed to import transformers.pipelines because of the following error (look up to see its traceback): +/home/ubuntu/.pyenv/versions/3.11.11/lib/python3.11/distutils/core.py +``` + +set the following as an environment variable to tell python to use the builtin version of distutils that exists in 3.11 and below: + +```sh +export SETUPTOOLS_USE_DISTUTILS="stdlib" +``` \ No newline at end of file From b32c33f15e849fe43d068680d64c05151381a570 Mon Sep 17 00:00:00 2001 From: Caleb Courier Date: Tue, 11 Mar 2025 15:38:16 -0500 Subject: [PATCH 4/5] typo --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 9c93932e1..9df839033 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -133,7 +133,7 @@ We're also available on [Discord](https://discord.gg/U9RKkZSBgx) if you want to ## I'm getting an error realted to distutils when installing validators. This can happen on cuda enabled devices in python versions 3.11 and below when a validator indirectly depends on a package that imports distutils. `triton`, a dependency of pytorch, is one such example. -If you see an error similar the one below: +If you see an error similar to the one below: ```sh Installing hub://guardrails/nsfw_text... [ =] Running post-install setup From 77b709e073d4af10d32fbd6933dbbbbd167ed9df Mon Sep 17 00:00:00 2001 From: Caleb Courier Date: Tue, 11 Mar 2025 15:39:10 -0500 Subject: [PATCH 5/5] remove line --- docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 9df839033..249de7548 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -131,7 +131,7 @@ If you're still encountering issues, please [open an issue](https://github.com/g We're also available on [Discord](https://discord.gg/U9RKkZSBgx) if you want to chat with us directly. ## I'm getting an error realted to distutils when installing validators. -This can happen on cuda enabled devices in python versions 3.11 and below when a validator indirectly depends on a package that imports distutils. `triton`, a dependency of pytorch, is one such example. +This can happen on cuda enabled devices in python versions 3.11 and below when a validator indirectly depends on a package that imports distutils. If you see an error similar to the one below: ```sh