Skip to content

Commit

Permalink
Merge branch 'devel' into schemas-as-classes-no-validation-nested
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausHolbechArista authored Oct 21, 2024
2 parents b912109 + 9c73555 commit 0142915
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ jobs:
- uses: actions/checkout@v4
- name: 'Install Python & Ansible requirements'
run: |
pip install pydantic>=2.3.0 "ansible-core<2.18.0" -r .github/requirements-ci.txt --upgrade
pip install "ansible-core<2.18.0" -r .github/requirements-ci.txt --upgrade
ansible-galaxy collection install -r ansible_collections/arista/avd/collections.yml
- name: Install galaxy-importer
# Install the specific version of galaxy-importer used on galaxy.ansible.com
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ repos:
language: python
files: python-avd/pyavd/[a-z_]+/schema
pass_filenames: false
additional_dependencies: ['deepmerge>=1.1.0', 'PyYAML>=6.0.0', 'pydantic>=2.3.0', 'jsonschema>=4.10.3', 'referencing>=0.35.0', 'isort']
additional_dependencies: ['deepmerge>=1.1.0', 'PyYAML>=6.0.0', 'pydantic>=2.3.0', 'jsonschema-rs', 'referencing>=0.35.0']

- id: schemas
name: Build Python Classes from AVD Schemas
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ help: ## Display help message
#########################################
.PHONY: collection-build
collection-build: ## Build arista.avd collection locally.
./python-avd/scripts/build-schemas.py
ansible-galaxy collection build --force ansible_collections/arista/avd

#########################################
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/avd/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ codespell>=2.2.6
deepmerge>=1.1.0
docker>=7.1.0
identify>=1.4.20
jsonschema>=4.10.3
jsonschema-rs
molecule>=6.0
molecule-plugins[docker]>=23.4.0
pydantic>=2.3.0
Expand Down
2 changes: 1 addition & 1 deletion python-avd/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requires = [
"setuptools>=66.1",
"wheel",
"jinja2>=3.0",
"jsonschema>=4.10.3",
"jsonschema-rs",
"referencing>=0.35.0",
"deepmerge>=1.1.0",
"pyyaml>=6.0.0",
Expand Down
4 changes: 2 additions & 2 deletions python-avd/scripts/build-schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sys import path
from textwrap import indent

import jsonschema
import jsonschema_rs
from deepmerge import always_merger
from yaml import CSafeDumper, CSafeLoader
from yaml import dump as yaml_dump
Expand Down Expand Up @@ -48,7 +48,7 @@ def combine_schemas() -> None:

def validate_schemas(schema_store: dict) -> None:
"""Validate schemas according to metaschema."""
schema_validator = jsonschema.Draft7Validator(schema_store["avd_meta_schema"])
schema_validator = jsonschema_rs.Draft7Validator(schema_store["avd_meta_schema"])
for schema_name in SCHEMA_FRAGMENTS_PATHS:
print(f"Validating schema '{schema_name}'")
schema_validator.validate(schema_store[schema_name])
Expand Down

0 comments on commit 0142915

Please sign in to comment.