Skip to content

Commit 662319c

Browse files
authored
Added python 3.14 to CI matrix (#187)
* Added python 3.14 to CI matrix * Changed load_file to use urlparse
1 parent 7b076a1 commit 662319c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
strategy:
7676
fail-fast: true
7777
matrix:
78-
python-version: ["3.10", "3.11", "3.12", "3.13"]
78+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
7979
ansible-core-version: ["2.16.14"]
8080
runs-on: "ubuntu-latest"
8181
env:
@@ -159,7 +159,7 @@ jobs:
159159
strategy:
160160
fail-fast: true
161161
matrix:
162-
python-version: ["3.10", "3.11", "3.12", "3.13"]
162+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
163163
ansible-core-version: ["2.16.14"]
164164
runs-on: "ubuntu-latest"
165165
env:

schema_enforcer/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import glob
66
from collections.abc import Mapping, Sequence
77
import importlib
8+
from urllib import parse as urlparse
89

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

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

382382
handler = YAML_HANDLER if file_type == "yaml" else json
383383
with open(filename, "r", encoding="utf-8") as fileh:

0 commit comments

Comments
 (0)