Skip to content

Commit

Permalink
build: Upgrade code for latest ocdskit and ocdsextensionregistry
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Dec 15, 2024
1 parent 9342489 commit d2f4a95
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
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
9 changes: 5 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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
Expand All @@ -41,10 +42,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 +210,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

0 comments on commit d2f4a95

Please sign in to comment.