Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
ansible-core-version: ["2.16.14"]
runs-on: "ubuntu-latest"
env:
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
ansible-core-version: ["2.16.14"]
runs-on: "ubuntu-latest"
env:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.5.2 - 2026-04-09

- #185 Added Python 3.14 support.
- #187 Updated CI to use Python 3.14.
- #187 Changed `load_file` to use `urlparse` to handle file URIs.

## v1.5.1 - 2025-11-12

- #179 Added Python 3.13 support.
Expand Down
1,179 changes: 623 additions & 556 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "schema-enforcer"
version = "1.5.1"
version = "1.5.2"
description = "Tool/Framework for testing structured data against schema definitions"
authors = ["Network to Code, LLC <info@networktocode.com>"]
license = "Apache-2.0"
Expand All @@ -15,6 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
include = [
"CHANGELOG.md",
Expand All @@ -26,7 +27,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.10,<3.14"
python = ">=3.10,<3.15"
# Packages
click = ">=8.2.0"
jinja2 = ">=3.1.6,<4.0.0"
Expand Down
8 changes: 4 additions & 4 deletions schema_enforcer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import glob
from collections.abc import Mapping, Sequence
import importlib
from urllib import parse as urlparse

from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import DoubleQuotedScalarString as DQ
Expand Down Expand Up @@ -374,10 +375,9 @@ def load_file(filename, file_type=None):
if not file_type:
file_type = "json" if filename.endswith(".json") else "yaml"

# When called from JsonRef, filename will contain a URI not just a local file,
# but this function only handles local files. See jsonref.JsonLoader for a fuller implementation
if filename.startswith("file:///"):
filename = filename.replace("file://", "")
# When called from JsonRef, filename will contain a file URI not just a local path
if filename.startswith("file:"):
filename = urlparse.urlparse(filename).path

handler = YAML_HANDLER if file_type == "yaml" else json
with open(filename, "r", encoding="utf-8") as fileh:
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from schema_enforcer.utils import load_file
from schema_enforcer.schemas.jsonschema import JsonSchema


FIXTURES_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "fixtures", "test_jsonschema")
FORMAT_CHECK_ERROR_MESSAGE_MAPPING = {
"incorrect_regex_format": "'[' is not a 'regex'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

from schema_enforcer.schemas.manager import PydanticManager


manager1 = PydanticManager(models=[Hostname, Interfaces])
manager2 = PydanticManager(prefix="pydantic", models=[Hostname, Interfaces, Dns])
1 change: 0 additions & 1 deletion tests/test_ansible_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from schema_enforcer.ansible_inventory import AnsibleInventory


INVENTORY_DIR = "tests/mocks/inventory"


Expand Down
1 change: 1 addition & 0 deletions tests/test_jsonschema.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pylint: disable=redefined-outer-name
"""Tests to validate functions defined in jsonschema.py"""

import os
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/test_schemas_schema_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pylint: disable=redefined-outer-name
"""Test manager.py SchemaManager class"""

import os
import pytest
from schema_enforcer.schemas.manager import SchemaManager
Expand Down
Loading