Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Upgrade code for latest ocdskit and ocdsextensionregistry #1728

Merged
merged 2 commits into from
Dec 15, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion common-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

import click
import json_merge_patch
import jsonref
import lxml.etree
import lxml.html
import requests
from babel.messages.pofile import read_po
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
Expand All @@ -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):
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading