Skip to content

Commit

Permalink
Updated Dependency : types-pkg-resources to types-setuptools (#398)
Browse files Browse the repository at this point in the history
* Updating types-pkg_resources to types-setuptools and type casting relative schema to str

* Fix failing test

* Undo constants.py changes

---------

Co-authored-by: Ajinkya Udgirkar <ajinkyaudgirkar@gmail.com>
  • Loading branch information
tanwigeetika1618 and audgirka committed Aug 12, 2024
1 parent 9bbb0f0 commit 0cceba1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ repos:
- subprocess-tee>=0.4.1
- "typing-extensions>=4.5.0;python_version<'3.10'"
- types-PyYAML
- types-pkg_resources
- types-setuptools
- types-jsonschema>=4.4.9
- repo: https://github.com/pycqa/pylint
rev: v3.2.4
Expand Down
4 changes: 2 additions & 2 deletions src/ansible_compat/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def validate(
data_path=to_path(validation_error.absolute_path),
json_path=json_path(validation_error.absolute_path),
schema_path=to_path(validation_error.schema_path),
relative_schema=validation_error.schema,
expected=validation_error.validator_value,
relative_schema=str(validation_error.schema),
expected=str(validation_error.validator_value),
validator=str(validation_error.validator),
found=str(validation_error.instance),
)
Expand Down
4 changes: 2 additions & 2 deletions test/assets/validate0_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"data_path": "environment.a",
"json_path": "$.environment.a",
"schema_path": "properties.environment.additionalProperties.type",
"relative_schema": { "type": "string" },
"relative_schema": "{'type': 'string'}",
"expected": "string",
"validator": "type",
"found": "False"
Expand All @@ -14,7 +14,7 @@
"data_path": "environment.b",
"json_path": "$.environment.b",
"schema_path": "properties.environment.additionalProperties.type",
"relative_schema": { "type": "string" },
"relative_schema": "{'type': 'string'}",
"expected": "string",
"validator": "type",
"found": "True"
Expand Down

0 comments on commit 0cceba1

Please sign in to comment.