diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2f31fb710..600ad9d5a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,5 +5,7 @@ jobs: uses: open-contracting/.github/.github/workflows/lint.yml@main permissions: contents: write + secrets: + personal-access-token: ${{ secrets.PAT }} with: python-version: '3.10' diff --git a/common-requirements.txt b/common-requirements.txt index fb836f0ad..3ca01e41a 100644 --- a/common-requirements.txt +++ b/common-requirements.txt @@ -90,7 +90,7 @@ myst-parser==0.18.1 # via -r common-requirements.in ocds-babel==0.3.6 # via -r common-requirements.in -ocdsextensionregistry==0.6.1 +ocdsextensionregistry==0.6.5 # via -r common-requirements.in ocdsindex==0.2.0 # via -r common-requirements.in diff --git a/manage.py b/manage.py index b08b23b3d..dc2ffe475 100755 --- a/manage.py +++ b/manage.py @@ -15,7 +15,6 @@ import click import json_merge_patch -import jsonref import lxml.etree import lxml.html import requests @@ -23,6 +22,7 @@ from docutils.utils import relative_path from lxml import etree from ocdsextensionregistry import get_versioned_release_schema +from ocdsextensionregistry.util import replace_refs from ocdskit.schema import get_schema_fields basedir = Path(__file__).resolve().parent @@ -41,10 +41,10 @@ def custom_warning_formatter(message, category, filename, lineno, line=None): warnings.formatwarning = custom_warning_formatter -def json_load(filename, library=json, **kwargs): +def json_load(filename): """Load JSON data from the given filename.""" with (schemadir / filename).open() as f: - return library.load(f, **kwargs) + return json.load(f) def json_dump(filename, data): @@ -209,14 +209,14 @@ def pre_commit(): } release_schema = json_load("release-schema.json") - jsonref_release_schema = json_load("release-schema.json", jsonref, merge_props=True) + jsonref_release_schema = replace_refs(json_load("release-schema.json"), keep_defs=True) counts = defaultdict(list) nonstring = ("boolean", "integer", "number", "object") for field in get_schema_fields(jsonref_release_schema): name = field.path_components[-1] # Skip definitions (output dereferenced properties only). Skip deprecated fields. - if field.definition_pointer_components or field.deprecated: + if field.definition or field.deprecated: continue multilingual = ( # If a field can be a non-string, it is not multilingual. diff --git a/requirements.txt b/requirements.txt index 1c7a3ab40..33d3d98dd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # Add your own requirements below. -ocdskit==1.1.3 +ocdskit==1.3.0 sphinx-design==0.4.1 sphinxcontrib-opencontracting==0.0.8 sphinxcontrib-opendataservices-jsonschema==0.7.1