Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ead48a6
update lxml
evanvolgas Jun 18, 2025
9ddab38
Replace pkg_resources with importlib.metadata for version retrieval i…
AlejandroEsquivel Jul 14, 2025
e4160c3
Bump the npm_and_yarn group across 1 directory with 2 updates
dependabot[bot] Jul 18, 2025
1667366
fix tests
CalebCourier Sep 11, 2025
4590fbb
open up lxml version range
CalebCourier Sep 11, 2025
fb3f70e
Merge pull request #1295 from guardrails-ai/chore/remove-pkg-resources
CalebCourier Sep 11, 2025
61073cc
Merge pull request #1279 from sifaka-ai/lxml
CalebCourier Sep 11, 2025
602615c
Merge pull request #1299 from guardrails-ai/dependabot/npm_and_yarn/n…
CalebCourier Sep 11, 2025
fe270a0
Merge pull request #1310 from guardrails-ai/lxml
CalebCourier Sep 11, 2025
89558ef
switch to project dependencies; open up verison ranges
CalebCourier Sep 12, 2025
b283e04
test numpy 2, remove todos
CalebCourier Sep 12, 2025
c022c83
install dev deps for license check step
CalebCourier Sep 12, 2025
52c5de9
with -> extras
CalebCourier Sep 12, 2025
f957d6b
Merge pull request #1312 from guardrails-ai/open-version-ranges
CalebCourier Sep 12, 2025
c7968ea
bump version
CalebCourier Sep 12, 2025
d5aa9eb
update poetry.lock
CalebCourier Sep 12, 2025
d7a3eb6
downgrade pyright until we can dedicate a task to upgrading
CalebCourier Sep 12, 2025
ed9df65
lock transformers to lower version range bc of jsonformer
CalebCourier Sep 12, 2025
1feaf72
remove extraneous enum field that was introduced in pydantic 2.7 by e…
CalebCourier Sep 12, 2025
62b13c9
autoformat
CalebCourier Sep 12, 2025
e6b7dc3
autoformat
CalebCourier Sep 12, 2025
6ba86cd
update license list
CalebCourier Sep 12, 2025
2975c39
npm audit fixews
CalebCourier Sep 12, 2025
170e6bd
drop version number so we can run dependabot before releasing
CalebCourier Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# Setup Virtual Environment
python3 -m venv ./.venv
source .venv/bin/activate
poetry install
poetry install --extras dev

- name: Check license
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.13.0
hooks:
# Performs ruff check with safe fixes
- id: ruff
Expand Down
4 changes: 2 additions & 2 deletions guardrails/hub/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from string import Template
from typing import Callable, cast, List

import pkg_resources
import importlib.metadata

from guardrails.hub.validator_package_service import (
ValidatorPackageService,
Expand Down Expand Up @@ -149,7 +149,7 @@ def install(
installed_version_message = ""
with contextlib.suppress(Exception):
package_name = ValidatorPackageService.get_normalized_package_name(validator_id)
installed_version = pkg_resources.get_distribution(package_name).version
installed_version = importlib.metadata.version(package_name)
if installed_version:
installed_version_message = f" version {installed_version}"

Expand Down
6 changes: 2 additions & 4 deletions guardrails/llm_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ def _invoke_llm(
import torch
except ImportError:
raise PromptCallableException(
"The `torch` package is not installed. "
"Install with `pip install torch`"
"The `torch` package is not installed. Install with `pip install torch`"
)
prompt = messages_to_prompt_string(messages)
tokenizer = kwargs.pop("tokenizer")
Expand Down Expand Up @@ -384,8 +383,7 @@ def _invoke_llm(
import torch # noqa: F401 # type: ignore
except ImportError:
raise PromptCallableException(
"The `torch` package is not installed. "
"Install with `pip install torch`"
"The `torch` package is not installed. Install with `pip install torch`"
)

content_key = kwargs.pop("content_key", "generated_text")
Expand Down
2 changes: 1 addition & 1 deletion guardrails/utils/openai_utils/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def get_static_openai_create_func():
warnings.warn(
"This function is deprecated. " " and will be removed in 0.6.0",
"This function is deprecated. and will be removed in 0.6.0",
DeprecationWarning,
)
return openai.completions.create
Expand Down
2 changes: 1 addition & 1 deletion guardrails/utils/prompt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def prompt_content_for_string_schema(
description = output_schema.get("description")
if description:
prompt_content += (
"Here's a description of what I want you to generate: " f"{description}"
f"Here's a description of what I want you to generate: {description}"
)
validators = validator_map.get(json_path, [])
if len(validators):
Expand Down
4 changes: 2 additions & 2 deletions guardrails/utils/structured_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def set_additional_properties_false_iteratively(schema):
current["properties"].keys()
) # this has to be set
if "maximum" in current:
logger.warn("Property maximum is not supported." " Dropping")
logger.warn("Property maximum is not supported. Dropping")
current.pop("maximum") # the api does not like these set
if "minimum" in current:
logger.warn("Property maximum is not supported." " Dropping")
logger.warn("Property maximum is not supported. Dropping")
current.pop("minimum") # the api does not like these set
if "default" in current:
logger.warn("Property default is not supported. Marking field Required")
Expand Down
3 changes: 1 addition & 2 deletions guardrails/utils/validator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def parse_rail_arguments(arg_tokens: List[str]) -> List[Any]:
t = literal_eval(t)
except (ValueError, SyntaxError, NameError) as e:
raise ValueError(
f"Python expression `{t}` is not valid, "
f"and raised an error: {e}."
f"Python expression `{t}` is not valid, and raised an error: {e}."
)
validator_args.append(t)
return validator_args
Expand Down
6 changes: 3 additions & 3 deletions guardrails/validator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ def __init__(
# Store the kwargs for the validator.
self._kwargs = kwargs

assert (
self.rail_alias in validators_registry
), f"Validator {self.__class__.__name__} is not registered. "
assert self.rail_alias in validators_registry, (
f"Validator {self.__class__.__name__} is not registered. "
)

@property
@deprecated(
Expand Down
3 changes: 1 addition & 2 deletions guardrails/validator_service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def should_run_sync():
bool_values = ["true", "false"]
if run_sync.lower() not in bool_values:
warnings.warn(
f"GUARDRAILS_RUN_SYNC must be one of {bool_values}!"
f" Defaulting to 'false'."
f"GUARDRAILS_RUN_SYNC must be one of {bool_values}! Defaulting to 'false'."
)
return process_count == 1 or run_sync.lower() == "true"

Expand Down
Loading